0

I am using phonegap build - Phonegap CLI 7.0.1

<gap:plugin name="cordova-plugin-geolocation" source="npm"/>

 <feature name="Geolocation">
        <param name="ios-package" value="CDVLocation" />
    </feature>

My problem is, when I start the app I don't have a dialog box prompting the user to allow geolocation. and when I go to the app settings, I only have notifications Background App refresh Cellular Data

How can I enable geolocation ?

Thanks

1 Answers1

0

Unlike Android, which notifies of permissions on installation, iOS doesn't ask for permissions until the app attempts to access the feature. I just tested this, and iOS didn't ask for location permission until I called navigator.geolocation.getCurrentPosition (cli-7.0.1).

Note: you can simplify your plugin declaration to:

<plugin name="cordova-plugin-geolocation" />

The gap: is deprecated, and npm is the default (no harm in leaving it). Might be worth locking to a version though othewise it will upgrade to new releases without your knowledge. You don't need the feature tag, the geolocation plugin includes that for you.

wildabeast
  • 1,723
  • 3
  • 18
  • 31