Capture session interrupted randomly

We are facing a strange issue where a small portion of our large userbase can not start the capture session in our app, as it gets interrupted with the following reason:

AVCaptureSessionInterruptionReasonVideoDeviceNotAvailableWithMultipleForegroundApps

Our users are all from iPhones, no one is using an iPad. Just to be sure we have set

 session.isMultitaskingCameraAccessEnabled = true

but it does not seem to make any difference.

Another weird scenario we are seeing on an even smaller number of users is that the following call:

AVCaptureDevice.default(.builtInWideAngleCamera, for: .video, position: .back)

returns nil. A quick look at our error reports show this happening on iPhone XR, 13 and 14 models. They should all support this device type.

Any help on investigating these issue would be greatly appreciated!

Capture session interrupted randomly
 
 
Q