Request permissions at runtime appropriately (in Android 6.0+)
Make sure you request permissions at the right time and appropriately educate and inform your users about the need for permission requests.
Why it works
Inappropriate permission requests, those that the user doesn’t fully understand, can result in users failing to grant a permission. As a result, your app may be unable to deliver the user the features intended. In the worst case, poorly requested permissions could result in users losing trust in your app and uninstalling it.
By following the best practices for making permission requests you’ll provide users with the reassurance that your app is making a legitimate request and will handle the data or functions it provides access to with care. Users are therefore more likely to grant your app the permission it needs and remain engaged as they get to experience the app’s features as intended.
- Educate the user before requesting a permission, particularly if the permissions use is unclear: features that require a permission should provide a clear benefit for the permission request.
- Always check to see if the permission has been granted before attempting to use it. The user may revoke a permission at any time through the system settings.
- Ensure users benefit from allowing a permission immediately, as it helps instill trust in users and assures them that the permissions request was legitimate and necessary.
- Help users undo permission denials. Where a user has taken the "Don't Ask Again" option, guide them to the app settings if they want to grant the permission.
Make sure that users have the right settings enabled for your app to work. Even if you have permission, users can still turn off certain settings for their device. For example, airplane mode could prevent your app from getting data. Or you could have the location permission, but users could have location switched off for their device.
When you need location, construct a Location Settings Request to make sure that the appropriate device settings are turned on. This will display a dialog to the user, prompting them to turn on the appropriate location settings on their device without having to leave your app.
- When you need location, construct a Location Settings Request to make sure that the appropriate device settings are turned on. This will display a dialog to the user, prompting them to turn on the appropriate location settings on their device without having to leave your app.