6

I'm encountering an issue with the QR code scanner on my iPad 7th Gen running ipadOS 17.4. While the scanner seems to be functioning normally on the latest iPad 10th Gen (also on ipadOS 17.4), it's not working at all for ipad 7th gen (ipadOS 17.4) on my device.

It's possible that this problem affects other iPad models but for now I've tested just these two models.

Has anyone else experienced similar issues with the QR code scanner? Any suggestions for troubleshooting or a potential fix would be greatly appreciated.

List of tried device:

  • ipad 6Gen: KO
  • ipad 7Gen: KO
  • iPad 10Gen: OK
  • iPhone 15: OK
  • iPad 8th gen OK
  • iPad Air 4th gen OK
  • iPad Pro 12" 4th Gen OK
  • iPhone 15 Pro OK

Minor update

I tried to download AVCam project from official documentation of Apple and I confirm that is not working even in their swift project. But the face recognition is working

MetadataOutput

captureObject = [[AVCaptureMetadataOutput alloc]init];
objectQueue =       dispatch_queue_create("VideoDataOutputQueue", NULL);//dispatch_queue_create("newQueue", NULL);
[captureObject setMetadataObjectsDelegate:self queue:objectQueue];

I tried to use main_queue where creating the dispatch_queue but not delegating:

objectQueue =       dispatch_queue_create("VideoDataOutputQueue", NULL);//dispatch_queue_create("newQueue", dispatch_get_main_queue());

The problem is that is not delegating nor triggering the method:

- (void)captureOutput:(AVCaptureOutput *)output didOutputMetadataObjects:(NSArray<__kindof AVMetadataObject *> *)metadataObjects fromConnection:(AVCaptureConnection *)connection {
    
    if (metadataObjects != nil && metadataObjects.count > 0) {
        
        NSLog(@"%@", [metadataObjects objectAtIndex:0]);
         
        }
    }
}

WORKAROUND

There is no current solution up to now but i used a workaround using AVCaptureVideoDataOutputSampleBufferDelegate.

Then use the following output:

self.videoDataOutput = [[AVCaptureVideoDataOutput alloc] init];
[self.videoDataOutput setSampleBufferDelegate:self queue:dispatchQueue];
if ([_captureSession canAddOutput:self.videoDataOutput]) {
    [_captureSession addOutput:self.videoDataOutput];
}

Then using delegate method:

- (void)captureOutput:(AVCaptureOutput *)output didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer fromConnection:(AVCaptureConnection *)connection {
    CVImageBufferRef imageBuffer = CMSampleBufferGetImageBuffer(sampleBuffer);
    if (imageBuffer == NULL) {
        return;
    }
    CIImage *ciImage = [CIImage imageWithCVImageBuffer:imageBuffer];
    [self detectQRCode:ciImage];
}

-(void)detectQRCode:(CIImage *)image {
    NSDictionary* options;
    CIContext* context = [CIContext context];
    options = @{ CIDetectorAccuracy : CIDetectorAccuracyHigh };
    CIDetector* qrDetector = [CIDetector detectorOfType:CIDetectorTypeQRCode
                                                context:context
                                                options:options];
//    if ([[image properties] valueForKey:(NSString*) kCGImagePropertyOrientation] == nil) {
//        options = @{ CIDetectorImageOrientation : @1};
//    } else {
//        options = @{ CIDetectorImageOrientation : [[image properties] valueForKey:(NSString*) kCGImagePropertyOrientation]};
//    }
    
    NSArray * features = [qrDetector featuresInImage:image options:options];
    
    if (features == nil || [features count] == 0) {
        return;
    }
    CIQRCodeFeature *metadataObj = [features firstObject];
    NSString *qrString = [NSString  stringWithString:metadataObj.messageString];
    NSLog(@"feature: %@",qrString);
}


UPDATE

iOS 17.4.1 fixes the AVCaptureMetadataOutputObjectsDelegate.

13
  • I've encountered this as well, it's very frustrating. I don't know of a workaround yet.
    – Kevlar
    Mar 8 at 15:08
  • ipad 6th gen is not working as well
    – jacorl
    Mar 8 at 15:41
  • 2
    I filed a bug with Apple. I think this was an unintended consequence of something they patched in 17.4. feedbackassistant.apple.com/feedback/13680097 Mar 8 at 20:34
  • 4
    There is a statement regarding this issue from Apple support: support.apple.com/en-lamr/118614 It affects iPad 6th & 7th Gen, iPad Pro 12.9-inch (2nd Gen), iPad Pro 10.5-inch
    – gtRfnkN
    Mar 14 at 12:12
  • 3
    Thanks to @gtRfnkN 's link. The webpage of it is updated. Now, it said upgrading to iOS 17.4.1 fixes the QR code scanning issue. I confirm that on my iPad 6. Unfortunately, it seems 17.4.1 fixes only QR code scanning. Bar codes, like Code 39, are not fixed😭 Mar 22 at 1:13

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.