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

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,21 +28,25 @@ 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
+ while (reactContext == null);
31
32
  reactContext
32
33
  .getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)
33
34
  .emit("barcode", intent.getStringExtra("EXTRA_BARCODE_DECODING_DATA"));
34
35
  }
35
36
  if (intent.getAction().equals("android.intent.ACTION_DECODE_DATA")) {
37
+ while (reactContext == null);
36
38
  reactContext
37
39
  .getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)
38
40
  .emit("barcode", intent.getStringExtra("barcode_string"));
39
41
  }
40
42
  if (intent.getAction().equals("scan.rcv.message")) {
43
+ while (reactContext == null);
41
44
  reactContext
42
45
  .getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)
43
46
  .emit("barcode", intent.getStringExtra("barcodeData"));
44
47
  }
45
48
  if (intent.getAction().equals("barcode")) {
49
+ while (reactContext == null);
46
50
  reactContext
47
51
  .getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)
48
52
  .emit("barcode", intent.getStringExtra("barcode"));
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.10",
4
4
  "description": "Broadcast code scanner receiver",
5
5
  "main": "index.js",
6
6
  "scripts": {