We're facing a strange issue where UIImagePickerController opens with a black screen (no camera preview) for some users only. The camera permissions are granted, and the picker is presented without errors. This problem does not reproduce on all devices — it's been reported on:
iPhone 14 – iOS 18.4
iPhone 13 – iOS 18.5
Other unknown devices (users didn’t share details)
We are using UIImagePickerController to open the rear camera, and presenting it from appDelegate.window?.rootViewController. All required permissions are in place (NSCameraUsageDescription is added in Info.plist, runtime permissions checked and approved).
Still, for a subset of users, the screen goes black when trying to capture a photo. We suspect either a system-level issue with iOS 18.4+, a session conflict, or an issue with how we present the picker.
Looking for advice or known issues/workarounds. Would switching to AVCaptureSession help?
What We’ve Verified: NSCameraUsageDescription is set in Info.plist
Camera permission is requested and granted at runtime
Users tried:
- Reinstalling the app
- Restarting the phone
- Switching between front/rear camera
- Still, the camera preview remains black
- No crash logs or exceptions
Below is the Code Level Example:-
let imagePicker = UIImagePickerController()
let Capture = UIAlertAction(title: "TAKE_PHOTO".localized, style: .destructive) { _ in
self.imagePicker.sourceType = .camera
self.imagePicker.cameraDevice = .rear
self.imagePicker.showsCameraControls = true
self.imagePicker.allowsEditing = false
appDelegate.window?.rootViewController?.present(self.imagePicker, animated: true, completion: nil)
}