Class FcmSendMessageNotification.Builder
- java.lang.Object
-
- com.mongodb.stitch.core.services.fcm.FcmSendMessageNotification.Builder
-
- Enclosing class:
- FcmSendMessageNotification
public static class FcmSendMessageNotification.Builder extends Object
A builder that can buildFcmSendMessageRequest
s.
-
-
Constructor Summary
Constructors Constructor Description Builder()
Constructs a new builder for an FCM send message request.
-
Method Summary
Modifier and Type Method Description FcmSendMessageNotification
build()
Builds, validates, and returns theFcmSendMessageNotification
.FcmSendMessageNotification.Builder
withBadge(String badge)
Sets the value of the badge on the home screen app icon.FcmSendMessageNotification.Builder
withBody(String body)
Sets the notification's body text.FcmSendMessageNotification.Builder
withBodyLocArgs(String bodyLocArgs)
Sets the variable string values to be used in place of the format specifiers in bodyLocKey to use to localize the body text to the user's current localization.FcmSendMessageNotification.Builder
withBodyLocKey(String bodyLocKey)
Sets the key to the body string in the app's string resources to use to localize the body text to the user's current localization.FcmSendMessageNotification.Builder
withClickAction(String clickAction)
Sets the action associated with a user click on the notification.FcmSendMessageNotification.Builder
withColor(String color)
Sets the notification's icon color, expressed in #rrggbb format.FcmSendMessageNotification.Builder
withIcon(String icon)
Sets the notification's icon.FcmSendMessageNotification.Builder
withSound(String sound)
Sets the sound to play when the device receives the notification.FcmSendMessageNotification.Builder
withTag(String tag)
Sets the identifier used to replace existing notifications in the notification drawer.FcmSendMessageNotification.Builder
withTitle(String title)
Sets the notification's title.FcmSendMessageNotification.Builder
withTitleLocArgs(String titleLocArgs)
Sets the variable string values to be used in place of the format specifiers in titleLocKey to use to localize the title text to the user's current localization.FcmSendMessageNotification.Builder
withTitleLocKey(String titleLocKey)
Sets the key to the title string in the app's string resources to use to localize the title text to the user's current localization.
-
-
-
Method Detail
-
withTitle
public FcmSendMessageNotification.Builder withTitle(@Nonnull String title)
Sets the notification's title.- Parameters:
title
- the notification's title.- Returns:
- the builder.
-
withBody
public FcmSendMessageNotification.Builder withBody(@Nonnull String body)
Sets the notification's body text.- Parameters:
body
- the notification's body text.- Returns:
- the builder.
-
withSound
public FcmSendMessageNotification.Builder withSound(@Nonnull String sound)
Sets the sound to play when the device receives the notification.- Parameters:
sound
- the sound to play when the device receives the notification.- Returns:
- the builder.
-
withClickAction
public FcmSendMessageNotification.Builder withClickAction(@Nonnull String clickAction)
Sets the action associated with a user click on the notification.- Parameters:
clickAction
- the action associated with a user click on the notification.- Returns:
- the builder.
-
withBodyLocKey
public FcmSendMessageNotification.Builder withBodyLocKey(@Nonnull String bodyLocKey)
Sets the key to the body string in the app's string resources to use to localize the body text to the user's current localization.- Parameters:
bodyLocKey
- the key to the body string in the app's string resources to use to localize the body text to the user's current localization.- Returns:
- the builder.
-
withBodyLocArgs
public FcmSendMessageNotification.Builder withBodyLocArgs(@Nonnull String bodyLocArgs)
Sets the variable string values to be used in place of the format specifiers in bodyLocKey to use to localize the body text to the user's current localization.- Parameters:
bodyLocArgs
- the variable string values to be used in place of the format specifiers in bodyLocKey to use to localize the body text to the user's current localization.- Returns:
- the builder.
-
withTitleLocKey
public FcmSendMessageNotification.Builder withTitleLocKey(@Nonnull String titleLocKey)
Sets the key to the title string in the app's string resources to use to localize the title text to the user's current localization.- Parameters:
titleLocKey
- the key to the title string in the app's string resources to use to localize the title text to the user's current localization.- Returns:
- the builder.
-
withTitleLocArgs
public FcmSendMessageNotification.Builder withTitleLocArgs(@Nonnull String titleLocArgs)
Sets the variable string values to be used in place of the format specifiers in titleLocKey to use to localize the title text to the user's current localization.- Parameters:
titleLocArgs
- the variable string values to be used in place of the format specifiers in titleLocKey to use to localize the title text to the user's current localization.- Returns:
- the builder.
-
withIcon
public FcmSendMessageNotification.Builder withIcon(@Nonnull String icon)
Sets the notification's icon. Note: for messages to Android devices only.- Parameters:
icon
- the notification's icon.- Returns:
- the builder.
-
withTag
public FcmSendMessageNotification.Builder withTag(@Nonnull String tag)
Sets the identifier used to replace existing notifications in the notification drawer. Note: for messages to Android devices only.- Parameters:
tag
- the identifier used to replace existing notifications in the notification drawer.- Returns:
- the builder.
-
withColor
public FcmSendMessageNotification.Builder withColor(@Nonnull String color)
Sets the notification's icon color, expressed in #rrggbb format. Note: for messages to Android devices only.- Parameters:
color
- the notification's icon color, expressed in #rrggbb format.- Returns:
- the builder.
-
withBadge
public FcmSendMessageNotification.Builder withBadge(@Nonnull String badge)
Sets the value of the badge on the home screen app icon. Note: iOS only.- Parameters:
badge
- the value of the badge on the home screen app icon.- Returns:
- the builder.
-
build
public FcmSendMessageNotification build()
Builds, validates, and returns theFcmSendMessageNotification
.- Returns:
- the built notification.
-
-