Skip to content

Commit 6f0c13e

Browse files
committed
Update iOS protected resources documentation. Remove NSLocationAlwaysAndWhenInUseUsageDescription. #704
1 parent f8bbda2 commit 6f0c13e

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,14 @@ This plugin is included in iOS and Android versions of the [PhoneGap Developer A
4949

5050
Note that this plugin's id changed from `com.megster.cordova.ble` to `cordova-plugin-ble-central` as part of the migration from the [Cordova plugin repo](http://plugins.cordova.io/) to [npm](https://www.npmjs.com/).
5151

52-
### iOS 13
52+
### iOS
5353

54-
For iOS 13, apps will crash unless they include usage description keys for the types of data they access. For Bluetooth, [NSBluetoothAlwaysUsageDescription](https://developer.apple.com/documentation/bundleresources/information_property_list/protected_resources) AND [NSLocationAlwaysAndWhenInUseUsageDescription](https://developer.apple.com/documentation/bundleresources/information_property_list/protected_resources) must be defined.
55-
56-
This can be done when the plugin is installed using the BLUETOOTH_USAGE_DESCRIPTION variable.
54+
For iOS, apps will crash unless they include usage description keys for the types of data they access. Applications targeting iOS 13 and later, define [NSBluetoothAlwaysUsageDescription](https://developer.apple.com/documentation/bundleresources/information_property_list/nsbluetoothalwaysusagedescription?language=objc) to tell the user why the application needs Bluetooth. For apps with a deployment target earlier than iOS 13, add [NSBluetoothPeripheralUsageDescription](https://developer.apple.com/documentation/bundleresources/information_property_list/nsbluetoothperipheralusagedescription?language=objc). Both of these keys can be set when installing the plugin by passing the BLUETOOTH_USAGE_DESCRIPTION variable.
5755

5856
$ cordova plugin add cordova-plugin-ble-central --variable BLUETOOTH_USAGE_DESCRIPTION="Your description here"
5957

58+
See Apple's documentation about [Protected Resources](https://developer.apple.com/documentation/bundleresources/information_property_list/protected_resources) for more details. If your app needs other permissions like location, try the [cordova-custom-config plugin](https://github.com/don/cordova-plugin-ble-central/issues/700#issuecomment-538312656).
59+
6060
# API
6161

6262
## Methods

plugin.xml

+1-4
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,14 @@
3939
<!-- frameworks -->
4040
<framework src="CoreBluetooth.framework" />
4141

42+
<!-- iOS SPermissions -->
4243
<preference name="BLUETOOTH_USAGE_DESCRIPTION" default=" " />
4344
<config-file target="*-Info.plist" parent="NSBluetoothPeripheralUsageDescription">
4445
<string>$BLUETOOTH_USAGE_DESCRIPTION</string>
4546
</config-file>
4647
<config-file target="*-Info.plist" parent="NSBluetoothAlwaysUsageDescription">
4748
<string>$BLUETOOTH_USAGE_DESCRIPTION</string>
4849
</config-file>
49-
<preference name="LOCATION_USAGE_DESCRIPTION" default=" " />
50-
<config-file target="*-Info.plist" parent="NSLocationAlwaysAndWhenInUseUsageDescription">
51-
<string>$LOCATION_USAGE_DESCRIPTION</string>
52-
</config-file>
5350
</platform>
5451

5552
<platform name="android">

0 commit comments

Comments
 (0)