public class DefaultPushNotificationMessage
extends java.lang.Object
implements java.io.Serializable
Constructor and Description |
---|
DefaultPushNotificationMessage() |
Modifier and Type | Method and Description |
---|---|
DefaultPushNotificationMessage |
addDataEntry(java.lang.String key,
java.lang.String value)
The data payload used for a silent push.
|
DefaultPushNotificationMessage |
addSubstitutionsEntry(java.lang.String key,
java.util.List<java.lang.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(java.lang.Object obj) |
java.lang.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.
|
java.lang.String |
getBody()
The message body of the notification.
|
java.util.Map<java.lang.String,java.lang.String> |
getData()
The data payload used for a silent push.
|
java.lang.Boolean |
getSilentPush()
Indicates if the message should display on the recipient's device.
|
java.util.Map<java.lang.String,java.util.List<java.lang.String>> |
getSubstitutions()
Default message substitutions.
|
java.lang.String |
getTitle()
The message title that displays above the message on the user's device.
|
java.lang.String |
getUrl()
The URL to open in the user's mobile browser.
|
int |
hashCode() |
java.lang.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(java.lang.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(java.lang.String body)
The message body of the notification.
|
void |
setData(java.util.Map<java.lang.String,java.lang.String> data)
The data payload used for a silent push.
|
void |
setSilentPush(java.lang.Boolean silentPush)
Indicates if the message should display on the recipient's device.
|
void |
setSubstitutions(java.util.Map<java.lang.String,java.util.List<java.lang.String>> substitutions)
Default message substitutions.
|
void |
setTitle(java.lang.String title)
The message title that displays above the message on the user's device.
|
void |
setUrl(java.lang.String url)
The URL to open in the user's mobile browser.
|
java.lang.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(java.lang.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(java.lang.String body)
The message body of the notification.
|
DefaultPushNotificationMessage |
withData(java.util.Map<java.lang.String,java.lang.String> data)
The data payload used for a silent push.
|
DefaultPushNotificationMessage |
withSilentPush(java.lang.Boolean silentPush)
Indicates if the message should display on the recipient's device.
|
DefaultPushNotificationMessage |
withSubstitutions(java.util.Map<java.lang.String,java.util.List<java.lang.String>> substitutions)
Default message substitutions.
|
DefaultPushNotificationMessage |
withTitle(java.lang.String title)
The message title that displays above the message on the user's device.
|
DefaultPushNotificationMessage |
withUrl(java.lang.String url)
The URL to open in the user's mobile browser.
|
public java.lang.String getAction()
Constraints:
Allowed Values: OPEN_APP, DEEP_LINK, URL
Action
public void setAction(java.lang.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 | URLAction
public DefaultPushNotificationMessage withAction(java.lang.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 | URLAction
public 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 | URLAction
public 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 | URLAction
public java.lang.String getBody()
public void setBody(java.lang.String body)
body
- The message body of the notification.public DefaultPushNotificationMessage withBody(java.lang.String body)
Returns a reference to this object so that method calls can be chained together.
body
- The message body of the notification.public java.util.Map<java.lang.String,java.lang.String> getData()
public void setData(java.util.Map<java.lang.String,java.lang.String> data)
data
- The data payload used for a silent push. This payload is
added to the notifications' data.pinpoint.jsonBody' objectpublic DefaultPushNotificationMessage withData(java.util.Map<java.lang.String,java.lang.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(java.lang.String key, java.lang.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 java.lang.Boolean isSilentPush()
public java.lang.Boolean getSilentPush()
public void setSilentPush(java.lang.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(java.lang.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 java.util.Map<java.lang.String,java.util.List<java.lang.String>> getSubstitutions()
public void setSubstitutions(java.util.Map<java.lang.String,java.util.List<java.lang.String>> substitutions)
substitutions
- Default message substitutions. Can be overridden by
individual address substitutions.public DefaultPushNotificationMessage withSubstitutions(java.util.Map<java.lang.String,java.util.List<java.lang.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(java.lang.String key, java.util.List<java.lang.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 java.lang.String getTitle()
public void setTitle(java.lang.String title)
title
- The message title that displays above the message on the
user's device.public DefaultPushNotificationMessage withTitle(java.lang.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 java.lang.String getUrl()
public void setUrl(java.lang.String url)
url
- The URL to open in the user's mobile browser. Used if the
value for Action is URL.public DefaultPushNotificationMessage withUrl(java.lang.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 java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
Copyright © 2018 Amazon Web Services, Inc. All Rights Reserved.