public static class FcmSendMessageRequest.Builder extends Object
FcmSendMessageRequest
s.Constructor and Description |
---|
Builder()
Constructs a new builder for an FCM send message request.
|
Modifier and Type | Method and Description |
---|---|
FcmSendMessageRequest |
build()
Builds, validates, and returns the
FcmSendMessageRequest . |
FcmSendMessageRequest.Builder |
withCollapseKey(String collapseKey)
Sets the group of messages that can be collapsed.
|
FcmSendMessageRequest.Builder |
withContentAvailable(boolean contentAvailable)
Sets whether or not to indicate to the client that content is available in order
to wake the device.
|
FcmSendMessageRequest.Builder |
withData(Document data)
Sets the custom data to send in the payload.
|
FcmSendMessageRequest.Builder |
withMutableContent(boolean mutableContent)
Sets whether or not the content in the message can be mutated.
|
FcmSendMessageRequest.Builder |
withNotification(FcmSendMessageNotification notification)
Sets the predefined, user-visible key-value pairs of the notification payload.
|
FcmSendMessageRequest.Builder |
withPriority(FcmSendMessagePriority priority)
Sets the priority of the message.
|
FcmSendMessageRequest.Builder |
withTimeToLive(long timeToLive)
Sets how long (in seconds) the message should be kept in FCM storage if the device is
offline.
|
public Builder()
public FcmSendMessageRequest.Builder withPriority(@Nonnull FcmSendMessagePriority priority)
priority
- the priority of the message.public FcmSendMessageRequest.Builder withCollapseKey(@Nonnull String collapseKey)
collapseKey
- the group of messages that can be collapsed.public FcmSendMessageRequest.Builder withContentAvailable(boolean contentAvailable)
contentAvailable
- whether or not to indicate to the client that content is available
in order to wake the device.public FcmSendMessageRequest.Builder withMutableContent(boolean mutableContent)
mutableContent
- whether or not the content in the message can be mutated.public FcmSendMessageRequest.Builder withTimeToLive(long timeToLive)
timeToLive
- how long (in seconds) the message should be kept in FCM storage if the
device is offline.public FcmSendMessageRequest.Builder withData(@Nonnull Document data)
data
- the custom data to send in the payload.public FcmSendMessageRequest.Builder withNotification(@Nonnull FcmSendMessageNotification notification)
notification
- the predefined, user-visible key-value pairs of the notification payload.public FcmSendMessageRequest build()
FcmSendMessageRequest
.