public class

EnableFeatureAction

extends Action
java.lang.Object
   ↳ com.urbanairship.actions.Action
     ↳ 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. false if the feature required user permissions that were rejected by the user.

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.Action
Public Constructors
EnableFeatureAction(PermissionsRequester permissionsRequester)
EnableFeatureAction()
Public Methods
boolean acceptsArguments(ActionArguments arguments)
Called before an action is performed to determine if the the action can accept the arguments.
ActionResult perform(ActionArguments arguments)
Performs the action.
[Expand]
Inherited Methods
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. See setLocationUpdatesEnabled(boolean) and setBackgroundLocationAllowed(boolean)

Constant Value: "background_location"

public static final String FEATURE_LOCATION

Action value to enable location. See setLocationUpdatesEnabled(boolean)

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 (PermissionsRequester permissionsRequester)

public EnableFeatureAction ()

Public Methods

public boolean acceptsArguments (ActionArguments arguments)

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

Parameters
arguments The action arguments.
Returns
  • true if the action can perform with the arguments, otherwise false.

public ActionResult perform (ActionArguments arguments)

Performs the action.

Parameters
arguments The action arguments.
Returns
  • The result of the action.