java.lang.Object | |
↳ | com.google.firebase.messaging.RemoteMessage.Builder |
Builder object for constructing RemoteMessage
instances.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Sets the destination of the message.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Adds a data key value pair to the message.
| |||||||||||
Build a RemoteMessage instance.
| |||||||||||
Clears the message data.
| |||||||||||
Sets the collapse key of the message.
| |||||||||||
Sets the message data to the contents of
data . | |||||||||||
Sets the messages ID.
| |||||||||||
Sets the type of message.
| |||||||||||
Sets the message time to live in seconds.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Sets the destination of the message.
Parameters | |
---|---|
to |
String : The destination of the message in the format of SENDER_ID@gcm.googleapis.com . The SENDER_ID should be one of the sender IDs used
when calling getToken(String, String) .
|
Adds a data key value pair to the message.
An existing value with the same key will be replaced by the new value.
Parameters | |
---|---|
key |
String |
value |
String |
Returns | |
---|---|
RemoteMessage.Builder |
Sets the collapse key of the message.
A pending message will be replaced by a new message with the same collapse key if it is currently unable to be delivered to the recipient.
Parameters | |
---|---|
collapseKey |
String |
Returns | |
---|---|
RemoteMessage.Builder |
Sets the message data to the contents of data
.
Any existing data will be removed.
Parameters | |
---|---|
data |
Map |
Returns | |
---|---|
RemoteMessage.Builder |
Sets the messages ID.
Parameters | |
---|---|
messageId |
String : ID of the message. This is generated by the application. It must be unique
for each message. This allows error callbacks and debugging.
|
Returns | |
---|---|
RemoteMessage.Builder |
Sets the message time to live in seconds.
If 0, the message send will be attempted immediately and will be dropped if the device is not connected. Otherwise, the message will be queued.
Parameters | |
---|---|
ttl |
int |
Returns | |
---|---|
RemoteMessage.Builder |