java.lang.Object | |
↳ | com.google.firebase.messaging.RemoteMessage |
A remote Firebase Message.
Messages will be received via onMessageReceived(RemoteMessage)
and can be sent via 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 send(RemoteMessage)
.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
RemoteMessage.Builder | Builder object for constructing RemoteMessage instances. |
||||||||||
RemoteMessage.Notification | Remote Firebase notification details. |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Gets the collapse key of the message.
| |||||||||||
Gets the message payload data.
| |||||||||||
Get the sender of this message.
| |||||||||||
Gets the message's ID.
| |||||||||||
Gets the type of message.
| |||||||||||
Gets the notification data from the message if set.
| |||||||||||
Gets the time in milliseconds from the Epoch that the message was sent.
| |||||||||||
Get the message destination.
| |||||||||||
Gets the message time to live (TTL) in seconds.
| |||||||||||
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() |
Gets the collapse key of the message.
Returns | |
---|---|
String |
The collapse key |
Gets the message payload data.
Returns | |
---|---|
Map<String, String> |
A map of the message payload. |
Get the sender of this message.
This will be the sender ID or the topic for topic messages.
Returns | |
---|---|
String |
The message sender |
Gets the message's ID.
This will be the message ID set when sending the message or automatically generated by the server.
Returns | |
---|---|
String |
The message ID |
Gets the type of message.
Returns | |
---|---|
String |
The message type |
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 | |
---|---|
RemoteMessage.Notification |
The message notification or null. |
Gets the time in milliseconds from the Epoch that the message was sent.
Returns | |
---|---|
long |
The time that the message was sent |
Get the message destination.
For upstream messages this will be of the form SENDER_ID@gcm.googleapis.com
.
Returns | |
---|---|
String |
The message destination |
Gets the message time to live (TTL) in seconds.
Returns | |
---|---|
int |
The message TTL |
Parameters | |
---|---|
out |
Parcel |
flags |
int |