@scrumble-nl/react-native-honeywell-scanner 1.0.57 → 1.0.59

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.
@@ -16,6 +16,7 @@ import javax.annotation.Nullable;
16
16
 
17
17
  import java.util.HashMap;
18
18
  import java.util.Map;
19
+ import java.util.List;
19
20
 
20
21
  import static com.reactlibrary.HoneywellScannerPackage.HoneyWellTAG;
21
22
 
@@ -78,19 +79,16 @@ public class HoneywellScannerModule extends ReactContextBaseJavaModule implement
78
79
  /*******************************/
79
80
 
80
81
  @ReactMethod
81
- public void startBarcodeDeviceListener() {
82
- @Override
83
- public void addBarcodeDeviceListener(BarcodeDeviceListener listener) {
84
- listener.onBarcodeDeviceConnectionEvent(BarcodeDeviceConnectionEvent event) {
85
- connectedDevice = event.getBarcodeReaderInfo().getName();
86
- }
87
- });
88
- }
82
+ public void startBarcodeDeviceListener(Callback callBack) {
83
+ List<BarcodeReaderInfo> mBarcodeList = AidcManager.listConnectedBarcodeDevices();
84
+ WritableMap params = Arguments.createMap();
89
85
 
90
- // @ReactMethod
91
- // public void stopBarcodeDeviceListener() {
92
- // AidcManager.removeBarcodeDeviceListener();
93
- // }
86
+ for (BarcodeReaderInfo temp : mBarcodeList) {
87
+ params.putString("name", temp.getName());
88
+ }
89
+
90
+ callBack.invoke(params);
91
+ }
94
92
 
95
93
  @ReactMethod
96
94
  public void startReader(final Promise promise) {
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.57",
4
+ "version": "1.0.59",
5
5
  "description": "Bridge to use the Honeywell scanner",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",