iOS 16 native scan code rectOfInterest setting failed

I set rectOfInterest to AVCaptureMetadataOutput, which is a rectangular box. iOS15 has always been useful. After upgrading to iOS16, it doesn't work. Can only be in the middle of the screen, which is not what I want, does anyone know how to fix this? Looking for your help~

Accepted Reply

I also encountered the same problem, on iOS16, it seems that the QR code cannot be set at the same time as the barcode. //

self.output.metadataObjectTypes=@[AVMetadataObjectTypeQRCode,
                 AVMetadataObjectTypeEAN13Code,
                 AVMetadataObjectTypeEAN8Code,
                 AVMetadataObjectTypeUPCECode,
                 AVMetadataObjectTypeCode39Code,
                 AVMetadataObjectTypeCode39Mod43Code,
                 AVMetadataObjectTypeCode93Code,
                 AVMetadataObjectTypeCode128Code,
                 AVMetadataObjectTypePDF417Code,
                 AVMetadataObjectTypeDataMatrixCode];

// Before iOS15, I set it like this and it worked fine. After iOS16, it fails.

I removed, AVMetadataObjectTypeQRCode AVMetadataObjectTypeDataMatrixCode, it can correctly identify the barcode.

But before iOS15, QR code and barcode are used at the same time, this is a bug of iOS16 system, I hope to get professional answers from Apple developers, thank you!

  • This worked for me, thank you!!!!

Add a Comment

Replies

To be precise, the barcode recognition range is only in the middle of the screen, and the QR code is not affected.

  • Exactly! This bug still in iOS 16.1. Please, if there is bug report, share me link on this. I need it for my work

Add a Comment

I also encountered the same problem, on iOS16, it seems that the QR code cannot be set at the same time as the barcode. //

self.output.metadataObjectTypes=@[AVMetadataObjectTypeQRCode,
                 AVMetadataObjectTypeEAN13Code,
                 AVMetadataObjectTypeEAN8Code,
                 AVMetadataObjectTypeUPCECode,
                 AVMetadataObjectTypeCode39Code,
                 AVMetadataObjectTypeCode39Mod43Code,
                 AVMetadataObjectTypeCode93Code,
                 AVMetadataObjectTypeCode128Code,
                 AVMetadataObjectTypePDF417Code,
                 AVMetadataObjectTypeDataMatrixCode];

// Before iOS15, I set it like this and it worked fine. After iOS16, it fails.

I removed, AVMetadataObjectTypeQRCode AVMetadataObjectTypeDataMatrixCode, it can correctly identify the barcode.

But before iOS15, QR code and barcode are used at the same time, this is a bug of iOS16 system, I hope to get professional answers from Apple developers, thank you!

  • This worked for me, thank you!!!!

Add a Comment

Why isn't this issue being resolved by Apple? It has been 8 months since the bug was reported, and we can't find an alternative solution. Could you please resolve the issue as soon as possible?