Navaron Bracke

use well defined error code for barcode errors on iOS

... ... @@ -42,7 +42,10 @@ public class MobileScannerPlugin: NSObject, FlutterPlugin {
init(barcodeHandler: BarcodeHandler, registry: FlutterTextureRegistry) {
self.mobileScanner = MobileScanner(registry: registry, mobileScannerCallback: { barcodes, error, image in
if error != nil {
barcodeHandler.publishEvent(["name": "error", "data": error!.localizedDescription])
barcodeHandler.publishEvent([
"name": MobileScannerErrorCodes.BARCODE_ERROR,
"data": error!.localizedDescription,
])
return
}
... ...