public class

InAppMessage

extends Object
implements Parcelable JsonSerializable
java.lang.Object
   ↳ com.urbanairship.push.iam.InAppMessage

Class Overview

In-app message model object.

Summary

Nested Classes
class InAppMessage.Builder InAppMessage Builder. 
@interface InAppMessage.Position  
Constants
int POSITION_BOTTOM Display the message on bottom of the screen.
int POSITION_TOP Display the message on top of the screen.
[Expand]
Inherited Constants
From interface android.os.Parcelable
Fields
public static final Creator<InAppMessage> CREATOR InAppMessage parcel creator.
Public Methods
int describeContents()
boolean equals(Object o)
String getAlert()
Returns the message's alert.
Map<StringActionValue> getButtonActionValues(String buttonId)
Returns the specified button's action name to action value map.
String getButtonGroupId()
Returns the button group ID.
Map<StringActionValue> getClickActionValues()
Returns the on click action name to action value map.
Long getDuration()
Returns the duration in milliseconds for how long the message should be shown.
long getExpiry()
Returns the expiration time in milliseconds since Jan.
JsonMap getExtras()
Returns extras map.
String getId()
Returns the message's ID
int getPosition()
Returns the position of the in-app message.
Integer getPrimaryColor()
Returns the message's primary color.
Integer getSecondaryColor()
Returns the message's secondary color.
int hashCode()
boolean isExpired()
Tests if the message is expired or not.
static InAppMessage parseJson(String json)
Creates an in-app message from a JSON payload.
JsonValue toJsonValue()
Returns the objects represented as a JsonValue.
void writeToParcel(Parcel dest, int flags)
[Expand]
Inherited Methods
From class java.lang.Object
From interface android.os.Parcelable
From interface com.urbanairship.json.JsonSerializable

Constants

public static final int POSITION_BOTTOM

Display the message on bottom of the screen.

Constant Value: 0 (0x00000000)

public static final int POSITION_TOP

Display the message on top of the screen.

Constant Value: 1 (0x00000001)

Fields

public static final Creator<InAppMessage> CREATOR

InAppMessage parcel creator.

Public Methods

public int describeContents ()

public boolean equals (Object o)

public String getAlert ()

Returns the message's alert.

Returns
  • The message's alert.

public Map<StringActionValue> getButtonActionValues (String buttonId)

Returns the specified button's action name to action value map.

Returns
  • The button's action values.

public String getButtonGroupId ()

Returns the button group ID. The button group can be fetched from getNotificationActionGroup(String)

Returns
  • The button group ID.

public Map<StringActionValue> getClickActionValues ()

Returns the on click action name to action value map.

Returns
  • The on click action values.

public Long getDuration ()

Returns the duration in milliseconds for how long the message should be shown.

Returns
  • The duration of the message in milliseconds.

public long getExpiry ()

Returns the expiration time in milliseconds since Jan. 1, 1970, midnight GMT.

Returns
  • The expiration time in milliseconds since Jan. 1, 1970, midnight GMT.

public JsonMap getExtras ()

Returns extras map.

Returns
  • The extras map.

public String getId ()

Returns the message's ID

Returns
  • The message's ID.

public int getPosition ()

Returns the position of the in-app message. Either POSITION_BOTTOM or POSITION_TOP.

Returns
  • The message's position.

public Integer getPrimaryColor ()

Returns the message's primary color.

Returns
  • The message's primary color.

public Integer getSecondaryColor ()

Returns the message's secondary color.

Returns
  • The message's secondary color.

public int hashCode ()

public boolean isExpired ()

Tests if the message is expired or not.

Returns
  • true if the message is expired, otherwise false.

public static InAppMessage parseJson (String json)

Creates an in-app message from a JSON payload.

Parameters
json The json payload.
Returns
  • The in-app message, or null if the payload defines an invalid in-app message.
Throws
JsonException If the JSON payload is unable to parsed.

public JsonValue toJsonValue ()

Returns the objects represented as a JsonValue.

Returns
  • The object as a JsonValue.

public void writeToParcel (Parcel dest, int flags)