Skip to content

Commit f8bbda2

Browse files
favnec5don
authored andcommitted
add NSBluetoothAlwaysUsageDescription for IOS13+ (#704)
Add NSBluetoothAlwaysUsageDescription for IOS13+
1 parent 03acf33 commit f8bbda2

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ 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 10
52+
### iOS 13
5353

54-
For iOS 10, apps will crash unless they include usage description keys for the types of data they access. For Bluetooth, [NSBluetoothPeripheralUsageDescription](https://developer.apple.com/library/prerelease/content/documentation/General/Reference/InfoPlistKeyReference/Articles/CocoaKeys.html#//apple_ref/doc/uid/TP40009251-SW20) must be defined.
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.
5555

5656
This can be done when the plugin is installed using the BLUETOOTH_USAGE_DESCRIPTION variable.
5757

plugin.xml

+7
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,13 @@
4343
<config-file target="*-Info.plist" parent="NSBluetoothPeripheralUsageDescription">
4444
<string>$BLUETOOTH_USAGE_DESCRIPTION</string>
4545
</config-file>
46+
<config-file target="*-Info.plist" parent="NSBluetoothAlwaysUsageDescription">
47+
<string>$BLUETOOTH_USAGE_DESCRIPTION</string>
48+
</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>
4653
</platform>
4754

4855
<platform name="android">

0 commit comments

Comments
 (0)