requestPermission
Makes requests for various permissions. It's important to note that how permissions work can vary depending on the operating system and its version.
Field Configurations
Key | Type | Description | Default Value |
---|---|---|---|
"params" (required) | Object | undefined | null |
Parameters
Key | Type | Description | Default Value |
---|---|---|---|
"async" | Boolean | Specifies whether the action should perform asynchronously. | null |
"onError" | String | Event that is fired if the request was not successful. | null |
"onErrorType" | OnErrorType | Type of event that will be fired on error. | null |
"onSuccess" | String | Event that is fired if the request was successful. | null |
"onSuccessType" | OnSuccessType | Type of event that will be fired on success. | null |
"permissions" (required) | Array | Permissions, which should be requested. There can be Android or iOS only permissions.. | null |
Inherited
From Base Action
Base Action
Field Configurations
Key | Type | Description | Default Value |
---|---|---|---|
"dynamicParams" | Object | Dynamic params to retrieve data from a specific context e.g. a userSetting. | null |
"leadingDelimiter" | String | The leading mustache delimiter to use. | null |
"params" | Object,Array | Object containing the properties of the action. | null |
"trailingDelimiter" | String | The trailing mustache delimiter to use. | null |
"type" | String | Type name of the action. | null |
Examples
Example 1: Request the push permission
Goal: Setting the push permission to get future pushes.
To achieve this the following code can be used:
{
"type": "requestPermission",
"params": {
"permissions": [
"push"
],
"onSuccessType": "return",
"onSuccess": "requestPushPermissionSuccess",
"onErrorType": "breakingEvent",
"onError": "requestPushPermissionError"
}
}
The popup shown may vary depending on the version and give you different options for how you want to handle the permission.
Result:
A requestPermission action has been created.