@scrumble-nl/react-native-honeywell-scanner 1.0.45 → 1.0.46

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.
@@ -34,13 +34,6 @@ public class HoneywellScannerModule extends ReactContextBaseJavaModule implement
34
34
  public HoneywellScannerModule(ReactApplicationContext reactContext) {
35
35
  super(reactContext);
36
36
  this.reactContext = reactContext;
37
-
38
- AidcManager.addBarcodeDeviceListener(new BarcodeDeviceListener() {
39
- @Override
40
- public void onBarcodeDeviceConnectionEvent(BarcodeDeviceConnectionEvent event) {
41
- connectedDevice = event.getBarcodeReaderInfo().getName();
42
- }
43
- });
44
37
  }
45
38
 
46
39
  @Override
@@ -83,6 +76,20 @@ public class HoneywellScannerModule extends ReactContextBaseJavaModule implement
83
76
  /** Methods Available from JS **/
84
77
  /*******************************/
85
78
 
79
+ @ReactMethod
80
+ public void startBarcodeDeviceListener() {
81
+ AidcManager.addBarcodeDeviceListener(new BarcodeDeviceListener() {
82
+ public void onBarcodeDeviceConnectionEvent(BarcodeDeviceConnectionEvent event) {
83
+ connectedDevice = event.getBarcodeReaderInfo().getName();
84
+ }
85
+ });
86
+ }
87
+
88
+ @ReactMethod
89
+ public void stopBarcodeDeviceListener() {
90
+ AidcManager.removeBarcodeDeviceListener();
91
+ }
92
+
86
93
  @ReactMethod
87
94
  public void startReader(final Promise promise) {
88
95
  AidcManager.create(reactContext, new CreatedCallback() {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@scrumble-nl/react-native-honeywell-scanner",
3
3
  "title": "React Native Honeywell Scanner-v2",
4
- "version": "1.0.45",
4
+ "version": "1.0.46",
5
5
  "description": "Bridge to use the Honeywell scanner",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",