Google is committed to advancing racial equity for Black communities. See how.

CloudMessage

public final class CloudMessage extends Object
implements Parcelable

A Cloud Messaging message.

Nested Class Summary

@interface CloudMessage.MessagePriority Priority of the message  

Constant Summary

int PRIORITY_HIGH
int PRIORITY_NORMAL
int PRIORITY_UNKNOWN

Inherited Constant Summary

Public Method Summary

String
getCollapseKey()
Gets the collapse key of the message.
synchronized Map<StringString>
getData()
Gets the message payload data.
String
getFrom()
Get the sender of this message.
Intent
getIntent()
Gets the broadcast Intent that this message was sent through.
String
getMessageId()
Gets the message's ID.
String
getMessageType()
Gets the type of message.
int
getOriginalPriority()
Gets the original priority of message.
int
getPriority()
Gets the priority of message as delivered.
byte[]
getRawData()
Gets the raw data.
String
getSenderId()
Gets the Sender ID for the sender of this message.
long
getSentTime()
Gets the time in milliseconds from the Epoch that the message was sent.
String
getTo()
Gets the message destination.
int
getTtl()
Gets the message time to live (TTL) in seconds.
void
writeToParcel(Parcel out, int flags)

Inherited Method Summary

Constants

public static final int PRIORITY_HIGH

Constant Value: 1

public static final int PRIORITY_NORMAL

Constant Value: 2

public static final int PRIORITY_UNKNOWN

Constant Value: 0

Public Methods

public String getCollapseKey ()

Gets the collapse key of the message.

Returns
  • The collapse key

public synchronized Map<StringString> 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 will be the message ID set when sending the message or automatically generated by the server.

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

public void writeToParcel (Parcel out, int flags)