mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-06-06 13:53:54 +02:00
feat(barcode-scanner): validate missing Info.plist configuration (#1758)
This commit is contained in:
committed by
GitHub
parent
57fd28126c
commit
8c3a6a253d
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"barcode-scanner": patch
|
||||
---
|
||||
|
||||
Validate missing `NSCameraUsageDescription` Info.plist value.
|
||||
@@ -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" {
|
||||
|
||||
Reference in New Issue
Block a user