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, SITUATION_AUTOMATION, 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, an optional width and height in points as an int or "fill" string, an optional aspectLock option as a boolean. The aspectLock option guarantees that if the message does not fit, it will be resized at the same aspect ratio defined by the provided width and height parameters. The map argument value can also define a "cache_on_receive" flag to enable or disable caching when a SITUATION_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

Nested Classes
class LandingPageAction.LandingPagePredicate Default LandingPageAction predicate. 
Constants
String ASPECT_LOCK_KEY The content's aspectLock payload key
String CACHE_ON_RECEIVE_KEY The payload key for indicating if the landing page should be cached when triggered in Action.SITUATION_PUSH_RECEIVED
String DEFAULT_REGISTRY_NAME Default registry name
String DEFAULT_REGISTRY_SHORT_NAME Default registry short name
String HEIGHT_KEY The content's height payload key
long LANDING_PAGE_CACHE_OPEN_TIME_LIMIT_MS
String SHOW_LANDING_PAGE_INTENT_ACTION Intent action for showing a URL in a UAWebView
String URL_KEY The content's url payload key
String WIDTH_KEY The content's width payload key
[Expand]
Inherited Constants
From class com.urbanairship.actions.Action
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 Action.SITUATION_PUSH_RECEIVED.
ActionResult perform(ActionArguments arguments)
Performs the action.
boolean shouldRunOnMainThread()
Determines which thread runs 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 ASPECT_LOCK_KEY

The content's aspectLock payload key

Constant Value: "aspectLock"

public static final String CACHE_ON_RECEIVE_KEY

The payload key for indicating if the landing page should be cached when triggered in Action.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 HEIGHT_KEY

The content's height payload key

Constant Value: "height"

public static final long LANDING_PAGE_CACHE_OPEN_TIME_LIMIT_MS

Constant Value: 604800000 (0x00000000240c8400)

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 static final String WIDTH_KEY

The content's width payload key

Constant Value: "width"

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 Action.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.

public boolean shouldRunOnMainThread ()

Determines which thread runs the action.

Returns
  • true if the action should be run on the main thread, or false if the action should run on a background thread.

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.