An iOS app requests access to the user's camera. The app's Info.plist does not include the NSCameraUsageDescription key. What happens when the app calls AVCaptureSession on iOS 10+?
- A.A. The system displays a generic 'App wants to use your Camera' prompt without the developer's custom text
- B.B. The app crashes with an NSInvalidArgumentException because the purpose string key is required; iOS treats its absence as a programming error
- C.C. The system silently denies camera access and AVCaptureSession returns nil without crashing
- D.D. The app is automatically rejected at the App Store review stage but runs fine on sideloaded installations
Why B is correct
iOS enforces that apps accessing sensitive resources (camera, microphone, location, contacts, etc.) MUST include the corresponding NSXxxUsageDescription key in Info.plist. If the key is missing and the app attempts to access the resource, iOS terminates the app with a crash (SIGABRT with an NSInvalidArgumentException message like 'This app has crashed because it attempted to access privacy-sensitive data without a usage description'). This is enforced at runtime on iOS 10+, not just at App Store review.
Know someone studying for Mobile Security Fundamentals? Send them this one.