|
| 1 | +Name: androidRequestPermission |
| 2 | + |
| 3 | +Type: command |
| 4 | + |
| 5 | +Syntax: androidRequestPermission <permissionName> |
| 6 | + |
| 7 | +Summary: |
| 8 | +Displays a dialog showing a permission request for <permissionName>. If a user has already granted permission for <permissionName>, this command does nothing. |
| 9 | + |
| 10 | +Introduced: 9.0.1 |
| 11 | + |
| 12 | +OS: android |
| 13 | + |
| 14 | +Platforms: mobile |
| 15 | + |
| 16 | +Example: |
| 17 | +local tCameraPermissionGranted |
| 18 | +put androidHasPermission("android.permission.CAMERA") into tCameraPermissionGranted |
| 19 | +if not tCameraPermissionGranted then |
| 20 | + androidRequestPermission "android.permission.CAMERA" |
| 21 | +end if |
| 22 | +put androidHasPermission("android.permission.CAMERA") into tCameraPermissionGranted |
| 23 | +if not tCameraPermissionGranted then |
| 24 | + answer "This app is not permitted to access the device camera. You can change this" && \ |
| 25 | + "in the Settings app." |
| 26 | +end if |
| 27 | + |
| 28 | + |
| 29 | +Parameters: |
| 30 | +permissionName (enum): |
| 31 | +The name of the permission to request. |
| 32 | + |
| 33 | +- "android.permission.READ_CALENDAR": permission to allow an application to read the device's calendar. |
| 34 | +- "android.permission.WRITE_CALENDAR": permission to allow an application to write to the device's calendar. |
| 35 | +- "android.permission.CAMERA": permission to allow an application to access the device's camera. |
| 36 | +- "android.permission.ACCESS_COARSE_LOCATION": permission to allow an application to access the device's coarse location. |
| 37 | +- "android.permission.ACCESS_FINE_LOCATION": permission to allow an application to access the device's fine location. |
| 38 | +- "android.permission.READ_CONTACTS": permission to allow an application to read data from the device's contacts. |
| 39 | +- "android.permission.WRITE_CONTACTS": permission to allow an application to write date to the device's contacts. |
| 40 | +- "android.permission.GET_ACCOUNTS": permission to allow an application to access to the list of accounts in the Accounts Service. |
| 41 | +- "android.permission.RECORD_AUDIO": permission to allow an application to allow an application to record audio. |
| 42 | +- "android.permission.READ_EXTERNAL_STORAGE": permission to allow an application to read data from the device's external storage. |
| 43 | +- "android.permission.WRITE_EXTERNAL_STORAGE": permission to allow an application to write data to the device's external storage. |
| 44 | +- "android.permission.READ_PHONE_STATE": permission to allow an application to access phone state, including the phone number of the device, current cellular network information, the status of any ongoing calls, and a list of any PhoneAccounts registered on the device. |
| 45 | +- "android.permission.READ_PHONE_NUMBERS": permission to allow an application to access the device's phone number(s). |
| 46 | +- "android.permission.CALL_PHONE": permission to allow an application to initiate a phone call without going through the Dialer user interface for the user to confirm the call. |
| 47 | +- "android.permission.ANSWER_PHONE_CALLS": permission to allow an application to answer an incoming phone call. |
| 48 | +- "android.permission.READ_CALL_LOG": permission to allow an application to read the user's call log. |
| 49 | +- "android.permission.WRITE_CALL_LOG": permission to allow an application to write to the user's call log. |
| 50 | +- "android.permission.ADD_VOICEMAIL": permission to allow an application to add voicemails into the system. |
| 51 | +- "android.permission.USE_SIP": permission to allow an application to use SIP service. |
| 52 | +- "android.permission.PROCESS_OUTGOING_CALLS": permission to allow an application to see the number being dialed during an outgoing call with the option to redirect the call to a different number or abort the call altogether. |
| 53 | +- "android.permission.SEND_SMS": permission to allow an application to send SMS messages. |
| 54 | +- "android.permission.RECEIVE_SMS": permission to allow an application to receive SMS messages |
| 55 | +- "android.permission.READ_SMS": permission to allow an application to read SMS messages. |
| 56 | +- "android.permission.RECEIVE_WAP_PUSH": permission to allow an application to receive WAP push messages. |
| 57 | +- "android.permission.RECEIVE_MMS": permission to allow an application to receive MMS messages. |
| 58 | +- "android.permission.BODY_SENSORS": permission to allow an application to access data from sensors that the user uses to measure what is happening inside his/her body, such as heart rate. |
| 59 | + |
| 60 | + |
| 61 | + |
| 62 | +Description: |
| 63 | +Use the <androidRequestPermission> command to request permission for <permissionName> from the user. |
| 64 | + |
| 65 | +>*Note:* Permission names are case sensitive. |
0 commit comments