| name | native-permission-manager |
| description | Safely modifies `AndroidManifest.xml` and `Info.plist` to add native permissions (e.g., Camera, Location, Storage). |
Instructions
When the user asks to "add camera permission", "enable location access", or similar requests involving native OS capabilities:
-
Identify the files to edit:
- Android:
android/app/src/main/AndroidManifest.xml
- iOS:
ios/Runner/Info.plist
-
For Android, inject the required <uses-permission> tag outside the <application> tag.
- Example (Camera):
<uses-permission android:name="android.permission.CAMERA" />
-
For iOS, inject the required key-value pair inside the main <dict> tag. Make sure to provide a descriptive string for why the permission is needed.
<key>NSCameraUsageDescription</key>
<string>This app requires access to the camera to take profile pictures.</string>
-
Use the replace_string_in_file tool to inject these nodes safely, using surrounding context to ensure proper XML/Plist structure is maintained.
-
Provide the user with a summary of the files changed.