nativescript-barcodescanner
Advanced tools
Comparing version 2.3.3 to 2.4.0
@@ -125,2 +125,3 @@ "use strict"; | ||
} | ||
intent.putExtra(com.google.zxing.client.android.Intents.Scan.BEEP_ON_SCAN, arg.beepOnScan !== false); | ||
if (arg.resultDisplayDuration !== undefined) { | ||
@@ -127,0 +128,0 @@ intent.putExtra(com.google.zxing.client.android.Intents.Scan.RESULT_DISPLAY_DURATION_MS, "" + arg.resultDisplayDuration); |
@@ -9,2 +9,3 @@ export interface CommonScanOptions { | ||
torchOn?: boolean; | ||
beepOnScan?: boolean; | ||
} | ||
@@ -11,0 +12,0 @@ export interface IOS extends CommonScanOptions { |
"use strict"; | ||
var utils = require("utils/utils"); | ||
var frame = require("ui/frame"); | ||
var fs = require("file-system"); | ||
var BarcodeScanner = (function () { | ||
@@ -143,3 +144,3 @@ function BarcodeScanner() { | ||
self._scanner.modalPresentationStyle = 2; | ||
var delegate_1 = QRCodeReaderDelegateImpl.new().initWithCallback(isContinuous_1, arg.reportDuplicates, function (reader, text, format) { | ||
var delegate_1 = QRCodeReaderDelegateImpl.new().initWithCallback(arg.beepOnScan, isContinuous_1, arg.reportDuplicates, function (reader, text, format) { | ||
if (text === undefined) { | ||
@@ -169,2 +170,5 @@ self._removeVolumeObserver(); | ||
device.autoFocusRangeRestriction = 1; | ||
if (device.smoothAutoFocusSupported) { | ||
device.smoothAutoFocusEnabled = true; | ||
} | ||
device.unlockForConfiguration(); | ||
@@ -205,6 +209,14 @@ } | ||
}; | ||
QRCodeReaderDelegateImpl.prototype.initWithCallback = function (isContinuous, reportDuplicates, callback) { | ||
QRCodeReaderDelegateImpl.prototype.initWithCallback = function (beepOnScan, isContinuous, reportDuplicates, callback) { | ||
this._isContinuous = isContinuous; | ||
this._reportDuplicates = reportDuplicates; | ||
this._callback = callback; | ||
this._beepOnScan = beepOnScan; | ||
if (this._beepOnScan) { | ||
var soundPath = fs.knownFolders.currentApp().path + "/tns_modules/nativescript-barcodescanner/sound/beep.caf"; | ||
this._player = new AVAudioPlayer({ contentsOfURL: NSURL.fileURLWithPath(soundPath) }); | ||
this._player.numberOfLoops = 1; | ||
this._player.volume = 0.7; | ||
this._player.prepareToPlay(); | ||
} | ||
return this; | ||
@@ -233,2 +245,5 @@ }; | ||
} | ||
if (this._player) { | ||
this._player.play(); | ||
} | ||
}; | ||
@@ -235,0 +250,0 @@ ; |
# Change Log | ||
## [2.4.0](https://github.com/EddyVerbruggen/nativescript-barcodescanner/tree/2.4.0) (2017-02-04) | ||
[Full Changelog](https://github.com/EddyVerbruggen/nativescript-barcodescanner/compare/2.3.3...2.4.0) | ||
**Implemented enhancements:** | ||
- Smoother autofocus on capable devices [\#75](https://github.com/EddyVerbruggen/nativescript-barcodescanner/issues/75) | ||
- Add an option to play/suppress a sound upon scanning [\#74](https://github.com/EddyVerbruggen/nativescript-barcodescanner/issues/74) | ||
**Closed issues:** | ||
- Android zxing library [\#71](https://github.com/EddyVerbruggen/nativescript-barcodescanner/issues/71) | ||
- null is not an object \(evaluating 'device.autoFocusRangeRestrictionSupported'\) [\#70](https://github.com/EddyVerbruggen/nativescript-barcodescanner/issues/70) | ||
- Keyboard cover the text field after launch barcodescanner [\#68](https://github.com/EddyVerbruggen/nativescript-barcodescanner/issues/68) | ||
- RouterExtensions.navigate not working after scan. [\#58](https://github.com/EddyVerbruggen/nativescript-barcodescanner/issues/58) | ||
- Add support for MaxiCode on iOS [\#32](https://github.com/EddyVerbruggen/nativescript-barcodescanner/issues/32) | ||
## [2.3.3](https://github.com/EddyVerbruggen/nativescript-barcodescanner/tree/2.3.3) (2017-01-05) | ||
@@ -4,0 +20,0 @@ [Full Changelog](https://github.com/EddyVerbruggen/nativescript-barcodescanner/compare/2.3.2...2.3.3) |
{ | ||
"name": "nativescript-barcodescanner", | ||
"version": "2.3.3", | ||
"version": "2.4.0", | ||
"description": "Scan QR/barcodes with a {N} app.", | ||
@@ -15,3 +15,3 @@ "main": "barcodescanner", | ||
"demo.ios": "npm run preparedemo && cd demo && tns emulate ios --device \"iPhone 7\"", | ||
"demo.ios.device": "npm run preparedemo && cd demo && tns run ios", | ||
"demo.ios.device": "npm run preparedemo && cd demo && tns platform remove ios && tns platform add ios && tns run ios", | ||
"demo.android": "npm run preparedemo && cd demo && tns run android", | ||
@@ -66,2 +66,2 @@ "preparedemo": "npm run build && cd demo && tns plugin remove nativescript-barcodescanner && tns plugin add .. && tns install", | ||
} | ||
} | ||
} |
@@ -73,2 +73,3 @@ # NativeScript BarcodeScanner | ||
showTorchButton: true, // default false | ||
beepOnScan: true, // Play or Suppress beep on scan (default true) | ||
torchOn: false, // launch with the flashlight on (default false) | ||
@@ -103,2 +104,3 @@ resultDisplayDuration: 500, // Android only, default 1500 (ms), set to 0 to disable echoing the scanned text | ||
showTorchButton: true, // default false | ||
beepOnScan: true, // Play or Suppress beep on scan (default true) | ||
torchOn: false, // launch with the flashlight on (default false) | ||
@@ -105,0 +107,0 @@ resultDisplayDuration: 500, // Android only, default 1500 (ms), set to 0 to disable echoing the scanned text |
@@ -24,2 +24,2 @@ { | ||
] | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1657016
28
572
233