With this function you can check to see if a specific permission has been granted to the game by the user. You supply the permission to check as a string using the format "android.permission.<permission>", so to check the RECORD_AUDIO permission (for example) you would call
The function will return will return one of three constants - shown below - to tell the game how the state of the permission. For more information on app permissions, please see the Android Documentation.IMPORTANT! This function is for the Android and Amazon Fire targets only.
|permission||The permission to check (a string)|
|os_permission_granted||This indicates that the permission has been granted|
|os_permission_denied||This indicates that the permission has not been granted|
|os_permission_denied_dont_request||This indicates that the permission has either been blocked by the phone settings, or that the user has previously denied the request and selected "Don't ask again".|
if os_type == os_android
if os_check_permission("android.permission.INTERNET") == os_permission_denied
The above code checks the OS type and if is Android, it performs a check on the permissions and if the "INTERNET" permission has not yet been granted, it requests it.