Skip to main content

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

KeyTypeDescriptionDefault Value
"params" (required)Objectundefinednull

Parameters

KeyTypeDescriptionDefault Value
"async"BooleanSpecifies whether the action should perform asynchronously.null
"onError"StringEvent that is fired if the request was not successful.null
"onErrorType"OnErrorTypeType of event that will be fired on error.null
"onSuccess"StringEvent that is fired if the request was successful.null
"onSuccessType"OnSuccessTypeType of event that will be fired on success.null
"permissions" (required)ArrayPermissions, which should be requested. There can be Android or iOS only permissions..null

Inherited

From Base Action

Base Action

Field Configurations

KeyTypeDescriptionDefault Value
"dynamicParams"ObjectDynamic params to retrieve data from a specific context e.g. a userSetting.null
"leadingDelimiter"StringThe leading mustache delimiter to use.null
"params"Object,ArrayObject containing the properties of the action.null
"trailingDelimiter"StringThe trailing mustache delimiter to use.null
"type"StringType 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:

Screenshot of the app showing the results of the sample code from Example 1.
A requestPermission action has been created.