@scrumble-nl/react-native-honeywell-scanner 1.0.44 → 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.
@@ -41,30 +41,6 @@ public class HoneywellScannerModule extends ReactContextBaseJavaModule implement
41
41
  return "HoneywellScanner";
42
42
  }
43
43
 
44
- @Override
45
- protected void onCreate(Bundle savedInstanceState) {
46
- super.onCreate(savedInstanceState);
47
-
48
- AidcManager.addBarcodeDeviceListener(new BarcodeDeviceListener() {
49
- @Override
50
- public void onBarcodeDeviceConnectionEvent(BarcodeDeviceConnectionEvent event) {
51
- connectedDevice = event.getBarcodeReaderInfo().getName();
52
- }
53
- });
54
- }
55
-
56
- @Override
57
- protected void onStop(Bundle savedInstanceState) {
58
- super.onStop(savedInstanceState);
59
-
60
- AidcManager.removeBarcodeDeviceListener(new BarcodeDeviceListener() {
61
- @Override
62
- public void onBarcodeDeviceConnectionEvent(BarcodeDeviceConnectionEvent event) {
63
- connectedDevice = event.getBarcodeReaderInfo().getName();
64
- }
65
- });
66
- }
67
-
68
44
  /**
69
45
  * Send event to javascript
70
46
  *
@@ -100,6 +76,20 @@ public class HoneywellScannerModule extends ReactContextBaseJavaModule implement
100
76
  /** Methods Available from JS **/
101
77
  /*******************************/
102
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
+
103
93
  @ReactMethod
104
94
  public void startReader(final Promise promise) {
105
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.44",
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",