public class

EnableFeatureAction

extends PromptPermissionAction
java.lang.Object
   ↳ com.urbanairship.actions.Action
     ↳ com.urbanairship.actions.PromptPermissionAction
       ↳ com.urbanairship.actions.EnableFeatureAction

Class Overview

An action that enables features. Running the action with value FEATURE_LOCATION or FEATURE_BACKGROUND_LOCATION will prompt the user for permissions before enabling.

Accepted situations: SITUATION_PUSH_OPENED, SITUATION_WEB_VIEW_INVOCATION, SITUATION_MANUAL_INVOCATION, SITUATION_AUTOMATION, and SITUATION_FOREGROUND_NOTIFICATION_ACTION_BUTTON.

Accepted argument value - either FEATURE_USER_NOTIFICATIONS, FEATURE_BACKGROUND_LOCATION, or FEATURE_LOCATION.

Result value: true if the feature was enabled, otherwise false.

Default Registration Names: DEFAULT_REGISTRY_NAME, DEFAULT_REGISTRY_SHORT_NAME

Summary

Constants
String DEFAULT_REGISTRY_NAME Default registry name
String DEFAULT_REGISTRY_SHORT_NAME Default registry short name
String FEATURE_BACKGROUND_LOCATION Action value to enable location with background updates.
String FEATURE_LOCATION Action value to enable location.
String FEATURE_USER_NOTIFICATIONS Action value to enable user notifications.
[Expand]
Inherited Constants
From class com.urbanairship.actions.PromptPermissionAction
From class com.urbanairship.actions.Action
Public Constructors
EnableFeatureAction(Supplier<PermissionsManager> permissionsManagerSupplier, Supplier<AirshipLocationClient> locationClientSupplier)
EnableFeatureAction()
Public Methods
void onStart(ActionArguments arguments)
Called before an action is performed.
Protected Methods
PromptPermissionAction.Args parseArg(ActionArguments arguments)
[Expand]
Inherited Methods
From class com.urbanairship.actions.PromptPermissionAction
From class com.urbanairship.actions.Action
From class java.lang.Object

Constants

public static final String DEFAULT_REGISTRY_NAME

Default registry name

Constant Value: "enable_feature"

public static final String DEFAULT_REGISTRY_SHORT_NAME

Default registry short name

Constant Value: "^ef"

public static final String FEATURE_BACKGROUND_LOCATION

Action value to enable location with background updates.

Constant Value: "background_location"

public static final String FEATURE_LOCATION

Action value to enable location.

Constant Value: "location"

public static final String FEATURE_USER_NOTIFICATIONS

Action value to enable user notifications. See setUserNotificationsEnabled(boolean)

Constant Value: "user_notifications"

Public Constructors

public EnableFeatureAction (Supplier<PermissionsManager> permissionsManagerSupplier, Supplier<AirshipLocationClient> locationClientSupplier)

public EnableFeatureAction ()

Public Methods

public void onStart (ActionArguments arguments)

Called before an action is performed.

Parameters
arguments The action arguments.

Protected Methods