Page Summary
-
CloudMessage is a class representing a Cloud Messaging message that implements the Parcelable interface.
-
It includes information such as collapse key, message data, sender, message ID, type, priority, raw data, sent time, destination, and time to live.
-
The message priority can be HIGH, NORMAL, or UNKNOWN, defined by integer constants.
-
The class provides various public methods to access the different properties of the message.
A Cloud Messaging message.
Nested Class Summary
Constant Summary
| int | PRIORITY_HIGH | * |
| int | PRIORITY_NORMAL | * |
|---|---|---|
| int | PRIORITY_UNKNOWN | * |
Inherited Constant Summary
Public Method Summary
| String | |
| synchronized Map < String , String > | |
| String | |
| Intent | |
| String | |
| String | |
| int | |
| int | |
| byte[] | |
| String | |
| long | |
| String | |
| int | |
| void |
Inherited Method Summary
Constants
public static final int PRIORITY_HIGH
public static final int PRIORITY_NORMAL
public static final int PRIORITY_UNKNOWN
Public Methods
public String getCollapseKey ()
Gets the collapse key of the message.
Returns
- The collapse key
public synchronized Map < String , String > getData ()
Gets the message payload data.
Returns
- A map of the message payload.
public String getFrom ()
Get the sender of this message.
This will be the sender ID or the topic for topic messages.
Returns
- The message sender
public Intent getIntent ()
Gets the broadcast Intent that this message was sent through.
Returns
- the broadcast Intent
public String getMessageId ()
Gets the message's ID.
This is automatically generated by the server. Treat it as an opaque string. Do not rely on its format to be consistent.
Returns
- The message ID
public String getMessageType ()
Gets the type of message.
Returns
- The message type
public int getOriginalPriority ()
Gets the original priority of message.
Returns
- The original message priority
public int getPriority ()
Gets the priority of message as delivered. This may be lower than the priority originally requested.
Returns
- The message priority as delivered
public byte[] getRawData ()
Gets the raw data.
public String getSenderId ()
Gets the Sender ID for the sender of this message.
Returns
- the message Sender ID
public long getSentTime ()
Gets the time in milliseconds from the Epoch that the message was sent.
Returns
- The time that the message was sent
public String getTo ()
Gets the message destination.
Returns
- The message destination
public int getTtl ()
Gets the message time to live (TTL) in seconds.
Returns
- The message TTL

