Skip to content
Browse files
CB-11962: (ios) Added variable for setting NSLocationWhenInUseUsageDe…

 This closes #83
  • Loading branch information
obione authored and jcesarmobile committed Oct 9, 2016
1 parent 7bcaab5 commit f9f7a23c57daad5514ce3d830a2defeb93ba3f78
Showing 2 changed files with 14 additions and 2 deletions.
@@ -159,6 +159,17 @@ error, the `geolocationError` callback is passed a

### iOS Quirks

Since iOS 10 it's mandatory to add a `NSLocationWhenInUseUsageDescription` entry in the info.plist.

`NSLocationWhenInUseUsageDescription` describes the reason that the app accesses the user's location. When the system prompts the user to allow access, this string is displayed as part of the dialog box. To add this entry you can pass the variable `GEOLOCATION_USAGE_DESCRIPTION` on plugin install.

`cordova plugin add cordova-plugin-geolocation --variable GEOLOCATION_USAGE_DESCRIPTION="your usage message"`

If you don't pass the variable, the plugin will add an empty string as value.

### Android Quirks

If Geolocation service is turned off the `onError` callback is invoked after `timeout` interval (if specified).
@@ -98,9 +98,10 @@ xmlns:android=""
<header-file src="src/ios/CDVLocation.h" />
<source-file src="src/ios/CDVLocation.m" />
<framework src="CoreLocation.framework" />

<preference name="GEOLOCATION_USAGE_DESCRIPTION" default=" " />
<config-file target="*-Info.plist" parent="NSLocationWhenInUseUsageDescription">


0 comments on commit f9f7a23

Please sign in to comment.