You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2018/05/14 13:53:28 UTC
[GitHub] jcesarmobile closed pull request #106: CB-14085: Fix iOS usage
description
jcesarmobile closed pull request #106: CB-14085: Fix iOS usage description
URL: https://github.com/apache/cordova-plugin-geolocation/pull/106
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 a212a76..094a471 100644
--- a/README.md
+++ b/README.md
@@ -156,19 +156,18 @@ error, the `geolocationError` callback is passed a
### iOS Quirks
- 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.
+As precised in the (apple documentation)[https://developer.apple.com/documentation/corelocation/choosing_the_authorization_level_for_location_services/requesting_when_in_use_authorization], this plugin requires the following usage description to use the native location service:
- This plugins requires the following usage description:
+* `NSLocationWhenInUseUsageDescription`
- * `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:
+By default, the usage description is set as: « The application needs to access location data to make the user experience more efficient and reliable. »
+
+You can precise this value at installation:
```
-<edit-config target="NSLocationWhenInUseUsageDescription" file="*-Info.plist" mode="merge">
- <string>need location access to find things nearby</string>
-</edit-config>
+cordova plugin add cordova-plugin-geolocation --variable USAGE_DESCRIPTION="My usage description"
```
+
### Android Quirks
diff --git a/plugin.xml b/plugin.xml
index de47684..32e148a 100644
--- a/plugin.xml
+++ b/plugin.xml
@@ -66,6 +66,12 @@ xmlns:android="http://schemas.android.com/apk/res/android"
<!-- ios -->
<platform name="ios">
+ <!-- Location Usage Description -->
+ <preference name="USAGE_DESCRIPTION" default="The application needs to access location data to make the user experience more efficient and reliable." />
+ <config-file parent="NSLocationWhenInUseUsageDescription" target="*-Info.plist">
+ <string>$USAGE_DESCRIPTION</string>
+ </config-file>
+
<js-module src="www/Coordinates.js" name="Coordinates">
<clobbers target="Coordinates" />
</js-module>
diff --git a/tests/plugin.xml b/tests/plugin.xml
index 50e7e77..f1a365c 100644
--- a/tests/plugin.xml
+++ b/tests/plugin.xml
@@ -29,7 +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>
+ <config-file parent="NSLocationWhenInUseUsageDescription" target="*-Info.plist">
+ <string>need location access to pass tests</string>
+ </config-file>
</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
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org