public class DefaultPushNotificationMessage extends Object implements Serializable
| Constructor and Description |
|---|
DefaultPushNotificationMessage() |
| Modifier and Type | Method and Description |
|---|---|
DefaultPushNotificationMessage |
addDataEntry(String key,
String value)
The data payload used for a silent push.
|
DefaultPushNotificationMessage |
addSubstitutionsEntry(String key,
List<String> value)
Default message substitutions.
|
DefaultPushNotificationMessage |
clearDataEntries()
Removes all the entries added into Data.
|
DefaultPushNotificationMessage |
clearSubstitutionsEntries()
Removes all the entries added into Substitutions.
|
boolean |
equals(Object obj) |
String |
getAction()
The action that occurs if the user taps a push notification delivered by
the campaign: OPEN_APP - Your app launches, or it becomes the foreground
app if it has been sent to the background.
|
String |
getBody()
The message body of the notification.
|
Map<String,String> |
getData()
The data payload used for a silent push.
|
Boolean |
getSilentPush()
Indicates if the message should display on the recipient's device.
|
Map<String,List<String>> |
getSubstitutions()
Default message substitutions.
|
String |
getTitle()
The message title that displays above the message on the user's device.
|
String |
getUrl()
The URL to open in the user's mobile browser.
|
int |
hashCode() |
Boolean |
isSilentPush()
Indicates if the message should display on the recipient's device.
|
void |
setAction(Action action)
The action that occurs if the user taps a push notification delivered by
the campaign: OPEN_APP - Your app launches, or it becomes the foreground
app if it has been sent to the background.
|
void |
setAction(String action)
The action that occurs if the user taps a push notification delivered by
the campaign: OPEN_APP - Your app launches, or it becomes the foreground
app if it has been sent to the background.
|
void |
setBody(String body)
The message body of the notification.
|
void |
setData(Map<String,String> data)
The data payload used for a silent push.
|
void |
setSilentPush(Boolean silentPush)
Indicates if the message should display on the recipient's device.
|
void |
setSubstitutions(Map<String,List<String>> substitutions)
Default message substitutions.
|
void |
setTitle(String title)
The message title that displays above the message on the user's device.
|
void |
setUrl(String url)
The URL to open in the user's mobile browser.
|
String |
toString()
Returns a string representation of this object; useful for testing and
debugging.
|
DefaultPushNotificationMessage |
withAction(Action action)
The action that occurs if the user taps a push notification delivered by
the campaign: OPEN_APP - Your app launches, or it becomes the foreground
app if it has been sent to the background.
|
DefaultPushNotificationMessage |
withAction(String action)
The action that occurs if the user taps a push notification delivered by
the campaign: OPEN_APP - Your app launches, or it becomes the foreground
app if it has been sent to the background.
|
DefaultPushNotificationMessage |
withBody(String body)
The message body of the notification.
|
DefaultPushNotificationMessage |
withData(Map<String,String> data)
The data payload used for a silent push.
|
DefaultPushNotificationMessage |
withSilentPush(Boolean silentPush)
Indicates if the message should display on the recipient's device.
|
DefaultPushNotificationMessage |
withSubstitutions(Map<String,List<String>> substitutions)
Default message substitutions.
|
DefaultPushNotificationMessage |
withTitle(String title)
The message title that displays above the message on the user's device.
|
DefaultPushNotificationMessage |
withUrl(String url)
The URL to open in the user's mobile browser.
|
public String getAction()
Constraints:
Allowed Values: OPEN_APP, DEEP_LINK, URL
Actionpublic void setAction(String action)
Constraints:
Allowed Values: OPEN_APP, DEEP_LINK, URL
action - The action that occurs if the user taps a push notification
delivered by the campaign: OPEN_APP - Your app launches, or it
becomes the foreground app if it has been sent to the
background. This is the default action. DEEP_LINK - Uses deep
linking features in iOS and Android to open your app and
display a designated user interface within the app. URL - The
default mobile browser on the user's device launches and opens
a web page at the URL you specify. Possible values include:
OPEN_APP | DEEP_LINK | URLActionpublic DefaultPushNotificationMessage withAction(String action)
Returns a reference to this object so that method calls can be chained together.
Constraints:
Allowed Values: OPEN_APP, DEEP_LINK, URL
action - The action that occurs if the user taps a push notification
delivered by the campaign: OPEN_APP - Your app launches, or it
becomes the foreground app if it has been sent to the
background. This is the default action. DEEP_LINK - Uses deep
linking features in iOS and Android to open your app and
display a designated user interface within the app. URL - The
default mobile browser on the user's device launches and opens
a web page at the URL you specify. Possible values include:
OPEN_APP | DEEP_LINK | URLActionpublic void setAction(Action action)
Constraints:
Allowed Values: OPEN_APP, DEEP_LINK, URL
action - The action that occurs if the user taps a push notification
delivered by the campaign: OPEN_APP - Your app launches, or it
becomes the foreground app if it has been sent to the
background. This is the default action. DEEP_LINK - Uses deep
linking features in iOS and Android to open your app and
display a designated user interface within the app. URL - The
default mobile browser on the user's device launches and opens
a web page at the URL you specify. Possible values include:
OPEN_APP | DEEP_LINK | URLActionpublic DefaultPushNotificationMessage withAction(Action action)
Returns a reference to this object so that method calls can be chained together.
Constraints:
Allowed Values: OPEN_APP, DEEP_LINK, URL
action - The action that occurs if the user taps a push notification
delivered by the campaign: OPEN_APP - Your app launches, or it
becomes the foreground app if it has been sent to the
background. This is the default action. DEEP_LINK - Uses deep
linking features in iOS and Android to open your app and
display a designated user interface within the app. URL - The
default mobile browser on the user's device launches and opens
a web page at the URL you specify. Possible values include:
OPEN_APP | DEEP_LINK | URLActionpublic String getBody()
public void setBody(String body)
body - The message body of the notification.public DefaultPushNotificationMessage withBody(String body)
Returns a reference to this object so that method calls can be chained together.
body - The message body of the notification.public Map<String,String> getData()
public void setData(Map<String,String> data)
data - The data payload used for a silent push. This payload is
added to the notifications' data.pinpoint.jsonBody' objectpublic DefaultPushNotificationMessage withData(Map<String,String> data)
Returns a reference to this object so that method calls can be chained together.
data - The data payload used for a silent push. This payload is
added to the notifications' data.pinpoint.jsonBody' objectpublic DefaultPushNotificationMessage addDataEntry(String key, String value)
The method adds a new key-value pair into Data parameter, and returns a reference to this object so that method calls can be chained together.
key - The key of the entry to be added into Data.value - The corresponding value of the entry to be added into Data.public DefaultPushNotificationMessage clearDataEntries()
Returns a reference to this object so that method calls can be chained together.
public Boolean isSilentPush()
public Boolean getSilentPush()
public void setSilentPush(Boolean silentPush)
silentPush - Indicates if the message should display on the
recipient's device. You can use silent pushes for remote
configuration or to deliver messages to in-app notification
centers.public DefaultPushNotificationMessage withSilentPush(Boolean silentPush)
Returns a reference to this object so that method calls can be chained together.
silentPush - Indicates if the message should display on the
recipient's device. You can use silent pushes for remote
configuration or to deliver messages to in-app notification
centers.public Map<String,List<String>> getSubstitutions()
public void setSubstitutions(Map<String,List<String>> substitutions)
substitutions - Default message substitutions. Can be overridden by
individual address substitutions.public DefaultPushNotificationMessage withSubstitutions(Map<String,List<String>> substitutions)
Returns a reference to this object so that method calls can be chained together.
substitutions - Default message substitutions. Can be overridden by
individual address substitutions.public DefaultPushNotificationMessage addSubstitutionsEntry(String key, List<String> value)
The method adds a new key-value pair into Substitutions parameter, and returns a reference to this object so that method calls can be chained together.
key - The key of the entry to be added into Substitutions.value - The corresponding value of the entry to be added into
Substitutions.public DefaultPushNotificationMessage clearSubstitutionsEntries()
Returns a reference to this object so that method calls can be chained together.
public String getTitle()
public void setTitle(String title)
title - The message title that displays above the message on the
user's device.public DefaultPushNotificationMessage withTitle(String title)
Returns a reference to this object so that method calls can be chained together.
title - The message title that displays above the message on the
user's device.public String getUrl()
public void setUrl(String url)
url - The URL to open in the user's mobile browser. Used if the
value for Action is URL.public DefaultPushNotificationMessage withUrl(String url)
Returns a reference to this object so that method calls can be chained together.
url - The URL to open in the user's mobile browser. Used if the
value for Action is URL.public String toString()
toString in class ObjectObject.toString()Copyright © 2019. All rights reserved.