dpa99c / phonegap-launch-navigator

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

Disabled apps are treated as available even though the apps cannot be opened. #182

Closed iamjoyce closed 6 years ago

iamjoyce commented 6 years ago

I'm submitting a ... (check one with "x"):

Bug report

Prerequisite:

No map apps were installed, and default map app (Google map) is disabled.

Current behavior:

this.launchNavigator.navigate(...)

this.launchNavigator.availableApps()

this.launchNavigator.isAppAvailable('google_maps')

Expected behavior:

this.launchNavigator.navigate() should return something to indicate that map app failed to launch.

this.launchNavigator.availableApps() should not return apps that are disabled.

this.launchNavigator.isAppAvailable('google_maps') should return false since the app is disabled.

Steps to reproduce:

  1. Disable/ Uninstall all map apps in the phone.
  2. Call this.launchNavigator.navigate()
    • Nothing happens
  3. Call this.launchNavigator.availableApps()
    • Map app that was disabled will still be counted as 'available'.

Environment information

Runtime issue

If using an [Ionic Native Typescript wrapper]() for this plugin:

dpa99c commented 6 years ago

Thanks for reporting. Disabling Google Maps isn't an edge case I'd thought of, but it should be possible to detect if it's been disabled: https://stackoverflow.com/a/14558066/777265

iamjoyce commented 6 years ago

Tested and verified that availableApps() returns correctly.

Just FYI - If the map_app is enabled while the app is running, the map_app is still counted as not available (i.e. false) until the app restarts.