java.lang.Object | |
↳ | com.urbanairship.push.PushMessage |
A push message, usually created from handling a message intent from either GCM, or another push notification service
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 Airship Push Notification. | |||||||||
String | EXTRA_CATEGORY | The extra key for the category of the notification. | |||||||||
String | EXTRA_DELIVERY_PRIORITY | The extra key for the delivery priority. | |||||||||
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_FOREGROUND_DISPLAY | The extra key to control the notification display in the foreground. | |||||||||
String | EXTRA_ICON | The extra key indicates the name of an icon to use from an app's drawable resources. | |||||||||
String | EXTRA_ICON_COLOR | The extra key indicates the icon color. | |||||||||
String | EXTRA_INTERACTIVE_ACTIONS | The extra key for the payload of 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 the legacy in-app message payload. | |||||||||
String | EXTRA_LIVE_UPDATE | The Live Update payload. | |||||||||
String | EXTRA_LOCAL_ONLY | The extra key indicates if the notification should only be displayed on the device. | |||||||||
String | EXTRA_METADATA | The push metadata extra holds the encrypted push identifiers sent in an Airship Push Notification. | |||||||||
String | EXTRA_NOTIFICATION_CHANNEL | The extra key for the channel to be used when posting a notification. | |||||||||
String | EXTRA_NOTIFICATION_TAG | The extra key for the tag to be used when posting a notification. | |||||||||
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_RICH_PUSH_ID | The rich push extra that contains the rich push message ID. | |||||||||
String | EXTRA_SEND_ID | The push ID extra holds the unique push ID sent in an Airship Push Notification. | |||||||||
String | EXTRA_SOUND | This constant is deprecated. This setting does not work on Android O+. | |||||||||
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. | |||||||||
String | PRIORITY_HIGH | Constant for the extra EXTRA_DELIVERY_PRIORITY that indicates the push is high priority. |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From interface
android.os.Parcelable
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
PushMessage(Bundle pushBundle)
Create a new PushMessage
| |||||||||||
PushMessage(Map<String, String> data)
Create a new PushMessage
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
boolean |
containsAirshipKeys()
Checks the message for Airship keys.
| ||||||||||
boolean |
containsKey(String key)
Checks if the push message contains a key.
| ||||||||||
int | describeContents() | ||||||||||
boolean | equals(Object o) | ||||||||||
static PushMessage |
fromJsonValue(JsonValue jsonValue)
Creates a push message from a json value.
| ||||||||||
Map<String, ActionValue> |
getActions()
Gets the push message's actions.
| ||||||||||
String |
getAlert()
Gets the notification alert
| ||||||||||
String |
getCanonicalPushId()
Gets the message's canonical push ID
| ||||||||||
String |
getCategory()
Gets the category of the notification.
| ||||||||||
String |
getExtra(String key, String defaultValue)
Gets an extra from the push bundle.
| ||||||||||
String |
getExtra(String key)
Gets an extra from the push bundle.
| ||||||||||
int |
getIcon(Context context, int defaultIcon)
Gets the notification icon image.
| ||||||||||
int |
getIconColor(int defaultColor)
Gets the notification icon color.
| ||||||||||
String |
getInteractiveActionsPayload()
Gets the notification actions payload.
| ||||||||||
String |
getInteractiveNotificationType()
Gets the notification action button type.
| ||||||||||
String |
getLiveUpdatePayload()
Gets the Live Update payload, if present.
| ||||||||||
String |
getMetadata()
Gets the push send metadata.
| ||||||||||
String |
getNotificationChannel(String defaultChannel)
Returns the notification channel that should be used when posting the notification or the
default channel if its not defined.
| ||||||||||
String |
getNotificationChannel()
Returns the notification channel that should be used when posting the notification.
| ||||||||||
String |
getNotificationTag()
Returns the notification tag that should be used when posting the notification.
| ||||||||||
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
| ||||||||||
Uri |
getSound(Context context)
This method is deprecated.
This setting does not work on Android O+. Applications are encouraged to use
NotificationChannelRegistry instead.
| ||||||||||
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.
| ||||||||||
int | hashCode() | ||||||||||
boolean |
isAccengagePush()
Checks if the push is from Accengage or not.
| ||||||||||
boolean |
isAccengageVisiblePush()
Checks if the push is from Accengage and has content or not.
| ||||||||||
boolean |
isAirshipPush()
Checks if the push is from Airship or not.
| ||||||||||
boolean |
isForegroundDisplayable()
Returns if the notification should be displayed or suppressed in the foreground.
| ||||||||||
boolean |
isLocalOnly()
Checks if the notification should only be displayed on the device.
| ||||||||||
boolean |
isRemoteDataUpdate()
Checks if the message is to update remote-data or not.
| ||||||||||
JsonValue |
toJsonValue()
Returns the objects represented as a JsonValue.
| ||||||||||
String | toString() | ||||||||||
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
|
The actions extra key holds the payload of actions to be performed with the push.
The alert extra holds the string sent in the "alert" field of an Airship Push Notification.
The extra key for the category of the notification.
The extra key for the delivery priority.
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.
The extra key to control the notification display in the foreground.
The extra key indicates the name of an icon to use from an app's drawable resources.
The extra key indicates the icon color.
The extra key for the payload of Airship actions to be run when an interactive notification action button is opened.
The extra key for the interactive notification group that will be displayed with a push.
The extra key for the the legacy in-app message payload.
The Live Update payload.
The extra key indicates if the notification should only be displayed on the device.
The push metadata extra holds the encrypted push identifiers sent in an Airship Push Notification. Possible data includes send, push, and group IDs.
The extra key for the channel to be used when posting a notification.
The extra key for the tag to be used when posting a notification.
The extra key for the priority of the notification. Acceptable values range from PRIORITY_MIN (-2) to PRIORITY_MAX (2).
Defaults to 0.
The extra key for the public notification payload.
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.
The rich push extra that contains the rich push message ID.
The push ID extra holds the unique push ID sent in an Airship Push Notification. This is most commonly referred to as the "Send ID" at Airship.
This constant is deprecated.
This setting does not work on Android O+.
The extra key for the sound of the notification.
The extra key for the style of the notification.
The extra key for the summary of the notification.
The extra key for the title of the notification.
The extra key for the notification's visibility in the lockscreen. Acceptable values are: VISIBILITY_PUBLIC (1), VISIBILITY_PRIVATE (0) or VISIBILITY_SECRET (-1).
The extra key for the wearable payload.
Constant for the extra EXTRA_DELIVERY_PRIORITY
that indicates the push is high priority.
Create a new PushMessage
pushBundle | The intent extras for the push |
---|
Create a new PushMessage
data | The push data. |
---|
Checks the message for Airship keys.
true
if the message contains any Airship keys.
Checks if the push message contains a key.
key | The key to check. |
---|
true
if the push message contains a value at the key, otherwise false
.
Creates a push message from a json value.
jsonValue | The json value. |
---|
Gets the push message's actions.
Gets the message's canonical push ID
Gets the category of the notification.
Gets an extra from the push bundle.
key | The extra key. |
---|---|
defaultValue | Default value if the value does not exist. |
Gets an extra from the push bundle.
key | The extra key. |
---|
Gets the notification icon image.
Gets the notification icon color.
Gets the notification actions payload.
Gets the notification action button type.
Gets the Live Update payload, if present.
null
, if not present.
Returns the notification channel that should be used when posting the notification or the default channel if its not defined.
Returns the notification channel that should be used when posting the notification.
null
if the channel is not available.
Returns the notification tag that should be used when posting the notification.
null
if the tag is not available.
Gets the priority of the notification.
Defaults to 0.
Gets the public notification payload.
Returns a bundle of all the push extras
Gets the rich push message ID
This method is deprecated.
This setting does not work on Android O+. Applications are encouraged to use NotificationChannelRegistry
instead.
Gets the sound of the notification.
context | The application context. |
---|
Gets the style payload of the notification.
Gets the summary of the notification.
Gets the title of the notification.
Gets the visibility of the notification for the lockscreen.
Defaults to 1 (VISIBILITY_PUBLIC).
Checks if the push is from Accengage or not.
true
if its from Accengage, otherwise false
.
Checks if the push is from Accengage and has content or not.
true
if its from Accengage and has content, otherwise false
.
Checks if the push is from Airship or not.
true
if its from Airship, otherwise false
.
Returns if the notification should be displayed or suppressed in the foreground.
true
if the notification should display in the foreground, otherwise false
.
Checks if the notification should only be displayed on the device.
true
if the notification should only be displayed on the device,
otherwise false
Defaults to false.
Checks if the message is to update remote-data or not.
true
if the message contains the remote-data key, otherwise false
.
Returns the objects represented as a JsonValue.