simplejsble 0.0.16 → 0.0.18
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.
|
@@ -3,9 +3,8 @@
|
|
|
3
3
|
#include <simpleble/Advanced.h>
|
|
4
4
|
|
|
5
5
|
JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void*) {
|
|
6
|
+
// Initialize SimpleBLE's JVM reference BEFORE any SimpleBLE calls
|
|
6
7
|
SimpleBLE::Advanced::Android::set_jvm(vm);
|
|
7
8
|
|
|
8
9
|
return margelo::nitro::simplejsble::initialize(vm);
|
|
9
10
|
}
|
|
10
|
-
|
|
11
|
-
|
|
@@ -21,16 +21,11 @@ class VM {
|
|
|
21
21
|
}
|
|
22
22
|
instance._jvm = jvm_override;
|
|
23
23
|
} else if (instance._jvm == nullptr) {
|
|
24
|
-
#ifdef __ANDROID__
|
|
25
|
-
// On Android (React Native/Expo), JNI_GetCreatedJavaVMs is not available at runtime.
|
|
26
|
-
// The JVM must be set explicitly via set_jvm() in JNI_OnLoad.
|
|
27
24
|
throw std::runtime_error("JavaVM not set. Call set_jvm() in JNI_OnLoad first.");
|
|
28
|
-
#else
|
|
29
25
|
jsize count;
|
|
30
26
|
if (JNI_GetCreatedJavaVMs(&instance._jvm, 1, &count) != JNI_OK || count == 0) {
|
|
31
27
|
throw std::runtime_error("Failed to retrieve the Java Virtual Machine");
|
|
32
28
|
}
|
|
33
|
-
#endif
|
|
34
29
|
}
|
|
35
30
|
return instance._jvm;
|
|
36
31
|
}
|
package/lib/index.d.ts
ADDED
package/lib/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {} from 'react-native-nitro-modules';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "simplejsble",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.18",
|
|
4
4
|
"description": "React Native Bluetooth Low Energy library using SimpleBLE with Nitro Modules",
|
|
5
5
|
"main": "lib/index",
|
|
6
6
|
"module": "lib/index",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"scripts": {
|
|
28
28
|
"prepack": "node scripts/prepare-package.js",
|
|
29
29
|
"typecheck": "tsc --noEmit",
|
|
30
|
-
"build": "tsc --noEmit false",
|
|
30
|
+
"build": "rm -f tsconfig.tsbuildinfo && tsc --noEmit false",
|
|
31
31
|
"clean": "rm -rf android/build android/.cxx android/.gradle lib",
|
|
32
32
|
"lint": "eslint \"**/*.{js,ts,tsx}\" --fix",
|
|
33
33
|
"prepublishOnly": "npm run build",
|