react-native-ble-manager 12.1.3 → 12.1.5

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/README.md CHANGED
@@ -17,7 +17,7 @@ The library is a simple connection with the OS APIs, the BLE stack should be sta
17
17
 
18
18
  RN 0.76+ only the new architecture is supported
19
19
 
20
- RN 0.60-0.75 supported until 11.5.X
20
+ RN 0.60-0.75 supported until 11.X
21
21
  RN 0.40-0.59 supported until 6.7.X
22
22
  RN 0.30-0.39 supported until 2.4.3
23
23
 
@@ -72,6 +72,16 @@ npm run build
72
72
 
73
73
  > if you are modifying the typescript files of the library (in `src/`) on the fly, you can run `npm run watch` instead. If you are modifying files from the native counterparts, you'll need to rebuild the whole app for your target environnement (`npm run android/ios`).
74
74
 
75
+ ### Updating documentation
76
+
77
+ Edit files in `docs/`, then test locally with:
78
+ ```shell
79
+ cd docs
80
+ bundle install
81
+ bundle exec jekyll serve --watch --baseurl /
82
+ ```
83
+ Then open http://localhost:4000/
84
+
75
85
  ## Generate the native code from specs
76
86
  A react-native project is needed to generate the code via *codegen*.
77
87
 
@@ -69,7 +69,7 @@ android {
69
69
  }
70
70
 
71
71
  defaultConfig {
72
- minSdkVersion safeExtGet("minSdkVersion", 21)
72
+ minSdkVersion safeExtGet("minSdkVersion", 24)
73
73
  targetSdk safeExtGet("targetSdk", 34)
74
74
  buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
75
75
  }
@@ -129,4 +129,4 @@ if (isNewArchitectureEnabled()) {
129
129
  libraryName = "BleManager"
130
130
  codegenJavaPackageName = "it.innove"
131
131
  }
132
- }
132
+ }
@@ -291,15 +291,16 @@ class BleManager extends NativeBleManagerSpec {
291
291
  return;
292
292
  }
293
293
  if (!getBluetoothAdapter().isEnabled()) {
294
- enableBluetoothCallback = callback;
295
294
  Intent intentEnable = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
296
295
  if (getCurrentActivity() == null)
297
296
  callback.invoke("Current activity not available");
298
297
  else {
298
+ enableBluetoothCallback = callback;
299
299
  try {
300
300
  getCurrentActivity().startActivityForResult(intentEnable, ENABLE_REQUEST);
301
301
  } catch (Exception e) {
302
- callback.invoke("Current activity not available");
302
+ enableBluetoothCallback = null;
303
+ callback.invoke("Error starting enable bluetooth activity");
303
304
  }
304
305
 
305
306
  }
@@ -972,6 +973,11 @@ class BleManager extends NativeBleManagerSpec {
972
973
 
973
974
  @Override
974
975
  public void invalidate() {
976
+ try {
977
+ context.unregisterReceiver(mReceiver);
978
+ } catch (Exception e) {
979
+ Log.e(LOG_TAG, "Receiver not registered or already unregistered", e);
980
+ }
975
981
  try {
976
982
  // Disconnect all known peripherals, otherwise android system will think we are still connected
977
983
  // while we have lost the gatt instance
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-ble-manager",
3
- "version": "12.1.3",
3
+ "version": "12.1.5",
4
4
  "description": "A BLE module for react native.",
5
5
  "homepage": "https://innoveit.github.io/react-native-ble-manager/",
6
6
  "repository": {