@bits-innovate/react-native-vstarcam 1.0.14 → 1.0.15

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.
@@ -297,6 +297,20 @@ public class VStarCamModule extends ReactContextBaseJavaModule {
297
297
  return MODULE_NAME;
298
298
  }
299
299
 
300
+ // Required by NativeEventEmitter
301
+ @ReactMethod
302
+ public void addListener(String eventName) {
303
+ // Keep: Required for RN built in Event Emitter Calls
304
+ Log.d(TAG, "addListener called for: " + eventName);
305
+ }
306
+
307
+ // Required by NativeEventEmitter
308
+ @ReactMethod
309
+ public void removeListeners(Integer count) {
310
+ // Keep: Required for RN built in Event Emitter Calls
311
+ Log.d(TAG, "removeListeners called with count: " + count);
312
+ }
313
+
300
314
  private void sendEvent(String eventName, @Nullable WritableMap params) {
301
315
  if (reactContext.hasActiveReactInstance()) {
302
316
  reactContext
@@ -388,7 +402,17 @@ public class VStarCamModule extends ReactContextBaseJavaModule {
388
402
  long.class, int.class, String.class, int.class);
389
403
 
390
404
  Log.d(TAG, "Calling JNIApi.connect(" + clientInfo.sdkClientPtr + ", 15, " + param + ", " + connectType + ")");
391
- connectMethod.invoke(null, clientInfo.sdkClientPtr, 15, param, connectType);
405
+
406
+ try {
407
+ connectMethod.invoke(null, clientInfo.sdkClientPtr, 15, param, connectType);
408
+ Log.d(TAG, "JNIApi.connect returned normally");
409
+ } catch (java.lang.reflect.InvocationTargetException ite) {
410
+ Log.e(TAG, "JNIApi.connect threw exception: " + ite.getCause(), ite.getCause());
411
+ throw ite;
412
+ } catch (Throwable t) {
413
+ Log.e(TAG, "JNIApi.connect crashed: " + t.getMessage(), t);
414
+ throw t;
415
+ }
392
416
 
393
417
  Log.d(TAG, "JNIApi.connect called - waiting for state callback");
394
418
 
@@ -630,7 +654,7 @@ public class VStarCamModule extends ReactContextBaseJavaModule {
630
654
  @ReactMethod
631
655
  public void getSdkVersion(Promise promise) {
632
656
  WritableMap result = Arguments.createMap();
633
- result.putString("version", "1.0.14");
657
+ result.putString("version", "1.0.15");
634
658
  result.putBoolean("nativeLoaded", isNativeLibraryLoaded);
635
659
  result.putString("nativeLib", "OKSMARTPPCS");
636
660
  result.putBoolean("p2pInitialized", isP2PInitialized);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bits-innovate/react-native-vstarcam",
3
- "version": "1.0.14",
3
+ "version": "1.0.15",
4
4
  "description": "React Native bridge for VStarCam P2P SDK",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",