EddyVerbruggen / nativescript-plugin-firebase

:fire: NativeScript plugin for Firebase
https://firebase.google.com
MIT License
1.01k stars 441 forks source link

barcode scanning issue - iPhone 13 Pro and iPhone 13 Pro max #1880

Open DanielDent opened 2 years ago

DanielDent commented 2 years ago

I'm using <MLKitBarcodeScanner preferFrontCamera="false"> and it's not working on iPhone 13 Pro and iPhone 13 Pro Max devices. I've had users report that the image is blurry.

I'm not sure what's going on, but I'm wondering if somehow the wrong camera might be getting used on these devices? They have both macro and telephoto cameras.

https://github.com/EddyVerbruggen/nativescript-plugin-firebase/blob/05be2bbf3f0883f46c1c84aed6b4d68bb84002f7/src/mlkit/mlkit-cameraview.ios.ts#L46

`this.captureDevice = AVCaptureDeviceDiscoverySession.discoverySessionWithDeviceTypesMediaTypePosition(

[AVCaptureDeviceTypeBuiltInWideAngleCamera], AVMediaTypeVideo, this.preferFrontCamera ? AVCaptureDevicePosition.Front : AVCaptureDevicePosition.Back ).devices.firstObject; ` If I'm correctly guessing what the issue might be, I think it might be related to those lines. I think in some cases the wrong camera might be getting used. https://developer.apple.com/documentation/avfoundation/avcapturedevicetypebuiltinwideanglecamera Has anyone else seen any similar or related issue?