diff --git a/barcodescanner.android.d.ts b/barcodescanner.android.d.ts index 8d6c2e8..d9de5c6 100644 --- a/barcodescanner.android.d.ts +++ b/barcodescanner.android.d.ts @@ -1,7 +1,6 @@ import { ScanOptions } from "./barcodescanner.common"; export declare class BarcodeScanner { private broadcastManager; - private onContinuousScanResult; private onPermissionGranted; private onPermissionRejected; private rememberedContext; diff --git a/barcodescanner.android.js b/barcodescanner.android.js index 98b57e9..2ce2857 100644 --- a/barcodescanner.android.js +++ b/barcodescanner.android.js @@ -4,6 +4,7 @@ var camera = require("camera"); var utils = require("utils/utils"); var SCANNER_REQUEST_CODE = 444; var _onScanReceivedCallback = undefined; +var _onContinuousScanResult = undefined; var BarcodeScanner = (function () { function BarcodeScanner() { this.broadcastManager = null; @@ -116,7 +117,7 @@ var BarcodeScanner = (function () { } var isContinuous = typeof arg.continuousScanCallback === "function"; if (isContinuous) { - self.onContinuousScanResult = arg.continuousScanCallback; + _onContinuousScanResult = arg.continuousScanCallback; intent.putExtra(com.google.zxing.client.android.Intents.Scan.BULK_SCAN, true); var CallbackReceiver = android.content.BroadcastReceiver.extend({ onReceive: function (context, data) { @@ -127,7 +128,7 @@ var BarcodeScanner = (function () { } if (arg.reportDuplicates || this.uniquelyScannedCodes.indexOf("[" + text + "][" + format + "]") === -1) { this.uniquelyScannedCodes.push("[" + text + "][" + format + "]"); - self.onContinuousScanResult({ + _onContinuousScanResult({ format: format, text: text }); diff --git a/barcodescanner.android.ts b/barcodescanner.android.ts index 12301dd..53fef3b 100644 --- a/barcodescanner.android.ts +++ b/barcodescanner.android.ts @@ -8,11 +8,11 @@ let SCANNER_REQUEST_CODE = 444; declare let com, android: any; let _onScanReceivedCallback = undefined; +let _onContinuousScanResult = undefined; export class BarcodeScanner { private broadcastManager: any = null; - private onContinuousScanResult: any; private onPermissionGranted: Function; private onPermissionRejected: Function; private rememberedContext: any = null; @@ -150,7 +150,7 @@ export class BarcodeScanner { let isContinuous = typeof arg.continuousScanCallback === "function"; if (isContinuous) { - self.onContinuousScanResult = arg.continuousScanCallback; + _onContinuousScanResult = arg.continuousScanCallback; intent.putExtra(com.google.zxing.client.android.Intents.Scan.BULK_SCAN, true); let CallbackReceiver = android.content.BroadcastReceiver.extend({ @@ -164,7 +164,7 @@ export class BarcodeScanner { } if (arg.reportDuplicates || this.uniquelyScannedCodes.indexOf("[" + text + "][" + format + "]") === -1) { this.uniquelyScannedCodes.push("[" + text + "][" + format + "]"); - self.onContinuousScanResult({ + _onContinuousScanResult({ format : format, text : text });