twostraws / CodeScanner

A SwiftUI view that is able to scan barcodes, QR codes, and more, and send back what was found.
MIT License
1.03k stars 295 forks source link

Codescanner not working in iPadOS 17.4 #134

Closed BSDOezdemir closed 6 months ago

BSDOezdemir commented 7 months ago

Since the iOS 17.4 Update, CodeScannerView doesn't seem to call the closure when trying to scan codes. Issue has been seen with the newest version of CodeScanner 2.4. Tested on an iPad 6th generation with iOS 17.4. Worked fine before the 17.4 Update.

BSDOezdemir commented 7 months ago

I need to correct one thing and add something else:

  1. The issue happened on an iPad with iPadOS 17.4, not iOS!
  2. This doesn't seem to be an issue on iOS 17.4. The same app works flawlessly on an iPhone 11 with iOS 17.4
BSDOezdemir commented 7 months ago

I went a bit further into this, and this is what I found:

On an iPad, the function metadataOutput is not called by the AVFoundation framework. Therefore I believe this is an issue with AVFoundation, rather than this library. Especially since the same Code works on an iPhone, this could be an internal problem in AVFoundation on certain devices.

david-hosier commented 6 months ago

@BSDOezdemir I just saw this article that mentions what is likely the cause of your trouble. https://www.macrumors.com/2024/03/21/ios-17-4-1-qr-code-scanning-bug/

nathanfallet commented 6 months ago

@BSDOezdemir This should be fixed in iPadOS 17.4.1. Please reopen if you still experience an issue.