Overview
App Courier requires specific permissions to access device features like camera, storage, and network. This guide covers how to configure permissions for both Android and iOS platforms.Required Dependencies
The following packages inpubspec.yaml require permissions:
Android Permissions
Android permissions are declared inandroid/app/src/main/AndroidManifest.xml.
Current Permissions
Permission Breakdown
INTERNET
INTERNET
Purpose: Allows the app to access the network for API calls.Required for:
- Making HTTP/HTTPS requests
- Downloading/uploading data
- API communication
CAMERA
CAMERA
Purpose: Allows the app to access device camera.Required for:
- Taking photos for delivery proof
- Scanning barcodes/QR codes
- Document capture
READ_EXTERNAL_STORAGE / WRITE_EXTERNAL_STORAGE
READ_EXTERNAL_STORAGE / WRITE_EXTERNAL_STORAGE
Purpose: Allows reading and writing files to external storage.Required for:
- Accessing photos from gallery
- Saving documents locally
- Caching data
These permissions are deprecated on Android 13+ and replaced by granular media permissions.
READ_MEDIA_IMAGES
READ_MEDIA_IMAGES
Purpose: Granular permission for accessing image files.Required for:
- Selecting images from gallery
- Accessing user photos
Android API Level Handling
The app handles storage permissions differently based on Android version:iOS Permissions
iOS permissions are declared inios/Runner/Info.plist with usage descriptions.
Required Configuration
Add these entries toInfo.plist:
iOS Usage Descriptions
Explains why the app needs camera access. Shown to users when requesting camera permission.
Explains why the app needs to read from the photo library. Required for
image_picker.Explains why the app needs to save photos to the library. Required if saving images.
Runtime Permission Handling
Use thepermission_handler package to request permissions at runtime.
Requesting Camera Permission
Requesting Storage/Photos Permission
Checking Permission Status
Best Practices
Request in Context
Only request permissions when the user attempts to use a feature that requires it. Don’t request all permissions on app launch.
Explain the Why
Show a dialog explaining why the permission is needed before requesting it. This increases grant rates.
Handle Denial
Gracefully handle permission denial. Provide alternative workflows or disable features that require the permission.
Settings Redirect
If permission is permanently denied, guide users to app settings where they can manually grant it.
Complete Permission Flow Example
Troubleshooting
App crashes when requesting permission (iOS)
App crashes when requesting permission (iOS)
Cause: Missing usage description in
Info.plistSolution:- Add the appropriate
NS*UsageDescriptionkey toInfo.plist - Make sure the description is not empty
- Clean and rebuild the app
Permission dialog doesn't appear (Android)
Permission dialog doesn't appear (Android)
Cause: Permission not declared in
AndroidManifest.xml or already permanently deniedSolution:- Verify permission is in the manifest
- Check permission status before requesting
- Uninstall and reinstall the app to reset permissions
- Guide user to app settings if permanently denied
Storage permission not working on Android 13+
Storage permission not working on Android 13+
Cause: Using legacy storage permissions on Android 13+Solution:
- Use
Permission.photosinstead ofPermission.storage - Add
READ_MEDIA_IMAGESto AndroidManifest.xml - Check Android API level and request appropriate permission
Permission works on Android but not iOS
Permission works on Android but not iOS
Cause: Platform-specific permission configuration missingSolution:
- Ensure
Info.plisthas all required usage descriptions - Check iOS simulator/device system settings
- Reset all permissions: Settings → General → Transfer or Reset → Reset Location & Privacy
Additional Permissions
If your app needs additional permissions in the future:Location Permission
Android (AndroidManifest.xml):
Info.plist):
Notification Permission (Android 13+)
Android (AndroidManifest.xml):
Next Steps
Environment Config
Configure environment variables and build modes
API Setup
Set up backend API connection and authentication