From 868b3ec32164ee3ecd2015f4fb4e9c9e56a801b3 Mon Sep 17 00:00:00 2001 From: EddyVerbruggen Date: Tue, 12 Mar 2019 11:26:35 +0100 Subject: [PATCH] Bug when scanning QR code #195 --- CHANGELOG.md | 8 ++++++++ src/barcodescanner.ios.ts | 7 +++---- src/package.json | 2 +- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1fdb5ed..b57a5de 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## [3.1.2](https://github.com/EddyVerbruggen/nativescript-barcodescanner/tree/3.1.2) (2019-03-12) +[Full Changelog](https://github.com/EddyVerbruggen/nativescript-barcodescanner/milestone/38?closed=1) + + +## [3.1.1](https://github.com/EddyVerbruggen/nativescript-barcodescanner/tree/3.1.1) (2019-03-10) +[Full Changelog](https://github.com/EddyVerbruggen/nativescript-barcodescanner/milestone/37?closed=1) + + ## [3.1.0](https://github.com/EddyVerbruggen/nativescript-barcodescanner/tree/3.1.0) (2019-03-06) [Full Changelog](https://github.com/EddyVerbruggen/nativescript-barcodescanner/milestone/36?closed=1) diff --git a/src/barcodescanner.ios.ts b/src/barcodescanner.ios.ts index f1b7369..49f46d2 100644 --- a/src/barcodescanner.ios.ts +++ b/src/barcodescanner.ios.ts @@ -228,7 +228,7 @@ export class BarcodeScanner { isContinuous, arg.reportDuplicates, arg.formats, - (text: string, format: string) => { + (text: string, barcodeFormat: BarcodeFormat) => { // invoke the callback / promise if (text === undefined) { this._removeVolumeObserver(); @@ -236,7 +236,6 @@ export class BarcodeScanner { reject("Scan aborted"); } else { - let barcodeFormat = getBarcodeFormat(format); let value = text; if (shouldReturnEAN13AsUPCA(barcodeFormat, value, arg.formats)) { @@ -401,7 +400,7 @@ class QRCodeReaderDelegateImpl extends NSObject implements QRCodeReaderDelegate return delegate; } - private _callback: (text?: string, format?: string) => void; + private _callback: (text?: string, format?: BarcodeFormat) => void; private _beepOnScan: boolean; private _isContinuous: boolean; private _reportDuplicates: boolean; @@ -411,7 +410,7 @@ class QRCodeReaderDelegateImpl extends NSObject implements QRCodeReaderDelegate // initializing this value may prevent recognizing too quickly private _lastScanResultTs: number = new Date().getTime(); - public setCallback(beepOnScan: boolean, isContinuous: boolean, reportDuplicates: boolean, requestedFormats: string, callback: (text?: string, format?: string) => void): void { + public setCallback(beepOnScan: boolean, isContinuous: boolean, reportDuplicates: boolean, requestedFormats: string, callback: (text?: string, format?: BarcodeFormat) => void): void { this._isContinuous = isContinuous; this._reportDuplicates = reportDuplicates; this._requestedFormats = requestedFormats; diff --git a/src/package.json b/src/package.json index 6ab952b..2a830f0 100644 --- a/src/package.json +++ b/src/package.json @@ -1,6 +1,6 @@ { "name": "nativescript-barcodescanner", - "version": "3.1.1", + "version": "3.1.2", "description": "Scan QR/barcodes with your NativeScript app.", "main": "barcodescanner", "typings": "index.d.ts",