Issue with barcode scanning in iOS 14

I've got a fairly old app that I first built back in 2014, and have been maintaining over the years.

One of the screens in the app uses the camera to scan barcodes. The barcodes we scan are printed on labels, and are in the org.iso.Code128 format.

When the app was first developed, I simply set the metadataObjectTypes property of AVCaptureMetadataOutput to all available types. This worked fine. The app scanned our barcodes very quickly with almost no issues.

In 2017, we started seeing issues where barcode scanning was becoming slower. I reasoned that having it configured to scan for every possible barcode format might be the issue, so I went in and changed the code to have it scan only for the org.iso.Code128 format. This helped, for a while.

Now, we're seeing the problem again in iOS 14 devices. On some devices it is nearly impossible to scan the barcodes. On others, you have to wait 20 or 30 seconds before the barcode is recognized.

What could be causing this issue?

We built an app in 2018 using Xamarin with AVFoundation which was working perfect but as soon as we updated iOS 15.4 in 2022, the scanning stopped working and now camera is scanning random Barcodes. After searching a-lot we could not find this issue on other forums So not sure what the issue is but there are certainly issues with iOS Scanning using AVFoundation..

Issue with barcode scanning in iOS 14
 
 
Q