mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-07-24 17:20:51 +02:00
feat(barcode-scanner): validate missing Info.plist configuration (#1758)
This commit is contained in:
committed by
GitHub
parent
57fd28126c
commit
8c3a6a253d
@@ -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