dpa99c / phonegap-launch-navigator

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

Apple Map is always detected as available in iOS #116

Closed svenkeeter closed 7 years ago

svenkeeter commented 7 years ago

Even when Apple Maps is uninstalled, running:

launchnavigator.availableApps(function(results){
    for(var app in results){
        console.log(launchnavigator.getAppDisplayName(app) + (results[app] ? " is" : " isn't") +" available");
    }
});

will always return it as available in iOS

dpa99c commented 7 years ago

Before iOS 10, you couldn't delete built-in apps, so the plugin just assumes it's there.

So it needs updating to check for presence of Apple Maps, just like for any other app.

dpa99c commented 7 years ago

https://github.com/dpa99c/phonegap-launch-navigator/blob/master/src/ios/CMMapLauncher.m#L143

svenkeeter commented 7 years ago

Thank you for your prompt reply. I'll see what i can do about it or just wait for the fix 😃

dpa99c commented 7 years ago

It doesn't look like it's possible to detect if Apple Maps is installed or not, since removing it does not actually uninstall the app, it just hides the icon from the home screen.

I'm going by this SO question.

So it seems not possible to detect if Apple Maps is unavailable in advance (which is the exact intention of launchnavigator.availableApps().

The best that can be done is to gracefully handle the error when attempting to open Apple Maps using launchnavigator.navigate().

So I think this issue needs to be documented as a caveat rather than fixed as a bug.