Class FcmSendMessageNotification.Builder

    • Constructor Detail

      • Builder

        public Builder()
        Constructs a new builder for an FCM send message request.
    • Method Detail

      • 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.
      • 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.