0

Failing to get the cordova-plugin-geolocation 4.0.1 to work in an iOS app, despite following all instructions. When the app asks for location permission, the geolocation message displays the path of the webview:

/Users/.../Library/Developer/CoreSimulator/Devices/.../www/index.html

rather than the name of the app and the message in the NSLocationWhenInUseUsageDescription string.

I have tried solutions in other answers (1, 2, 3):

  • The location is not requested until well after the device is ready --- this happens only when the user goes to a particular page in the app.

  • I have removed and added the plugin many times. All plugin files seem to be where they should be.

  • The NSLocationWhenInUseUsageDescription is properly set in config.xml and info.plist. And just to be safe, the variable GEOLOCATION_USAGE_DESCRIPTION is also set in config.xml.

Please help!

Fil
  • 175
  • 1
  • 2
  • 9

1 Answers1

0

It turns out that we had overlooked a solution that has already been suggested (here and here) by others. Namely, cordova.js must be included in index.html. This is not documented in the Cordova geolocation plugin.

Fil
  • 175
  • 1
  • 2
  • 9