Navaron Bracke

use well defined error code for barcode errors on iOS

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