@scrumble-nl/react-native-honeywell-scanner 1.0.4 → 1.0.6

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.
@@ -85,7 +85,7 @@ def configureReactNativePom(def pom) {
85
85
  version = packageJson.version
86
86
  group = "com.reactlibrary"
87
87
  description packageJson.description
88
- url packageJson.repository.baseUrl
88
+ url packageJson.repository
89
89
 
90
90
  licenses {
91
91
  license {
@@ -77,7 +77,7 @@ public class HoneywellScannerModule extends ReactContextBaseJavaModule implement
77
77
  public void onCreated(AidcManager aidcManager) {
78
78
  manager = aidcManager;
79
79
  reader = manager.createBarcodeReader();
80
- Log.d("BarcodeDevices: ", manager.listConnectedBarcodeDevices());
80
+ Log.i("ReactNative", manager.listConnectedBarcodeDevices());
81
81
  if (reader != null) {
82
82
  reader.addBarcodeListener(HoneywellScannerModule.this);
83
83
  try {
@@ -0,0 +1,2 @@
1
+ declare const HoneywellScanner: any;
2
+ export default HoneywellScanner;
package/dist/index.js ADDED
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const react_native_1 = require("react-native");
4
+ const { HoneywellScanner } = react_native_1.NativeModules;
5
+ /**
6
+ * Listen for available events
7
+ * @param {String} eventName Name of event one of barcodeReadSuccess, barcodeReadFail
8
+ * @param {Function} handler Event handler
9
+ */
10
+ const barcodeReaderEmitter = new react_native_1.NativeEventEmitter(HoneywellScanner);
11
+ var subscriptionBarcodeReadSuccess = null;
12
+ var subscriptionBarcodeReadFail = null;
13
+ HoneywellScanner.onBarcodeReadSuccess = (handler) => {
14
+ subscriptionBarcodeReadSuccess === null || subscriptionBarcodeReadSuccess === void 0 ? void 0 : subscriptionBarcodeReadSuccess.remove();
15
+ subscriptionBarcodeReadSuccess = null;
16
+ subscriptionBarcodeReadSuccess = barcodeReaderEmitter.addListener(HoneywellScanner.BARCODE_READ_SUCCESS, handler);
17
+ };
18
+ HoneywellScanner.onBarcodeReadFail = (handler) => {
19
+ subscriptionBarcodeReadFail === null || subscriptionBarcodeReadFail === void 0 ? void 0 : subscriptionBarcodeReadFail.remove();
20
+ subscriptionBarcodeReadFail = null;
21
+ subscriptionBarcodeReadFail = barcodeReaderEmitter.addListener(HoneywellScanner.BARCODE_READ_FAIL, handler);
22
+ };
23
+ /**
24
+ * Stop listening for event
25
+ * @param {String} eventName Name of event one of barcodeReadSuccess, barcodeReadFail
26
+ * @param {Function} handler Event handler
27
+ */
28
+ HoneywellScanner.offBarcodeReadSuccess = () => {
29
+ subscriptionBarcodeReadSuccess === null || subscriptionBarcodeReadSuccess === void 0 ? void 0 : subscriptionBarcodeReadSuccess.remove();
30
+ };
31
+ HoneywellScanner.offBarcodeReadFail = () => {
32
+ subscriptionBarcodeReadFail === null || subscriptionBarcodeReadFail === void 0 ? void 0 : subscriptionBarcodeReadFail.remove();
33
+ };
34
+ exports.default = HoneywellScanner;
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.4",
4
+ "version": "1.0.6",
5
5
  "description": "Bridge to use the Honeywell scanner",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",