@bits-innovate/react-native-vstarcam 1.0.30 → 1.0.31

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.
@@ -298,10 +298,14 @@ public class VStarCamModule extends ReactContextBaseJavaModule {
298
298
  Log.e(TAG, "Error in stateListener callback", e);
299
299
  }
300
300
 
301
- // Handle return type
301
+ // Robust return type handling to prevent JNI signature mismatch crash
302
302
  Class<?> returnType = method.getReturnType();
303
303
  if (returnType.equals(int.class) || returnType.equals(Integer.class)) {
304
304
  return 0;
305
+ } else if (returnType.equals(long.class) || returnType.equals(Long.class)) {
306
+ return 0L;
307
+ } else if (returnType.equals(boolean.class) || returnType.equals(Boolean.class)) {
308
+ return true; // Default to true for success indicators
305
309
  }
306
310
  return null;
307
311
  }
@@ -337,10 +341,14 @@ public class VStarCamModule extends ReactContextBaseJavaModule {
337
341
  Log.e(TAG, "Error in commandListener callback", e);
338
342
  }
339
343
 
340
- // Handle return type
344
+ // Robust return type handling to prevent JNI signature mismatch crash
341
345
  Class<?> returnType = method.getReturnType();
342
346
  if (returnType.equals(int.class) || returnType.equals(Integer.class)) {
343
347
  return 0;
348
+ } else if (returnType.equals(long.class) || returnType.equals(Long.class)) {
349
+ return 0L;
350
+ } else if (returnType.equals(boolean.class) || returnType.equals(Boolean.class)) {
351
+ return true;
344
352
  }
345
353
  return null;
346
354
  }
@@ -360,10 +368,14 @@ public class VStarCamModule extends ReactContextBaseJavaModule {
360
368
  Log.e(TAG, "Error in releaseListener callback", e);
361
369
  }
362
370
 
363
- // Handle return type
371
+ // Robust return type handling to prevent JNI signature mismatch crash
364
372
  Class<?> returnType = method.getReturnType();
365
373
  if (returnType.equals(int.class) || returnType.equals(Integer.class)) {
366
374
  return 0;
375
+ } else if (returnType.equals(long.class) || returnType.equals(Long.class)) {
376
+ return 0L;
377
+ } else if (returnType.equals(boolean.class) || returnType.equals(Boolean.class)) {
378
+ return true;
367
379
  }
368
380
  return null;
369
381
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bits-innovate/react-native-vstarcam",
3
- "version": "1.0.30",
3
+ "version": "1.0.31",
4
4
  "description": "React Native bridge for VStarCam P2P SDK",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",