PromptPermissionAction

open class PromptPermissionAction(permissionsManagerProvider: () -> PermissionsManager) : Action(source)

An action that prompts for permission.

Expected value:

  • permission: post_notifications, contacts, bluetooth, location, media, mic, or camera

  • fallback_system_settings: true to navigate to app settings if the permission is silently denied.

  • allow_airship_usage: If the permission is granted, any Airship features that depend on the permission will be enabled as well, e.g., enable user notifications on PushManager and push feature on privacy Manager if notifications are allowed.

Accepted situations: Action.Situation.PUSH_OPENED, Action.Situation.WEB_VIEW_INVOCATION, Action.Situation.MANUAL_INVOCATION, Action.Situation.AUTOMATION, and Action.Situation.FOREGROUND_NOTIFICATION_ACTION_BUTTON.

Default Result: empty. The actual permission result can be received using a ResultReceiver in the metadata.

Default Registration Name: DEFAULT_NAMES

Inheritors

Constructors

Link copied to clipboard
constructor(permissionsManagerProvider: () -> PermissionsManager)
constructor()

Types

Link copied to clipboard
open class Args
Link copied to clipboard
object Companion

Functions

Link copied to clipboard
open override fun acceptsArguments(arguments: ActionArguments): Boolean

Called before an action is performed to determine if the the action can accept the arguments.

Link copied to clipboard
protected open fun parseArg(arguments: ActionArguments): PromptPermissionAction.Args
Link copied to clipboard
open override fun perform(arguments: ActionArguments): ActionResult

Performs the action.

Link copied to clipboard
protected fun prompt(args: PromptPermissionAction.Args, resultReceiver: ResultReceiver?)
Link copied to clipboard
fun sendResult(permission: Permission, before: PermissionStatus, after: PermissionStatus, resultReceiver: ResultReceiver?)
Link copied to clipboard
open override fun shouldRunOnMainThread(): Boolean

Determines which thread runs the action.

Inherited functions

Link copied to clipboard
open fun onFinish(arguments: ActionArguments, result: ActionResult)

Called after the action performs.

Link copied to clipboard
open fun onStart(arguments: ActionArguments)

Called before an action is performed.

Link copied to clipboard

Performs the action, with pre/post execution calls, if it accepts the provided arguments.