react-native-roxit-code-scanner 1.0.8 → 1.0.9

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.
@@ -28,22 +28,30 @@ public class ScannerReceiver extends BroadcastReceiver {
28
28
  if (intent.getAction().equals("com.xcheng.scanner.action.BARCODE_DECODING_BROADCAST")) {
29
29
  // bundle.putString("barcode", intent.getStringExtra(Intent.EXTRA_TEXT));
30
30
  // Toast.makeText(context, intent.getStringExtra("EXTRA_BARCODE_DECODING_DATA"), 2000).show();
31
- reactContext
31
+ while (rnApp.getReactNativeHost().getReactInstanceManager().getCurrentReactContext() == null);
32
+ rnApp.getReactNativeHost().getReactInstanceManager()
33
+ .getCurrentReactContext()
32
34
  .getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)
33
35
  .emit("barcode", intent.getStringExtra("EXTRA_BARCODE_DECODING_DATA"));
34
36
  }
35
37
  if (intent.getAction().equals("android.intent.ACTION_DECODE_DATA")) {
36
- reactContext
38
+ while (rnApp.getReactNativeHost().getReactInstanceManager().getCurrentReactContext() == null);
39
+ rnApp.getReactNativeHost().getReactInstanceManager()
40
+ .getCurrentReactContext()
37
41
  .getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)
38
42
  .emit("barcode", intent.getStringExtra("barcode_string"));
39
43
  }
40
44
  if (intent.getAction().equals("scan.rcv.message")) {
41
- reactContext
45
+ while (rnApp.getReactNativeHost().getReactInstanceManager().getCurrentReactContext() == null);
46
+ rnApp.getReactNativeHost().getReactInstanceManager()
47
+ .getCurrentReactContext()
42
48
  .getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)
43
49
  .emit("barcode", intent.getStringExtra("barcodeData"));
44
50
  }
45
51
  if (intent.getAction().equals("barcode")) {
46
- reactContext
52
+ while (rnApp.getReactNativeHost().getReactInstanceManager().getCurrentReactContext() == null);
53
+ rnApp.getReactNativeHost().getReactInstanceManager()
54
+ .getCurrentReactContext()
47
55
  .getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)
48
56
  .emit("barcode", intent.getStringExtra("barcode"));
49
57
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-roxit-code-scanner",
3
- "version": "1.0.8",
3
+ "version": "1.0.9",
4
4
  "description": "Broadcast code scanner receiver",
5
5
  "main": "index.js",
6
6
  "scripts": {