A remote Firebase Message.
Messages will be received via
FirebaseMessagingService.onMessageReceived(RemoteMessage)
and can be sent via
FirebaseMessaging.send(RemoteMessage)
.
Messages may have a RemoteMessage.Notification
instance if they are received while the application is in the foreground, otherwise they will
be automatically posted to the notification tray.
Use the RemoteMessage.Builder
class for building message instances to send via
FirebaseMessaging.send(RemoteMessage)
.
Nested Class Summary
class | RemoteMessage.Builder | Builder object for constructing RemoteMessage
instances. |
|
@interface | RemoteMessage.MessagePriority | Priority of the message | |
class | RemoteMessage.Notification | Remote Firebase notification details. |
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.
|
Map<String, String> |
getData()
Gets the message payload data.
|
String |
getFrom()
Get the sender of this message.
|
String |
getMessageId()
Gets the message's ID.
|
String |
getMessageType()
Gets the type of message.
|
RemoteMessage.Notification |
getNotification()
Gets the notification data from the message if set.
|
int |
getOriginalPriority()
Gets the original priority of message.
|
int |
getPriority()
Gets the priority of message as delivered.
|
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
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 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 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 RemoteMessage.Notification getNotification ()
Gets the notification data from the message if set.
This field will be non-null if a notification message is received while the application is in the foreground.
Returns
- The message notification or null.
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 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.
- For upstream messages, this will be of the form
SENDER_ID@gcm.googleapis.com
. - For downstream messages, this will be the Firebase installations ID (FID).
public int getTtl ()
Gets the message time to live (TTL) in seconds.
Returns
- The message TTL