Request permissions

The Request Permissions action node will open the built-in device prompt, where the user must accept (or reject) to grant permissions to this App. For example, permission to send notifications.

You must make sure your App prompts the user for permission to send notifications, using the Request Permissions action node, before you push notifications to the user. Otherwise, the notifications will be blocked.

Usage

Request various permissions for the App for the user's device. Currently, only Notifications is supported.

You should add the Request Permissions action node to an action in your end-user App. iOS is very strict on such popups, meaning they must be initiated from user interaction such as an On Click event. The best, and recommended approach, is to use a button or icon with an On Click event handler for enabling notifications.

Note: On Android, you may trigger det Request Permissions on e.g. an On App Loaded action. You may add a separate button visible only for iOS, triggering the same action by user interaction (On Click).

Push notifications will be blocked if the user has not accepted these permissions for the App.

When Request Permissions is triggered, the App Variable Notification Permissions is set. The default value of this App Variable is Prompt (i.e. the permissions have not been set, or have been reset). The user may respond by accepting or rejecting the request, resulting in the value Granted or Denied. You may use the value of this App Variable to display different messages to the end user.

You may see an example of the combination of Send Push Notification and Request Permissions in our Showroom. Note that the Request Permissions example is a separate App, and you may take a look at it inside Appfarm Create to see how we have differentiated the user feedback based on the App Variable Notification Permission.

Properties

Type

The only option is Notifications. Setting the Type to Notification will ask for permission for the App to send notifications to the user's device.

Last updated