Search code examples
androidmapsphonegapnavigator

Phonegap open navigator err_unknown_url_scheme


I created my app, both for iOS and Android.

The app shows a map with some Points Of Interest. If the user taps on one of them, the app try to open the navigator.

onclick="cordova.InAppBrowser.open("https://maps.google.com/maps?daddr=45.29062,8.055613519999952&mode=transit", "_blank", "location=yes")"

The code above is an example. I call that url from the app and the cordova inappbrowser open the navigator preview correctly.

When I click to start the trip, the browser ask you to open the google maps app. if you say "no", it doens't do anything. So, you're forced to click on "yes".

After you click on "yes", in iOS works, but in Android I see the following error: enter image description here

Note that I can't manage the button "Navigate" showed when the user clicks on the POI. Further, if I click the link, my phone opens correctly google maps app, but if I copy&paste the url in my browser, I see the navigator preview without the "start" button.


Solution

  • Solved replacing the target "_blank" with "_system".

    So, the correct code line is:

    onclick="cordova.InAppBrowser.open("https://maps.google.com/maps?daddr=45.29062,8.055613519999952&mode=transit", "_system", "location=yes")"