public class

ActionService

extends Service
java.lang.Object
   ↳ android.content.Context
     ↳ android.content.ContextWrapper
       ↳ android.app.Service
         ↳ com.urbanairship.actions.ActionService

Class Overview

Service class for running actions via push payload.

Summary

Constants
String ACTION_RUN_ACTIONS Intent action for running actions.
String EXTRA_ACTIONS_BUNDLE Intent extra for storing the actions as a bundle of action name to action values.
String EXTRA_ACTIONS_PAYLOAD This constant is deprecated. Marked to be removed in 7.0.0 . Use EXTRA_ACTIONS_BUNDLE to specify the actions as a bundle rather than a JSON string.
String EXTRA_METADATA Intent extra for storing metadata as a bundle.
String EXTRA_PUSH_BUNDLE This constant is deprecated. Marked to be removed in 7.0.0. Use EXTRA_METADATA to specify a bundle with the PushMessage parcelable stored under the PUSH_MESSAGE_METADATA key.
String EXTRA_SITUATION Intent extra for storing the current situation.
[Expand]
Inherited Constants
From class android.app.Service
From class android.content.Context
From interface android.content.ComponentCallbacks2
Public Constructors
ActionService()
Default ActionService constructor.
Public Methods
IBinder onBind(Intent intent)
void onCreate()
int onStartCommand(Intent intent, int flags, int startId)
static void runActions(Context context, Map<StringActionValue> actions, Situation situation, Bundle metadata)
Convenience method for running actions in the action service.
static void runActions(Context context, String actionsPayload, Situation situation, Bundle metadata)
Convenience method for running actions in the action service.
static void runActionsPayload(Context context, String payload, Situation situation, PushMessage message)
This method is deprecated. Marked to be removed in 7.0.0. Use runActions(Context, String, Situation, Bundle) instead.
static void runActionsPayload(Context context, String payload, Situation situation)
This method is deprecated. Marked to be removed in 7.0.0. Use runActions(Context, String, Situation, Bundle) instead.
[Expand]
Inherited Methods
From class android.app.Service
From class android.content.ContextWrapper
From class android.content.Context
From class java.lang.Object
From interface android.content.ComponentCallbacks
From interface android.content.ComponentCallbacks2

Constants

public static final String ACTION_RUN_ACTIONS

Intent action for running actions.

Constant Value: "com.urbanairship.actionservice.ACTION_RUN_ACTIONS"

public static final String EXTRA_ACTIONS_BUNDLE

Intent extra for storing the actions as a bundle of action name to action values.

Constant Value: "com.urbanairship.actionservice.EXTRA_ACTIONS"

public static final String EXTRA_ACTIONS_PAYLOAD

This constant is deprecated.
Marked to be removed in 7.0.0 . Use EXTRA_ACTIONS_BUNDLE to specify the actions as a bundle rather than a JSON string.

Intent extra for storing the actions payload

Constant Value: "com.urbanairship.actionservice.EXTRA_ACTIONS_PAYLOAD"

public static final String EXTRA_METADATA

Intent extra for storing metadata as a bundle.

Constant Value: "com.urbanairship.actionservice.EXTRA_METADATA"

public static final String EXTRA_PUSH_BUNDLE

This constant is deprecated.
Marked to be removed in 7.0.0. Use EXTRA_METADATA to specify a bundle with the PushMessage parcelable stored under the PUSH_MESSAGE_METADATA key.

Intent extra for storing the push bundle that triggered the actions.

Constant Value: "com.urbanairship.actionservice.EXTRA_PUSH_BUNDLE"

public static final String EXTRA_SITUATION

Intent extra for storing the current situation.

Constant Value: "com.urbanairship.actionservice.EXTRA_SITUATION"

Public Constructors

public ActionService ()

Default ActionService constructor.

Public Methods

public IBinder onBind (Intent intent)

public void onCreate ()

public int onStartCommand (Intent intent, int flags, int startId)

public static void runActions (Context context, Map<StringActionValue> actions, Situation situation, Bundle metadata)

Convenience method for running actions in the action service.

Parameters
context The application context.
actions Map of action name to action values.
situation The action situation.
metadata The action metadata.

public static void runActions (Context context, String actionsPayload, Situation situation, Bundle metadata)

Convenience method for running actions in the action service.

Parameters
context The application context.
actionsPayload Actions payload.
situation The action situation.
metadata The action metadata.

public static void runActionsPayload (Context context, String payload, Situation situation, PushMessage message)

This method is deprecated.
Marked to be removed in 7.0.0. Use runActions(Context, String, Situation, Bundle) instead.

Convenience method for running actions in the action service with added PushMessage metadata.

Parameters
context The application context.
payload Actions payload.
situation The current situation.
message The push message that triggered the actions.

public static void runActionsPayload (Context context, String payload, Situation situation)

This method is deprecated.
Marked to be removed in 7.0.0. Use runActions(Context, String, Situation, Bundle) instead.

Convenience method for running actions in the action service.

Parameters
context The application context.
payload Actions payload.
situation The current situation.