nativescript-barcodescanner
Advanced tools
Comparing version 3.1.3 to 3.2.0
@@ -130,4 +130,19 @@ "use strict"; | ||
BarcodeScanner.prototype.requestCameraPermission = function () { | ||
return new Promise(function (resolve) { | ||
resolve(QRCodeReader.isAvailable()); | ||
return new Promise(function (resolve, reject) { | ||
var cameraStatus = AVCaptureDevice.authorizationStatusForMediaType(AVMediaTypeVideo); | ||
switch (cameraStatus) { | ||
case 0: { | ||
AVCaptureDevice.requestAccessForMediaTypeCompletionHandler(AVMediaTypeVideo, function (granted) { return granted ? resolve() : reject(); }); | ||
break; | ||
} | ||
case 3: { | ||
resolve(); | ||
break; | ||
} | ||
case 1: | ||
case 2: { | ||
reject(); | ||
break; | ||
} | ||
} | ||
}); | ||
@@ -134,0 +149,0 @@ }; |
{ | ||
"name": "nativescript-barcodescanner", | ||
"version": "3.1.3", | ||
"version": "3.2.0", | ||
"description": "Scan QR/barcodes with your NativeScript app.", | ||
@@ -5,0 +5,0 @@ "main": "barcodescanner", |
@@ -40,3 +40,2 @@ # NativeScript BarcodeScanner | ||
### iOS and Android | ||
* AZTEC (on Android only when passed in explicity via `formats`) | ||
* CODE_39 | ||
@@ -60,2 +59,3 @@ * CODE_93 | ||
### iOS only | ||
* AZTEC | ||
* CODE_39_MOD_43 | ||
@@ -62,0 +62,0 @@ * INTERLEAVED_2_OF_5 |
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
1690182
26
793