@scrumble-nl/react-native-honeywell-scanner 1.0.24 → 1.0.26
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.
|
@@ -61,6 +61,12 @@ public class HoneywellScannerModule extends ReactContextBaseJavaModule implement
|
|
|
61
61
|
if (D) Log.d(HoneyWellTAG, "HoneywellBarcodeReader - Barcode scan read");
|
|
62
62
|
WritableMap params = Arguments.createMap();
|
|
63
63
|
params.putString("data", barcodeReadEvent.getBarcodeData());
|
|
64
|
+
if (!connected.get(0).getName().isEmpty()) {
|
|
65
|
+
params.putString("device_1", connected.get(0).getName());
|
|
66
|
+
}
|
|
67
|
+
if (!connected.get(1).getName().isEmpty()) {
|
|
68
|
+
params.putString("device_2", connected.get(1).getName());
|
|
69
|
+
}
|
|
64
70
|
sendEvent(BARCODE_READ_SUCCESS, params);
|
|
65
71
|
}
|
|
66
72
|
|
|
@@ -83,29 +89,6 @@ public class HoneywellScannerModule extends ReactContextBaseJavaModule implement
|
|
|
83
89
|
reader = manager.createBarcodeReader();
|
|
84
90
|
connected = manager.listConnectedBarcodeDevices();
|
|
85
91
|
|
|
86
|
-
AlertDialog.Builder builder = new AlertDialog.Builder(reactContext);
|
|
87
|
-
builder.setTitle("Devices");
|
|
88
|
-
builder.setPositiveButton(
|
|
89
|
-
"Yes",
|
|
90
|
-
new DialogInterface.OnClickListener() {
|
|
91
|
-
public void onClick(DialogInterface dialog, int id) {
|
|
92
|
-
dialog.cancel();
|
|
93
|
-
}
|
|
94
|
-
});
|
|
95
|
-
builder.setNegativeButton("No", new DialogInterface.OnClickListener() {
|
|
96
|
-
public void onClick(DialogInterface dialog, int id) {
|
|
97
|
-
dialog.cancel();
|
|
98
|
-
}
|
|
99
|
-
});
|
|
100
|
-
builder.setMessage(connected.get(0).getName());
|
|
101
|
-
|
|
102
|
-
AlertDialog alert = builder.create();
|
|
103
|
-
alert.show();
|
|
104
|
-
|
|
105
|
-
// for (int i = 0; i < connected.size(); i++) {
|
|
106
|
-
// Log.i("ReactNative", connected.get(i).getName());
|
|
107
|
-
// }
|
|
108
|
-
|
|
109
92
|
if (reader != null) {
|
|
110
93
|
reader.addBarcodeListener(HoneywellScannerModule.this);
|
|
111
94
|
try {
|
package/package.json
CHANGED