@scrumble-nl/react-native-honeywell-scanner 1.0.18 → 1.0.20
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.
|
@@ -2,6 +2,7 @@ package com.reactlibrary;
|
|
|
2
2
|
|
|
3
3
|
import android.os.Build;
|
|
4
4
|
import android.util.Log;
|
|
5
|
+
import android.app.AlertDialog;
|
|
5
6
|
|
|
6
7
|
import com.facebook.react.bridge.*;
|
|
7
8
|
import com.facebook.react.modules.core.DeviceEventManagerModule;
|
|
@@ -12,6 +13,7 @@ import javax.annotation.Nullable;
|
|
|
12
13
|
|
|
13
14
|
import java.util.HashMap;
|
|
14
15
|
import java.util.Map;
|
|
16
|
+
import java.util.List;
|
|
15
17
|
|
|
16
18
|
import static com.reactlibrary.HoneywellScannerPackage.HoneyWellTAG;
|
|
17
19
|
|
|
@@ -23,6 +25,7 @@ public class HoneywellScannerModule extends ReactContextBaseJavaModule implement
|
|
|
23
25
|
private final ReactApplicationContext reactContext;
|
|
24
26
|
private AidcManager manager;
|
|
25
27
|
private BarcodeReader reader;
|
|
28
|
+
private List<BarcodeReaderInfo> connected;
|
|
26
29
|
|
|
27
30
|
private static final String BARCODE_READ_SUCCESS = "barcodeReadSuccess";
|
|
28
31
|
private static final String BARCODE_READ_FAIL = "barcodeReadFail";
|
|
@@ -77,8 +80,16 @@ public class HoneywellScannerModule extends ReactContextBaseJavaModule implement
|
|
|
77
80
|
public void onCreated(AidcManager aidcManager) {
|
|
78
81
|
manager = aidcManager;
|
|
79
82
|
reader = manager.createBarcodeReader();
|
|
83
|
+
connected = manager.listConnectedBarcodeDevices();
|
|
80
84
|
|
|
81
|
-
|
|
85
|
+
|
|
86
|
+
new AlertDialog.Builder(reactContext).setTitle("devices").setMessage(
|
|
87
|
+
connected.get(0).getName(); + " " + connected.get(1).getName();
|
|
88
|
+
).show();
|
|
89
|
+
|
|
90
|
+
// for (int i = 0; i < connected.size(); i++) {
|
|
91
|
+
// Log.i("ReactNative", connected.get(i).getName());
|
|
92
|
+
// }
|
|
82
93
|
|
|
83
94
|
if (reader != null) {
|
|
84
95
|
reader.addBarcodeListener(HoneywellScannerModule.this);
|
package/package.json
CHANGED