public class

LandingPageAction

extends Action
java.lang.Object
   ↳ com.urbanairship.actions.Action
     ↳ com.urbanairship.actions.LandingPageAction

Class Overview

Action for launching a Landing Page.

The landing page will not be launched in Situation.PUSH_RECEIVED, instead it will be cached if the action is triggered with a payload that sets "cache_on_receive" to true.

Accepted situations: Situation.PUSH_OPENED, Situation.PUSH_RECEIVED, Situation.WEB_VIEW_INVOCATION, Situation.MANUAL_INVOCATION, and Situation.FOREGROUND_NOTIFICATION_ACTION_BUTTON.

Accepted argument value types: URL defined as either a String or a Map containing the key "url" that defines the URL. The map argument value can also define a "cache_on_receive" flag to enable or disable caching when a PUSH_RECEIVED. Caching is disabled by default.

Note: URLs in the format of "u:<content-id>" will be treated as a short url and
 used to construct a separate url using the content id. 

Result value: null

Default Registration Names: ^p, landing_page_action

Default Registration Predicate: Rejects Situation.PUSH_RECEIVED if the application has not been opened in the last week.

Summary

Constants
String CACHE_ON_RECEIVE_KEY The payload key for indicating if the landing page should be cached when triggered in Situation.PUSH_RECEIVED
String DEFAULT_REGISTRY_NAME Default registry name
String DEFAULT_REGISTRY_SHORT_NAME Default registry short name
String SHOW_LANDING_PAGE_INTENT_ACTION Intent action for showing a URL in a UAWebView
String URL_KEY The content's url payload key
Public Constructors
LandingPageAction()
Public Methods
boolean acceptsArguments(ActionArguments arguments)
Checks if the argument's value can be parsed to a URI and if the situation is not Situation.PUSH_RECEIVED.
ActionResult perform(ActionArguments arguments)
Performs the action.
Protected Methods
Uri parseUri(ActionArguments arguments)
Parses the ActionArguments for a landing page URI.
boolean shouldCacheOnReceive(ActionArguments arguments)
Checks if the landing page arguments define whether the landing page should cache on receive.
[Expand]
Inherited Methods
From class com.urbanairship.actions.Action
From class java.lang.Object

Constants

public static final String CACHE_ON_RECEIVE_KEY

The payload key for indicating if the landing page should be cached when triggered in Situation.PUSH_RECEIVED

Constant Value: "cache_on_receive"

public static final String DEFAULT_REGISTRY_NAME

Default registry name

Constant Value: "landing_page_action"

public static final String DEFAULT_REGISTRY_SHORT_NAME

Default registry short name

Constant Value: "^p"

public static final String SHOW_LANDING_PAGE_INTENT_ACTION

Intent action for showing a URL in a UAWebView

Constant Value: "com.urbanairship.actions.SHOW_LANDING_PAGE_INTENT_ACTION"

public static final String URL_KEY

The content's url payload key

Constant Value: "url"

Public Constructors

public LandingPageAction ()

Public Methods

public boolean acceptsArguments (ActionArguments arguments)

Checks if the argument's value can be parsed to a URI and if the situation is not Situation.PUSH_RECEIVED.

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.

Protected Methods

protected Uri parseUri (ActionArguments arguments)

Parses the ActionArguments for a landing page URI.

Parameters
arguments The action arguments.
Returns
  • A landing page Uri, or null if the arguments could not be parsed.

protected boolean shouldCacheOnReceive (ActionArguments arguments)

Checks if the landing page arguments define whether the landing page should cache on receive.

Parameters
arguments The action arguments.
Returns
  • true if the argument's value contains a payload with CACHE_ON_RECEIVE_KEY set to true, otherwise false.