public class

PushMessage

extends Object
implements Parcelable
java.lang.Object
   ↳ com.urbanairship.push.PushMessage

Class Overview

A push message, usually created from handling a message intent from either GCM, or another push notification service

Summary

Constants
String EXTRA_ACTIONS The actions extra key holds the payload of actions to be performed with the push.
String EXTRA_ALERT The alert extra holds the string sent in the "alert" field of an Urban Airship Push Notification.
String EXTRA_CATEGORY The extra key for the category of the notification.
String EXTRA_EXPIRATION The EXPIRATION extra is a time expressed in seconds since the Epoch after which, if specified, the notification should not be delivered.
String EXTRA_INTERACTIVE_ACTIONS The extra key for the payload of Urban Airship actions to be run when an interactive notification action button is opened.
String EXTRA_INTERACTIVE_TYPE The extra key for the interactive notification group that will be displayed with a push.
String EXTRA_IN_APP_MESSAGE The extra key for the InAppMessage payload.
String EXTRA_LOCAL_ONLY The extra key indicates if the notification should only be displayed on the device.
String EXTRA_PRIORITY The extra key for the priority of the notification.
String EXTRA_PUBLIC_NOTIFICATION The extra key for the public notification payload.
String EXTRA_PUSH_ID The push ID extra is the ID assigned to a push at the time it is sent.
String EXTRA_SEND_ID The push ID extra holds the unique push ID sent in an Urban Airship Push Notification.
String EXTRA_STYLE The extra key for the style of the notification.
String EXTRA_SUMMARY The extra key for the summary of the notification.
String EXTRA_TITLE The extra key for the title of the notification.
String EXTRA_VISIBILITY The extra key for the notification's visibility in the lockscreen.
String EXTRA_WEARABLE The extra key for the wearable payload.
[Expand]
Inherited Constants
From interface android.os.Parcelable
Fields
public static final Creator<PushMessage> CREATOR Parcel Creator for push messages.
Public Constructors
PushMessage(Bundle pushBundle)
Create a new PushMessage
Public Methods
int describeContents()
Map<StringActionValue> getActions()
Gets the push message's actions.
String getActionsPayload()
This method is deprecated. Marked to be remove in 7.0.0. Use getActions() instead.
String getAlert()
Gets the notification alert
String getCanonicalPushId()
Gets the message's canonical push ID
String getCategory()
Gets the category of the notification.
InAppMessage getInAppMessage()
Gets the InAppMessage from the push bundle.
String getInteractiveActionsPayload()
Gets the notification actions payload.
String getInteractiveNotificationType()
Gets the notification action button type.
int getPriority()
Gets the priority of the notification.
String getPublicNotificationPayload()
Gets the public notification payload.
Bundle getPushBundle()
Returns a bundle of all the push extras
String getRichPushMessageId()
Gets the rich push message ID
String getSendId()
Gets the push send ID
String getStylePayload()
Gets the style payload of the notification.
String getSummary()
Gets the summary of the notification.
String getTitle()
Gets the title of the notification.
int getVisibility()
Gets the visibility of the notification for the lockscreen.
String getWearablePayload()
Gets the wearable payload.
boolean isLocalOnly()
Checks if the notification should only be displayed on the device.
String toString()
void writeToParcel(Parcel dest, int flags)
[Expand]
Inherited Methods
From class java.lang.Object
From interface android.os.Parcelable

Constants

public static final String EXTRA_ACTIONS

The actions extra key holds the payload of actions to be performed with the push.

Constant Value: "com.urbanairship.actions"

public static final String EXTRA_ALERT

The alert extra holds the string sent in the "alert" field of an Urban Airship Push Notification.

Constant Value: "com.urbanairship.push.ALERT"

public static final String EXTRA_CATEGORY

The extra key for the category of the notification.

Constant Value: "com.urbanairship.category"

public static final String EXTRA_EXPIRATION

The EXPIRATION extra is a time expressed in seconds since the Epoch after which, if specified, the notification should not be delivered. It is removed from the notification before delivery to the client. If not present, notifications may be delivered arbitrarily late.

Constant Value: "com.urbanairship.push.EXPIRATION"

public static final String EXTRA_INTERACTIVE_ACTIONS

The extra key for the payload of Urban Airship actions to be run when an interactive notification action button is opened.

Constant Value: "com.urbanairship.interactive_actions"

public static final String EXTRA_INTERACTIVE_TYPE

The extra key for the interactive notification group that will be displayed with a push.

Constant Value: "com.urbanairship.interactive_type"

public static final String EXTRA_IN_APP_MESSAGE

The extra key for the InAppMessage payload.

Constant Value: "com.urbanairship.in_app"

public static final String EXTRA_LOCAL_ONLY

The extra key indicates if the notification should only be displayed on the device.

Constant Value: "com.urbanairship.local_only"

public static final String EXTRA_PRIORITY

The extra key for the priority of the notification. Acceptable values range from PRIORITY_MIN (-2) to PRIORITY_MAX (2).

Defaults to 0.

Constant Value: "com.urbanairship.priority"

public static final String EXTRA_PUBLIC_NOTIFICATION

The extra key for the public notification payload.

Constant Value: "com.urbanairship.public_notification"

public static final String EXTRA_PUSH_ID

The push ID extra is the ID assigned to a push at the time it is sent. Each API call will result in a unique push ID, so all notifications that are part of a multicast push will have the same push ID.

Constant Value: "com.urbanairship.push.CANONICAL_PUSH_ID"

public static final String EXTRA_SEND_ID

The push ID extra holds the unique push ID sent in an Urban Airship Push Notification. This is most commonly referred to as the "Send ID" at Urban Airship.

Constant Value: "com.urbanairship.push.PUSH_ID"

public static final String EXTRA_STYLE

The extra key for the style of the notification.

Constant Value: "com.urbanairship.style"

public static final String EXTRA_SUMMARY

The extra key for the summary of the notification.

Constant Value: "com.urbanairship.summary"

public static final String EXTRA_TITLE

The extra key for the title of the notification.

Constant Value: "com.urbanairship.title"

public static final String EXTRA_VISIBILITY

The extra key for the notification's visibility in the lockscreen. Acceptable values are: VISIBILITY_PUBLIC (1), VISIBILITY_PRIVATE (0) or VISIBILITY_SECRET (-1).

Constant Value: "com.urbanairship.visibility"

public static final String EXTRA_WEARABLE

The extra key for the wearable payload.

Constant Value: "com.urbanairship.wearable"

Fields

public static final Creator<PushMessage> CREATOR

Parcel Creator for push messages.

Public Constructors

public PushMessage (Bundle pushBundle)

Create a new PushMessage

Parameters
pushBundle The intent extras for the push

Public Methods

public int describeContents ()

public Map<StringActionValue> getActions ()

Gets the push message's actions.

Returns
  • A map of action name to action value.

public String getActionsPayload ()

This method is deprecated.
Marked to be remove in 7.0.0. Use getActions() instead.

Gets the actions payload that runs when the message is received or opened.

Returns
  • The actions payload.

public String getAlert ()

Gets the notification alert

Returns
  • The notification alert.

public String getCanonicalPushId ()

Gets the message's canonical push ID

Returns
  • The canonical push ID

public String getCategory ()

Gets the category of the notification.

Returns
  • The category of the notification.

public InAppMessage getInAppMessage ()

Gets the InAppMessage from the push bundle.

Returns
  • The in-app message.

public String getInteractiveActionsPayload ()

Gets the notification actions payload.

Returns
  • The notification actions payload.

public String getInteractiveNotificationType ()

Gets the notification action button type.

Returns
  • The interactive notification type.

public int getPriority ()

Gets the priority of the notification.

Defaults to 0.

Returns
  • The priority of the notification.

public String getPublicNotificationPayload ()

Gets the public notification payload.

Returns
  • The public notification payload.

public Bundle getPushBundle ()

Returns a bundle of all the push extras

Returns
  • A bundle of all the push extras

public String getRichPushMessageId ()

Gets the rich push message ID

Returns
  • The rich push message ID, or null if its unavailable.

public String getSendId ()

Gets the push send ID

Returns
  • The push send Id.

public String getStylePayload ()

Gets the style payload of the notification.

Returns
  • The style payload of the notification.

public String getSummary ()

Gets the summary of the notification.

Returns
  • The summary of the notification.

public String getTitle ()

Gets the title of the notification.

Returns
  • The title of the notification.

public int getVisibility ()

Gets the visibility of the notification for the lockscreen.

Defaults to 1 (VISIBILITY_PUBLIC).

Returns
  • The visibility of the notification for the lockscreen.

public String getWearablePayload ()

Gets the wearable payload.

Returns
  • The wearable payload.

public boolean isLocalOnly ()

Checks if the notification should only be displayed on the device.

Returns
  • true if the notification should only be displayed on the device, otherwise false

    Defaults to false.

public String toString ()

public void writeToParcel (Parcel dest, int flags)