PermissionsAndroid: Requesting Runtime Permissions
PermissionsAndroid lets you ask for sensitive permissions like camera or location at runtime. Use its request method to show the native Android dialog. The biggest footgun is ignoring the NEVER_ASK_AGAIN result, which requires sending the user to system…
Why it exists
Before Android 6.0 (SDK 23), users granted all permissions at install time. This was an all-or-nothing deal. The modern model improves privacy by letting users grant sensitive permissions only when an app needs them. PermissionsAndroid is the React Native API that bridges this native, runtime-request functionality.
The mental model
Think of it as a gatekeeper for sensitive device features. You can't assume you have access to the camera or contacts. You must first knock on the door (check), and if it's locked, you must politely ask for the key (request). The user can grant access, deny it, or tell you to stop asking entirely.
How it works
The API has two primary methods. First, PermissionsAndroid.check(permission) returns a promise resolving to a boolean indicating if permission is already granted. Second, PermissionsAndroid.request(permission, rationale?) prompts the user with the system dialog. This returns a promise resolving to a result string: GRANTED, DENIED, or NEVER_ASK_AGAIN. The optional rationale argument displays an extra dialog explaining why you need the permission, but only if the user has denied it before.
When to use it
Use this in any React Native app (not using managed Expo) that needs to access a "dangerous" permission on Android. This includes location, camera, contacts, storage, and more. It is an Android-only API; iOS has a separate permission flow.
When not to use it
Do not use this for iOS. Also, if you are using the managed Expo workflow, use Expo's own permissions library instead. This API is intended for projects where you have direct access to the native Android project files. It is also unnecessary for "normal" permissions that are granted automatically at install.
One canonical example
To use the camera, you would first call await PermissionsAndroid.check(PermissionsAndroid.PERMISSIONS.CAMERA). If this is false, you then call await PermissionsAndroid.request(...). If the result is GRANTED, you can open the camera. If DENIED, you should disable the camera feature. If NEVER_ASK_AGAIN, you must disable the feature and provide a button that deep-links the user to your app's system settings, as you cannot prompt them again.
Interview question
When `PermissionsAndroid.request` resolves to `NEVER_ASK_AGAIN`, what is the appropriate next step for the application?
- a.Disable the feature and provide a button to deep-link the user to the app's system settings.Correct
- b.Wait for a short period and then automatically retry the `PermissionsAndroid.request` method.
- c.Display a custom in-app dialog and immediately re-attempt the permission request.
- d.Consider the permission permanently denied and disable the associated feature without further user interaction.
Why? this is the answer
The card explicitly states that for `NEVER_ASK_AGAIN`, you cannot prompt the user again and must provide a way to deep-link them to the app's system settings. Simply retrying the request or permanently disabling the feature without this option would not be correct.
Just read this? Test yourself on what you have been reading.
Read the original → reactnative.dev
- #react native
- #android
- #permissions
- #mobile
Put your scrolling time to good use
Learn one idea, try a quiz and save useful cards for revision. Tezvyn makes it easy to learn and stay current in your tech field, a few minutes at a time.
The iPhone app is on the way
We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.
Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.
We are hiring for this. Open roles that interview on react native — each one lists the topics its interview covers.
See open roles