AndroidPermission - stingray.AndroidPermission namespace reference - Stingray Lua API Reference
Use this API to check and request permission to access system resources and data on Android platforms.
The available permissions are described on this page
in the Android documentation, in the table at the bottom of the page.
When you call these functions, identify permissions by passing stingray.AndroidPermission.<PERMISSION_NAME>, where
<PERMISSION_NAME> matches one of the values in the Permissions column of the table at the link above. For example:
|
check ( permission ) : boolean
Queries the specified permission.
|
Parameters permission : | string | The permission to query (e.g., stingray.AndroidPermission.READ_EXTERNAL_STORAGE, stingray.AndroidPermission.CAMERA, etc.) See the stingray.AndroidPermission description above for details. |
Returns boolean |
true if the specified permission has been granted, false otherwise.
|
|
Queries the AndroidManifest.xml for the specified permission.
|
Parameters permission : | string | The permission to query (e.g., stingray.AndroidPermission.READ_EXTERNAL_STORAGE, stingray.AndroidPermission.CAMERA, etc.) See the stingray.AndroidPermission description above for details. |
Returns boolean |
true if the specified permission is in the AndroidManifest.xml, false otherwise.
|
|
Requests the specified permission.
|
Parameters permission : | string | The permission to request (e.g., stingray.AndroidPermission.READ_EXTERNAL_STORAGE, stingray.AndroidPermission.CAMERA, etc.) See the stingray.AndroidPermission description above for details. |
Returns | This function does not return any values. |
When using this function, any action that requires the permission should be delayed to the next frame
(including stingray.AndroidPermission.check), as the main thread will be held at the end of the current frame, waiting for the user's input.
|
Queries whether the user has chosen "Never ask again," in a permission request system dialog for the specified permission group.
|
Parameters permission : | string | The permission to query (e.g., stingray.AndroidPermission.READ_EXTERNAL_STORAGE, stingray.AndroidPermission.CAMERA, etc.) See the stingray.AndroidPermission description above for details. |
Returns boolean |
true if the user has muted requests for the specified permission, false otherwise.
|
On Android, this is equivalent to calling !activity.shouldShowRequestPermissionRationale(permission) in the Android Java API.
|
Checks whether the OS supports runtime permission requests.
|
Parameters | This function does not accept any parameters. |
Returns boolean |
true if the stingray.AndroidPermission.request function is supported.
|