Class FcmSendMessageRequest.Builder
- java.lang.Object
-
- com.mongodb.stitch.core.services.fcm.FcmSendMessageRequest.Builder
-
- Enclosing class:
- FcmSendMessageRequest
public static class FcmSendMessageRequest.Builder extends Object
A builder that can buildFcmSendMessageRequests.
-
-
Constructor Summary
Constructors Constructor Description Builder()Constructs a new builder for an FCM send message request.
-
Method Summary
Modifier and Type Method Description FcmSendMessageRequestbuild()Builds, validates, and returns theFcmSendMessageRequest.FcmSendMessageRequest.BuilderwithCollapseKey(String collapseKey)Sets the group of messages that can be collapsed.FcmSendMessageRequest.BuilderwithContentAvailable(boolean contentAvailable)Sets whether or not to indicate to the client that content is available in order to wake the device.FcmSendMessageRequest.BuilderwithData(Document data)Sets the custom data to send in the payload.FcmSendMessageRequest.BuilderwithMutableContent(boolean mutableContent)Sets whether or not the content in the message can be mutated.FcmSendMessageRequest.BuilderwithNotification(FcmSendMessageNotification notification)Sets the predefined, user-visible key-value pairs of the notification payload.FcmSendMessageRequest.BuilderwithPriority(FcmSendMessagePriority priority)Sets the priority of the message.FcmSendMessageRequest.BuilderwithTimeToLive(long timeToLive)Sets how long (in seconds) the message should be kept in FCM storage if the device is offline.
-
-
-
Method Detail
-
withPriority
public FcmSendMessageRequest.Builder withPriority(@Nonnull FcmSendMessagePriority priority)
Sets the priority of the message.- Parameters:
priority- the priority of the message.- Returns:
- the builder.
-
withCollapseKey
public FcmSendMessageRequest.Builder withCollapseKey(@Nonnull String collapseKey)
Sets the group of messages that can be collapsed.- Parameters:
collapseKey- the group of messages that can be collapsed.- Returns:
- the builder.
-
withContentAvailable
public FcmSendMessageRequest.Builder withContentAvailable(boolean contentAvailable)
Sets whether or not to indicate to the client that content is available in order to wake the device. Note: for messages to iOS devices only.- Parameters:
contentAvailable- whether or not to indicate to the client that content is available in order to wake the device.- Returns:
- the builder.
-
withMutableContent
public FcmSendMessageRequest.Builder withMutableContent(boolean mutableContent)
Sets whether or not the content in the message can be mutated. Note: for messages to iOS devices only.- Parameters:
mutableContent- whether or not the content in the message can be mutated.- Returns:
- the builder.
-
withTimeToLive
public FcmSendMessageRequest.Builder withTimeToLive(long timeToLive)
Sets how long (in seconds) the message should be kept in FCM storage if the device is offline.- Parameters:
timeToLive- how long (in seconds) the message should be kept in FCM storage if the device is offline.- Returns:
- the builder.
-
withData
public FcmSendMessageRequest.Builder withData(@Nonnull Document data)
Sets the custom data to send in the payload.- Parameters:
data- the custom data to send in the payload.- Returns:
- the builder.
-
withNotification
public FcmSendMessageRequest.Builder withNotification(@Nonnull FcmSendMessageNotification notification)
Sets the predefined, user-visible key-value pairs of the notification payload.- Parameters:
notification- the predefined, user-visible key-value pairs of the notification payload.- Returns:
- the builder.
-
build
public FcmSendMessageRequest build()
Builds, validates, and returns theFcmSendMessageRequest.- Returns:
- the built FCM send message request.
-
-