Public Method Summary
Aps | |
Aps.Builder |
putAllCustomData(Map<String, Object> fields)
Puts all the key-value pairs in the specified map to the aps dictionary.
|
Aps.Builder |
putCustomData(String key, Object value)
Puts a custom key-value pair to the aps dictionary.
|
Aps.Builder | |
Aps.Builder |
setAlert(String alert)
Sets the alert field as a string.
|
Aps.Builder |
setBadge(int badge)
Sets the badge to be displayed with the message.
|
Aps.Builder |
setCategory(String category)
Sets the notification type.
|
Aps.Builder |
setContentAvailable(boolean contentAvailable)
Specifies whether to configure a background update notification.
|
Aps.Builder |
setMutableContent(boolean mutableContent)
Specifies whether to set the
mutable-content property on the message. |
Aps.Builder |
setSound(String sound)
Sets the sound to be played with the message.
|
Aps.Builder | |
Aps.Builder |
setThreadId(String threadId)
Sets an app-specific identifier for grouping notifications.
|
Inherited Method Summary
Public Methods
public Aps build ()
public Aps.Builder putAllCustomData (Map<String, Object> fields)
Puts all the key-value pairs in the specified map to the aps dictionary.
Parameters
fields | A non-null map. Map must not contain null keys or values. |
---|
Returns
- This builder.
public Aps.Builder putCustomData (String key, Object value)
Puts a custom key-value pair to the aps dictionary.
Parameters
key | A non-null key. |
---|---|
value | A non-null, json-serializable value. |
Returns
- This builder.
public Aps.Builder setAlert (ApsAlert alert)
public Aps.Builder setAlert (String alert)
Sets the alert field as a string.
Parameters
alert | A string alert. |
---|
Returns
- This builder.
public Aps.Builder setBadge (int badge)
Sets the badge to be displayed with the message. Set to 0 to remove the badge. When not invoked, the badge will remain unchanged.
Parameters
badge | An integer representing the badge. |
---|
Returns
- This builder.
public Aps.Builder setCategory (String category)
Sets the notification type.
Parameters
category | A string identifier. |
---|
Returns
- This builder.
public Aps.Builder setContentAvailable (boolean contentAvailable)
Specifies whether to configure a background update notification.
Parameters
contentAvailable | True to perform a background update. |
---|
Returns
- This builder.
public Aps.Builder setMutableContent (boolean mutableContent)
Specifies whether to set the mutable-content
property on the message. When set, this
property allows clients to modify the notification via app extensions.
Parameters
mutableContent | True to make the content mutable via app extensions. |
---|
Returns
- This builder.
public Aps.Builder setSound (String sound)
Sets the sound to be played with the message. For critical alerts use the
setSound(CriticalSound)
method.
Parameters
sound | Sound file name or "default" . |
---|
Returns
- This builder.
public Aps.Builder setSound (CriticalSound sound)
Sets the critical alert sound to be played with the message.
Parameters
sound | A CriticalSound instance containing the alert sound configuration. |
---|
Returns
- This builder.
public Aps.Builder setThreadId (String threadId)
Sets an app-specific identifier for grouping notifications.
Parameters
threadId | A string identifier. |
---|
Returns
- This builder.