The iOS Privacy Model
Every iOS app runs in a sandbox. Access to sensitive data (Location, Contacts, Photos) or hardware (Camera, Microphone) requires explicit user consent. As an Engineering Manager, you must ensure that your app provides a clear 'Purpose String' that explains why the data is needed, or Apple will automatically reject the app during the review process.
- Configuration: The Info.plist
Before you write a single line of Swift code, you must declare the permission in your Info.plist file. If your code attempts to access a protected resource without this key, the system will terminate (crash) the app instantly for security reasons.
| Key | Hardware/Data | Purpose Example |
|---|---|---|
| NSCameraUsageDescription | Camera | Used to scan UI sketches for AI generation. |
| NSPhotoLibraryAddUsageDescription | Photo Library | Required to save generated app mockups. |
| NSLocationWhenInUseUsageDescription | GPS Location | Used to tag projects with a location. |
| NSMicrophoneUsageDescription | Microphone | Needed for voice-controlled AI commands. |
- Runtime Requests
Declaring the key isn't enough; you must check the status at runtime. If the status is .notDetermined, you trigger the system alert. For a Flutter Architect, this is where you bridge the native AVFoundation or PhotoKit status back to your Dart UI.
- The One-Time Prompt Rule
iOS will only show the system permission dialog once. If the user taps 'Don't Allow,' your app cannot trigger the prompt again. You must instead detect the .denied state and provide a deep link that takes the user directly to the 'iOS Settings' app so they can toggle it manually.