You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/11/02 22:18:01 UTC

[jira] [Commented] (CB-13267) Remove ios usage descriptions from geolocation plugin

    [ https://issues.apache.org/jira/browse/CB-13267?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16236694#comment-16236694 ] 

ASF GitHub Bot commented on CB-13267:
-------------------------------------

stevengill closed pull request #94: CB-13267 (iOS): Remove ios usage descriptions
URL: https://github.com/apache/cordova-plugin-geolocation/pull/94
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/README.md b/README.md
index 480de32..7535d94 100644
--- a/README.md
+++ b/README.md
@@ -161,14 +161,19 @@ 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.
+ Since iOS 10 it's mandatory to provide an usage description in the `info.plist` if trying to access privacy-sensitive data. When the system prompts the user to allow access, this usage description string will displayed as part of the permission dialog box, but if you didn't provide the usage description, the app will crash before showing the dialog. Also, Apple will reject apps that access private data but don't provide an usage description.
+
+ This plugins requires the following usage description:
+
+ * `NSLocationWhenInUseUsageDescription` describes the reason that the app accesses the user's location. 
+
+ To add this entry into the `info.plist`, you can use the `edit-config` tag in the `config.xml` like this:
+
+```
+<edit-config target="NSLocationWhenInUseUsageDescription" file="*-Info.plist" mode="merge">
+    <string>need location access to find things nearby</string>
+</edit-config>
+```
  
 ### Android Quirks
 
diff --git a/plugin.xml b/plugin.xml
index cf93db8..4ad5718 100644
--- a/plugin.xml
+++ b/plugin.xml
@@ -101,11 +101,6 @@ xmlns:android="http://schemas.android.com/apk/res/android"
         <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>$GEOLOCATION_USAGE_DESCRIPTION</string>
-        </config-file>
-
     </platform>
 
     <!-- blackberry10 -->
diff --git a/tests/plugin.xml b/tests/plugin.xml
index 6df3581..14d1200 100644
--- a/tests/plugin.xml
+++ b/tests/plugin.xml
@@ -29,4 +29,7 @@
     <dependency id="cordova-plugin-device" url="https://github.com/apache/cordova-plugin-device" />
     <js-module src="tests.js" name="tests">
     </js-module>
+    <edit-config target="NSLocationWhenInUseUsageDescription" file="*-Info.plist" mode="merge">
+      <string>need location access to pass tests</string>
+    </edit-config>
 </plugin>


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> Remove ios usage descriptions from geolocation plugin
> -----------------------------------------------------
>
>                 Key: CB-13267
>                 URL: https://issues.apache.org/jira/browse/CB-13267
>             Project: Apache Cordova
>          Issue Type: Sub-task
>            Reporter: jcesarmobile
>            Assignee: jcesarmobile
>            Priority: Major
>




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

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