Skip to content

Commit 62b087b

Browse files
committed
restoreKey update
1 parent f11123f commit 62b087b

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

readme.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,7 @@ The latest version of the plugin requires you to set the Android target API to a
6363

6464

6565
## Background Modes (iOS) ##
66-
Background modes have been changed, so follow the steps below:
67-
1. Background mode(s) are no longer added to your project's plist file by default. They can be added manually by editing the plist file, or you can use the following plugins: [cordova-plugin-background-mode-bluetooth-central](https://github.com/randdusing/cordova-plugin-background-mode-bluetooth-central) and/or [cordova-plugin-background-mode-bluetooth-peripheral](https://github.com/randdusing/cordova-plugin-background-mode-bluetooth-peripheral).
68-
2. Restore identifiers must be specified when calling initialize and/or initializePeripheral using the restoreKey parameter. See initialize and initializePeripheral for details.
66+
Background mode(s) are no longer added to your project's plist file by default. They can be added manually by editing the plist file, or you can use the following plugins: [cordova-plugin-background-mode-bluetooth-central](https://github.com/randdusing/cordova-plugin-background-mode-bluetooth-central) and/or [cordova-plugin-background-mode-bluetooth-peripheral](https://github.com/randdusing/cordova-plugin-background-mode-bluetooth-peripheral).
6967

7068
Scanning works differently in the background. There seem to be three different states:
7169

@@ -216,7 +214,7 @@ Characteristics can have the following different properties: broadcast, read, wr
216214

217215

218216
### initialize ###
219-
Initialize Bluetooth on the device. Must be called before anything else. Callback will continuously be used whenever Bluetooth is enabled or disabled. Note: Although Bluetooth initialization could initially be successful, there's no guarantee whether it will stay enabled. Each call checks whether Bluetooth is disabled. If it becomes disabled, the user must connect to the device, start a read/write operation, etc again. If Bluetooth is disabled, you can request the user to enable it by setting the request property to true. The `request` property in the `params` argument is optional and defaults to false. This function should only be called once.
217+
Initialize Bluetooth on the device. Must be called before anything else. Callback will continuously be used whenever Bluetooth is enabled or disabled. Note: Although Bluetooth initialization could initially be successful, there's no guarantee whether it will stay enabled. Each call checks whether Bluetooth is disabled. If it becomes disabled, the user must connect to the device, start a read/write operation, etc again. If Bluetooth is disabled, you can request the user to enable it by setting the request property to true. The `request` property in the `params` argument is optional and defaults to false. The `restoreKey` property requires using the Bluetooth Central background mode. This function should only be called once.
220218

221219
```javascript
222220
bluetoothle.initialize(initializeSuccess, initializeError, params);
@@ -225,7 +223,7 @@ bluetoothle.initialize(initializeSuccess, initializeError, params);
225223
##### Params #####
226224
* request = true / false (default) - Should user be prompted to enable Bluetooth
227225
* statusReceiver = true (default) / false - Should change in Bluetooth status notifications be sent.
228-
* restoreKey = A unique string to identify your app. Required if Bluetooth central background mode is enabled.
226+
* restoreKey = A unique string to identify your app. Bluetooth Central background mode is required to use this, but background mode doesn't seem to require specifying the restoreKey.
229227

230228
```javascript
231229
{
@@ -1503,7 +1501,7 @@ iOS doesn't allow you to respond to read and write descriptor requests. Instead
15031501

15041502

15051503
### initializePeripheral ###
1506-
Initialize Bluetooth on the device. Must be called before anything else. Callback will continuously be used whenever Bluetooth is enabled or disabled. Note: Although Bluetooth initialization could initially be successful, there's no guarantee whether it will stay enabled. Each call checks whether Bluetooth is disabled. If it becomes disabled, the user must readd services, start advertising, etc again. If Bluetooth is disabled, you can request the user to enable it by setting the request property to true. The `request` property in the `params` argument is optional and defaults to false. The `restoreKey` property is required when using the Bluetooth Peripheral background mode. This function should only be called once.
1504+
Initialize Bluetooth on the device. Must be called before anything else. Callback will continuously be used whenever Bluetooth is enabled or disabled. Note: Although Bluetooth initialization could initially be successful, there's no guarantee whether it will stay enabled. Each call checks whether Bluetooth is disabled. If it becomes disabled, the user must readd services, start advertising, etc again. If Bluetooth is disabled, you can request the user to enable it by setting the request property to true. The `request` property in the `params` argument is optional and defaults to false. The `restoreKey` property requires using the Bluetooth Peripheral background mode. This function should only be called once.
15071505

15081506
Additionally this where new events are delivered for read, write, and subscription requests. See the success section for more details.
15091507

@@ -1513,7 +1511,7 @@ bluetoothle.initializePeripheral(success, error, params);
15131511

15141512
##### Params #####
15151513
* request = true / false (default) - Should user be prompted to enable Bluetooth
1516-
* restoreKey = A unique string to identify your app. Required if Bluetooth peripheral background mode is enabled.
1514+
* restoreKey = A unique string to identify your app. Bluetooth Peripheral background mode is required to use this, but background mode doesn't seem to require specifying the restoreKey.
15171515

15181516
```javascript
15191517
{

0 commit comments

Comments
 (0)