apache / cordova-ios

Apache Cordova iOS
https://cordova.apache.org/
Apache License 2.0
2.16k stars 986 forks source link

Fail to launch google map app even if comgooglemaps is included in LSApplicationQueriesSchemes #1450

Open 75341704 opened 1 month ago

75341704 commented 1 month ago

Bug Report

Problem

In the info.plist, it includes hereunder, `LSApplicationQueriesSchemes

... comgooglemaps ...

`

window.location.href="comgooglemaps://?saddr=28,120&daddr=31,121&directionsmode=driving"; The message "Failed to load webpage with error: unsupported URL" was in Xcode and it failed to launch google map app.

But I copied "comgooglemaps://?saddr=28,120&daddr=31,121&directionsmode=driving" and pasted it in safari. It works.( It notify us whether the google map app shall be launched or not. if ok, the google map app is launched...)

Any further settings are required?

What is expected to happen?

window.location.href="comgooglemaps://?saddr=28,120&daddr=31,121&directionsmode=driving"; and launch the google map app

What does actually happen?

Information

Command or Code

Environment, Platform, Device

IPHONE 12 ios 17.5.1

Version information

9.0.0 (cordova-lib@9.0.1)

Checklist

jcesarmobile commented 1 month ago

Did you add an allow-intent tag in your config.xml? https://cordova.apache.org/docs/en/latest/config_ref/index.html#allow-intent

75341704 commented 1 month ago

@jcesarmobile The config.xml snapshot is hereunder image

dpogue commented 3 weeks ago

The behaviour for launching other apps from URLs is complicated and inconsistent. I suspect this might be due to trying to open it via JavaScript with window.location.href.

@75341704 Out of curiosity, if you add a link to your app with the Google Maps URL and tap it, does it launch the map app properly? Something like this:

<a href="comgooglemaps://?saddr=28,120&daddr=31,121&directionsmode=driving">Test link to open map</a>