Skip to content

Commit

Permalink
feat(barcode-scanner): validate missing Info.plist configuration (tau…
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasfernog authored and Sir-Thom committed Oct 22, 2024
1 parent edb9de5 commit dc3675e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changes/barcode-scanner-validate-plist.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"barcode-scanner": patch
---

Validate missing `NSCameraUsageDescription` Info.plist value.
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,13 @@ class BarcodeScannerPlugin: Plugin, AVCaptureMetadataOutputObjectsDelegate {

self.invoke = invoke

let entry = Bundle.main.infoDictionary?["NSCameraUsageDescription"] as? String

if entry == nil || entry?.count == 0 {
invoke.reject("NSCameraUsageDescription is not in the app Info.plist")
return
}

var iOS14min: Bool = false
if #available(iOS 14.0, *) { iOS14min = true }
if !iOS14min && self.getPermissionState() != "granted" {
Expand Down

0 comments on commit dc3675e

Please sign in to comment.