# CheckPermission

## Description

Only for Android, all other platforms will return 1 and do nothing. Checks if the user has granted your app the specified permission to use certain Android commands. The permissions are as follows
"WriteExternal" - used by the SaveSharedVariable commands and any "raw:" paths that access the sdcard.
"Location" - used by the GPS commands
"Camera" - used by the SetDeviceCameraToImage command "RecordAudio" - used by the StartScreenRecording command and for the AR camera feed This command will return 0 if you don't have permission and the user hasn't been asked yet, you should call RequestPermission if you need it. This command returns 1 if the user is in the process of being asked for permission, you should wait for a reply by continuing to call this command. It will return -1 if the user rejected permission, or 2 if the user granted permission. If the user rejects your request then you can ask again but you should explain why your app needs it first so they can make an informed choice. If they still reject it you should not normally ask a third time. After the first attempt Android will give the user the option to never allow the permission. In this case this command will always return -1 and RequestPermission will do nothing. The user will have to go into the device app settings to reverse this decision.
Any permission not listed here does not require you to prompt the user for permission, it will be auto granted on install if your app requires it. All permissions that your app uses, even those that require prompting, must be specified in the APK export dialog by ticking the appropriate check boxes.

## Definition

integer CheckPermission( szPermission )

int agk::CheckPermission( const char* szPermission )

## Parameters

- szPermission - The permission to check