AndroidConfig.Builder

public static class AndroidConfig.Builder extends Object

Public Method Summary

AndroidConfig
build()
Creates a new AndroidConfig instance from the parameters set on this builder.
AndroidConfig.Builder
putAllData(Map<String, String> map)
Adds all the key-value pairs in the given map to the message as data fields.
AndroidConfig.Builder
putData(String key, String value)
Adds the given key-value pair to the message as a data field.
AndroidConfig.Builder
setCollapseKey(String collapseKey)
Sets a collapse key for the message.
AndroidConfig.Builder
setNotification(AndroidNotification notification)
Sets the Android notification to be included in the message.
AndroidConfig.Builder
setPriority(AndroidConfig.Priority priority)
Sets the priority of the message.
AndroidConfig.Builder
setRestrictedPackageName(String restrictedPackageName)
Sets the package name of the application where the registration tokens must match in order to receive the message.
AndroidConfig.Builder
setTtl(long ttl)
Sets the time-to-live duration of the message in milliseconds.

Inherited Method Summary

Public Methods

public AndroidConfig build ()

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

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

public AndroidConfig.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 and values may be null. When set, overrides any data fields set on the top-level Message via putData(String, String) and putAllData(Map).

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

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

Adds the given key-value pair to the message as a data field. Key and the value may not be null. When set, overrides any data fields set on the top-level Message via putData(String, String) and putAllData(Map).

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 AndroidConfig.Builder setCollapseKey (String collapseKey)

Sets a collapse key for the message. Collapse key serves as an identifier for a group of messages that can be collapsed, so that only the last message gets sent when delivery can be resumed. A maximum of 4 different collapse keys may be active at any given time.

Parameters
collapseKey A collapse key string.
Returns
  • This builder.

public AndroidConfig.Builder setNotification (AndroidNotification notification)

Sets the Android notification to be included in the message.

Parameters
notification An AndroidNotification instance.
Returns
  • This builder.

public AndroidConfig.Builder setPriority (AndroidConfig.Priority priority)

Sets the priority of the message.

Parameters
priority A value from the AndroidConfig.Priority enum.
Returns
  • This builder.

public AndroidConfig.Builder setRestrictedPackageName (String restrictedPackageName)

Sets the package name of the application where the registration tokens must match in order to receive the message.

Parameters
restrictedPackageName A package name string.
Returns
  • This builder.

public AndroidConfig.Builder setTtl (long ttl)

Sets the time-to-live duration of the message in milliseconds.

Parameters
ttl Time-to-live duration in milliseconds.
Returns
  • This builder.

Send feedback about...

Need help? Visit our support page.