iOS 12.3.1 iPad相机权限问题排查:ARKit应用遭苹果审核拒绝
Hey, I’ve dealt with this exact problem before—some iOS 12.3.1 iPad devices don’t automatically trigger the camera permission prompt when launching an ARKit app, even if you’ve properly set the Privacy - Camera Usage Description in your Info.plist. The root issue here is that ARKit’s automatic permission request can fail on certain older iOS 12 iPad builds, so we need to proactively check and request camera permission before initializing the AR session.
Here’s a robust, iOS 12-compatible solution to handle this:
1. Import Required Frameworks
First, add these imports to your view controller or a dedicated permission manager class:
import AVFoundation import ARKit
2. Build a Reusable Permission Checker
Create a method to handle the full permission flow—this covers every possible permission state:
func checkCameraPermission(completion: @escaping (Bool) -> Void) { let permissionStatus = AVCaptureDevice.authorizationStatus(for: .video) switch permissionStatus { case .authorized: // We're good to go—start ARKit completion(true) case .notDetermined: // User hasn't decided yet; explicitly request permission AVCaptureDevice.requestAccess(for: .video) { granted in // Always jump back to main thread for UI updates DispatchQueue.main.async { completion(granted) } } case .denied, .restricted: // User blocked permission or it's restricted by system settings showPermissionDeniedAlert() completion(false) @unknown default: // Catch any future permission states we don't handle yet completion(false) } } private func showPermissionDeniedAlert() { let alert = UIAlertController( title: "Camera Access Required", message: "To use the AR features in this app, please enable camera access in your device settings.", preferredStyle: .alert ) alert.addAction(UIAlertAction(title: "Cancel", style: .cancel)) alert.addAction(UIAlertAction(title: "Open Settings", style: .default) { _ in guard let settingsURL = URL(string: UIApplication.openSettingsURLString) else { return } UIApplication.shared.open(settingsURL) }) present(alert, animated: true) }
3. Initialize ARKit Only After Permission is Granted
Call the permission checker before you set up your AR session—for example, in viewDidLoad or when the user taps to start the AR experience:
override func viewDidLoad() { super.viewDidLoad() // Prioritize permission check over ARKit setup checkCameraPermission { [weak self] granted in guard granted, let self = self else { return } self.startARSession() } } private func startARSession() { let configuration = ARWorldTrackingConfiguration() // Add any custom config here (plane detection, etc.) arView.session.run(configuration) }
Why This Works
- We use
AVCaptureDevicedirectly instead of relying on ARKit’s internal permission trigger because ARKit’s automatic request can fail silently on iOS 12.3.1 iPads. Since ARKit’s camera access depends on AVFoundation’s video permission, this is a reliable alternative. - We handle all permission states (authorized, not determined, denied/restricted) to cover every edge case.
- The alert for denied permissions guides users to fix the issue directly, which improves UX and ensures your app doesn’t just hang without feedback.
Testing Tip
When testing on your target iOS 12.3.1 iPad, make sure to reset the app’s permissions first (Settings > [Your App] > Reset Location & Privacy) to simulate the fresh install scenario Apple uses for review.
内容的提问来源于stack exchange,提问作者Neil Bergenroth

