dpa99c / phonegap-launch-navigator

Phonegap/Cordova plugin which launches native route navigation apps for Android, iOS and Windows
369 stars 129 forks source link

Not recognizing google_maps on iOS #239

Closed skeditAdmin closed 4 years ago

skeditAdmin commented 4 years ago

Using Ionic 4 with Capacitor

uk.co.workingedge.phonegap.plugin.launchnavigator version 5.0.4

Since upgrading to Capacitor, launch navigator no longer recognizes google maps.

Google maps is installed: Google-Maps

Running the following code:

constructor(private launchNavigator: LaunchNavigator) {}
...
ngOnInit() {
    const availableApps = await this.launchNavigator.availableApps();
    alert(JSON.stringify(availableApps));
}

gives me the following:

info

dpa99c commented 4 years ago

This is a Cordova plugin - Capacitor is not a supported environment.

skeditAdmin commented 4 years ago

Capacitor can use Cordova plug ins. I'm using several other plug-ins, and everything else about your plug-in works except for the google maps.

The fact that it shows "apple_maps: true" shows me that it's working. I can open Apple maps just fine. Just not google maps.

sbannigan commented 4 years ago

@skeditAdmin this plugin does work with Capacitor. When you run npx cap update after installing the plugin, you should see this warning:

[warn] Plugin uk.co.workingedge.phonegap.plugin.launchnavigator requires you to add 
  <key>LSApplicationQueriesSchemes</key>
  <array>
    <string>citymapper</string>
    <string>comgooglemaps</string>
    <string>navigon</string>
    <string>transit</string>
    <string>waze</string>
    <string>yandexnavi</string>
    <string>uber</string>
    <string>tomtomhome</string>
    <string>com.sygic.aura</string>
    <string>here-route</string>
    <string>moovit</string>
    <string>lyft</string>
    <string>mapsme</string>
    <string>cabify</string>
    <string>baidumap</string>
    <string>taxis99</string>
    <string>iosamap</string>
  </array>
 to your Info.plist to work

Because Cordova normally handles building the Info.plist using each plugin's config, but Capacitor allows you to manage the native platform files yourself, you must add this manually. After you add it you will no longer see the warning message when updating plugins and the availableApps() functionality should work correctly.