You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by sh...@apache.org on 2016/12/08 00:57:01 UTC

[3/6] cordova-plugin-geolocation git commit: CB-11962: (ios) Added variable for setting NSLocationWhenInUseUsageDescription

CB-11962: (ios) Added variable for setting NSLocationWhenInUseUsageDescription

 This closes #83


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/commit/f9f7a23c
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/tree/f9f7a23c
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/diff/f9f7a23c

Branch: refs/heads/2.4.x
Commit: f9f7a23c57daad5514ce3d830a2defeb93ba3f78
Parents: 7bcaab5
Author: obione <ob...@huronasolutions.co.uk>
Authored: Wed Oct 5 06:14:32 2016 +0100
Committer: Julio C�sar <jc...@gmail.com>
Committed: Sun Oct 9 12:50:20 2016 +0200

----------------------------------------------------------------------
 README.md  | 11 +++++++++++
 plugin.xml |  5 +++--
 2 files changed, 14 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/blob/f9f7a23c/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index 77a3c9a..fe3c36b 100644
--- a/README.md
+++ b/README.md
@@ -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.
+ 
+ Example:
+ `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).

http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/blob/f9f7a23c/plugin.xml
----------------------------------------------------------------------
diff --git a/plugin.xml b/plugin.xml
index ed7087a..3945480 100644
--- a/plugin.xml
+++ b/plugin.xml
@@ -98,9 +98,10 @@ xmlns:android="http://schemas.android.com/apk/res/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">
-            <string></string>
+            <string>$GEOLOCATION_USAGE_DESCRIPTION</string>
         </config-file>
 
     </platform>


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org