MulticastMessage.Builder

public static class MulticastMessage.Builder extends Object

Public Method Summary

MulticastMessage.Builder
addAllTokens(Collection<String> tokens)
Adds a collection of tokens to which the message should be sent.
MulticastMessage.Builder
addToken(String token)
Adds a token to which the message should be sent.
MulticastMessage
build()
Creates a new MulticastMessage instance from the parameters set on this builder.
MulticastMessage.Builder
putAllData(Map<String, String> map)
Adds all the key-value pairs in the given map to the message as data fields.
MulticastMessage.Builder
putData(String key, String value)
Adds the given key-value pair to the message as a data field.
MulticastMessage.Builder
setAndroidConfig(AndroidConfig androidConfig)
Sets the Android-specific information to be included in the message.
MulticastMessage.Builder
setApnsConfig(ApnsConfig apnsConfig)
Sets the information specific to APNS (Apple Push Notification Service).
MulticastMessage.Builder
setFcmOptions(FcmOptions fcmOptions)
Sets the FcmOptions, which can be overridden by the platform-specific fcm_options fields.
MulticastMessage.Builder
setNotification(Notification notification)
Sets the notification information to be included in the message.
MulticastMessage.Builder
setWebpushConfig(WebpushConfig webpushConfig)
Sets the Webpush-specific information to be included in the message.

Inherited Method Summary

Public Methods

public MulticastMessage.Builder addAllTokens (Collection<String> tokens)

Adds a collection of tokens to which the message should be sent. Up to 500 tokens can be specified on a single instance of MulticastMessage.

Parameters
tokens Collection of Firebase device registration tokens.
Returns
  • This builder.

public MulticastMessage.Builder addToken (String token)

Adds a token to which the message should be sent. Up to 500 tokens can be specified on a single instance of MulticastMessage.

Parameters
token A non-null, non-empty Firebase device registration token.
Returns
  • This builder.

public MulticastMessage build ()

Creates a new MulticastMessage instance from the parameters set on this builder.

Returns
Throws
IllegalArgumentException If any of the parameters set on the builder are invalid.

public MulticastMessage.Builder putAllData (Map<String, String> map)

Adds all the key-value pairs in the given map to the message as data fields. None of the keys or values may be null.

Parameters
map A non-null map of data fields. Map must not contain null keys or values.
Returns
  • This builder.

public MulticastMessage.Builder putData (String key, String value)

Adds the given key-value pair to the message as a data field. Key or the value may not be null.

Parameters
key Name of the data field. Must not be null.
value Value of the data field. Must not be null.
Returns
  • This builder.

public MulticastMessage.Builder setAndroidConfig (AndroidConfig androidConfig)

Sets the Android-specific information to be included in the message.

Parameters
androidConfig An AndroidConfig instance.
Returns
  • This builder.

public MulticastMessage.Builder setApnsConfig (ApnsConfig apnsConfig)

Sets the information specific to APNS (Apple Push Notification Service).

Parameters
apnsConfig An ApnsConfig instance.
Returns
  • This builder.

public MulticastMessage.Builder setFcmOptions (FcmOptions fcmOptions)

Sets the FcmOptions, which can be overridden by the platform-specific fcm_options fields.

public MulticastMessage.Builder setNotification (Notification notification)

Sets the notification information to be included in the message.

Parameters
notification A Notification instance.
Returns
  • This builder.

public MulticastMessage.Builder setWebpushConfig (WebpushConfig webpushConfig)

Sets the Webpush-specific information to be included in the message.

Parameters
webpushConfig A WebpushConfig instance.
Returns
  • This builder.