Navaron Bracke

fix missing Dispatch queue switch on MacOS

... ... @@ -144,8 +144,10 @@ public class MobileScannerPlugin: NSObject, FlutterPlugin, FlutterStreamHandler,
}
}
} else {
DispatchQueue.main.async {
self?.sink?(FlutterError(code: "MobileScanner", message: error?.localizedDescription, details: nil))
}
}
})
if(self?.symbologies.isEmpty == false){
// add the symbologies the user wishes to support
... ... @@ -153,11 +155,13 @@ public class MobileScannerPlugin: NSObject, FlutterPlugin, FlutterStreamHandler,
}
try imageRequestHandler.perform([barcodeRequest])
} catch let e {
DispatchQueue.main.async {
self?.sink?(FlutterError(code: "MobileScanner", message: e.localizedDescription, details: nil))
}
}
}
}
}
func checkPermission(_ call: FlutterMethodCall, _ result: @escaping FlutterResult) {
if #available(macOS 10.14, *) {
... ...