java.lang.Object | ||
↳ | com.urbanairship.actions.Action | |
↳ | com.urbanairship.actions.PromptPermissionAction |
Known Direct Subclasses |
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: SITUATION_PUSH_OPENED, SITUATION_WEB_VIEW_INVOCATION, SITUATION_MANUAL_INVOCATION, SITUATION_AUTOMATION, and SITUATION_FOREGROUND_NOTIFICATION_ACTION_BUTTON.
Default Result: empty. The actual permission result can be received using a ResultReceiver in the metadata.
Default Registration Names: DEFAULT_REGISTRY_NAME
, DEFAULT_REGISTRY_SHORT_NAME
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
class | PromptPermissionAction.Args |
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String | AFTER_PERMISSION_STATUS_RESULT_KEY | Resulting permission status key when using a result receiver. | |||||||||
String | BEFORE_PERMISSION_STATUS_RESULT_KEY | The starting permission status key when using a result receiver. | |||||||||
String | DEFAULT_REGISTRY_NAME | Default registry name | |||||||||
String | DEFAULT_REGISTRY_SHORT_NAME | Default registry short name | |||||||||
String | ENABLE_AIRSHIP_USAGE_ARG_KEY | Enable airship usage argument key. | |||||||||
String | FALLBACK_SYSTEM_SETTINGS_ARG_KEY | Fallback system settings argument key. | |||||||||
String | PERMISSION_ARG_KEY | Permission argument key. | |||||||||
String | PERMISSION_RESULT_KEY | Permissions result key when using a result receiver. | |||||||||
String | RECEIVER_METADATA | Metadata key for a result receiver. |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.urbanairship.actions.Action
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
PromptPermissionAction(Supplier<PermissionsManager> permissionsManagerSupplier) | |||||||||||
PromptPermissionAction() |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
boolean |
acceptsArguments(ActionArguments arguments)
Called before an action is performed to determine if the
the action can accept the arguments.
| ||||||||||
final ActionResult |
perform(ActionArguments arguments)
Performs the action.
| ||||||||||
void | sendResult(Permission permission, PermissionStatus before, PermissionStatus after, ResultReceiver resultReceiver) | ||||||||||
boolean |
shouldRunOnMainThread()
Determines which thread runs the action.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
PromptPermissionAction.Args | parseArg(ActionArguments arguments) | ||||||||||
void | prompt(PromptPermissionAction.Args args, ResultReceiver resultReceiver) |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.urbanairship.actions.Action
| |||||||||||
From class
java.lang.Object
|
Resulting permission status key when using a result receiver.
The starting permission status key when using a result receiver.
Default registry name
Default registry short name
Enable airship usage argument key.
Fallback system settings argument key.
Permissions result key when using a result receiver.
Metadata key for a result receiver. Use PermissionResultReceiver
to simplify parsing the result.
Called before an action is performed to determine if the the action can accept the arguments.
arguments | The action arguments. |
---|
true
if the action can perform with the arguments,
otherwise false
.
Performs the action.
arguments | The action arguments. |
---|
Determines which thread runs the action.
true
if the action should be run on the main thread, or false
if the
action should run on a background thread.