react-native-ble-manager 12.0.0 → 12.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-ble-manager",
3
- "version": "12.0.0",
3
+ "version": "12.1.1",
4
4
  "description": "A BLE module for react native.",
5
5
  "homepage": "https://innoveit.github.io/react-native-ble-manager/",
6
6
  "repository": {
@@ -6,5 +6,6 @@ declare const withBLE: ConfigPlugin<{
6
6
  neverForLocation?: boolean;
7
7
  bluetoothAlwaysPermission?: string | false;
8
8
  companionDeviceEnabled?: boolean;
9
+ isBleRequired?: boolean;
9
10
  } | void>;
10
11
  export default withBLE;
@@ -8,7 +8,7 @@ const withBluetoothPermissions_1 = require("./withBluetoothPermissions");
8
8
  */
9
9
  const withBLE = (config, props = {}) => {
10
10
  const _props = props || {};
11
- const isBackgroundEnabled = false;
11
+ const isBleRequired = _props.isBleRequired ?? false;
12
12
  const neverForLocation = _props.neverForLocation ?? false;
13
13
  const companionDeviceEnabled = _props.companionDeviceEnabled ?? false;
14
14
  // iOS
@@ -20,7 +20,7 @@ const withBLE = (config, props = {}) => {
20
20
  'android.permission.BLUETOOTH_CONNECT', // since Android SDK 31
21
21
  ]);
22
22
  config = (0, withBLEAndroidManifest_1.withBLEAndroidManifest)(config, {
23
- isBackgroundEnabled,
23
+ isBleRequired,
24
24
  neverForLocation,
25
25
  companionDeviceEnabled,
26
26
  });
@@ -16,7 +16,7 @@ type AndroidManifest = {
16
16
  };
17
17
  };
18
18
  export declare const withBLEAndroidManifest: ConfigPlugin<{
19
- isBackgroundEnabled: boolean;
19
+ isBleRequired: boolean;
20
20
  neverForLocation: boolean;
21
21
  companionDeviceEnabled: boolean;
22
22
  }>;
@@ -7,7 +7,7 @@ exports.addConnectPermissionToManifest = addConnectPermissionToManifest;
7
7
  exports.addCompanionPermissionToManifest = addCompanionPermissionToManifest;
8
8
  exports.addBLEHardwareFeatureToManifest = addBLEHardwareFeatureToManifest;
9
9
  const config_plugins_1 = require("expo/config-plugins");
10
- const withBLEAndroidManifest = (config, { isBackgroundEnabled, neverForLocation, companionDeviceEnabled }) => {
10
+ const withBLEAndroidManifest = (config, { isBleRequired, neverForLocation, companionDeviceEnabled }) => {
11
11
  return (0, config_plugins_1.withAndroidManifest)(config, config => {
12
12
  config.modResults = addLocationPermissionToManifest(config.modResults, neverForLocation);
13
13
  config.modResults = addScanPermissionToManifest(config.modResults, neverForLocation);
@@ -15,7 +15,7 @@ const withBLEAndroidManifest = (config, { isBackgroundEnabled, neverForLocation,
15
15
  if (companionDeviceEnabled) {
16
16
  config.modResults = addCompanionPermissionToManifest(config.modResults);
17
17
  }
18
- if (isBackgroundEnabled) {
18
+ if (isBleRequired) {
19
19
  config.modResults = addBLEHardwareFeatureToManifest(config.modResults);
20
20
  }
21
21
  return config;
@@ -107,7 +107,7 @@ function addCompanionPermissionToManifest(androidManifest) {
107
107
  }
108
108
  return androidManifest;
109
109
  }
110
- // Add this line if your application always requires BLE. More info can be found on: https://developer.android.com/guide/topics/connectivity/bluetooth-le.html#permissions
110
+ // Add this line if your application always requires BLE. More info can be found on: https://developer.android.com/develop/connectivity/bluetooth/bt-permissions
111
111
  function addBLEHardwareFeatureToManifest(androidManifest) {
112
112
  // Add `<uses-feature android:name="android.hardware.bluetooth_le" android:required="true"/>` to the AndroidManifest.xml
113
113
  if (!Array.isArray(androidManifest.manifest['uses-feature'])) {
@@ -94,6 +94,14 @@ export interface Spec extends TurboModule {
94
94
  callback: (error: string | null, data: number[]) => void
95
95
  ): void;
96
96
 
97
+ startNotificationWithBuffer(
98
+ peripheralUUID: string,
99
+ serviceUUID: string,
100
+ characteristicUUID: string,
101
+ bufferLength: number,
102
+ callback: (error: string | null) => void
103
+ ): void;
104
+
97
105
  startNotification(
98
106
  peripheralUUID: string,
99
107
  serviceUUID: string,