PermissionsAndroid
provides access to Android M's new permissions model.
Some permissions are granted by default when the application is installed
so long as they appear in AndroidManifest.xml
. However, "dangerous"
permissions require a dialog prompt. You should use this module for those
permissions.
On devices before SDK version 23, the permissions are automatically granted
if they appear in the manifest, so check
and request
should always be true.
If a user has previously turned off a permission that you prompt for, the OS
will advise your app to show a rationale for needing the permission. The
optional rationale
argument will show a dialog prompt only if
necessary - otherwise the normal permission prompt will appear.
DEPRECATED - use check
Returns a promise resolving to a boolean value as to whether the specified permissions has been granted
@deprecated
Returns a promise resolving to a boolean value as to whether the specified permissions has been granted
DEPRECATED - use request
Prompts the user to enable a permission and returns a promise resolving to a boolean value indicating whether the user allowed or denied the request
If the optional rationale argument is included (which is an object with a
title
and message
), this function checks with the OS whether it is
necessary to show a dialog explaining why the permission is needed
(https://developer.android.com/training/permissions/requesting.html#explain)
and then shows the system permission dialog
@deprecated
Prompts the user to enable a permission and returns a promise resolving to a string value indicating whether the user allowed or denied the request
If the optional rationale argument is included (which is an object with a
title
and message
), this function checks with the OS whether it is
necessary to show a dialog explaining why the permission is needed
(https://developer.android.com/training/permissions/requesting.html#explain)
and then shows the system permission dialog
Prompts the user to enable multiple permissions in the same dialog and returns an object with the permissions as keys and strings as values indicating whether the user allowed or denied the request
You can edit the content above on GitHub and send us a pull request!