public class ADMMessage
extends java.lang.Object
implements java.io.Serializable
Constructor and Description |
---|
ADMMessage() |
Modifier and Type | Method and Description |
---|---|
ADMMessage |
addDataEntry(java.lang.String key,
java.lang.String value)
The data payload used for a silent push.
|
ADMMessage |
addSubstitutionsEntry(java.lang.String key,
java.util.List<java.lang.String> value)
Default message substitutions.
|
ADMMessage |
clearDataEntries()
Removes all the entries added into Data.
|
ADMMessage |
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.lang.String |
getConsolidationKey()
Optional.
|
java.util.Map<java.lang.String,java.lang.String> |
getData()
The data payload used for a silent push.
|
java.lang.String |
getExpiresAfter()
Optional.
|
java.lang.String |
getIconReference()
The icon image name of the asset saved in your application.
|
java.lang.String |
getImageIconUrl()
The URL that points to an image used as the large icon to the
notification content view.
|
java.lang.String |
getImageUrl()
The URL that points to an image used in the push notification.
|
java.lang.String |
getMD5()
Optional.
|
java.lang.String |
getRawContent()
The Raw JSON formatted string to be used as the payload.
|
java.lang.Boolean |
getSilentPush()
Indicates if the message should display on the users device.
|
java.lang.String |
getSmallImageIconUrl()
The URL that points to an image used as the small icon for the
notification which will be used to represent the notification in the
status bar and content view
|
java.lang.String |
getSound()
Indicates a sound to play when the device receives the notification.
|
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 users 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 |
setConsolidationKey(java.lang.String consolidationKey)
Optional.
|
void |
setData(java.util.Map<java.lang.String,java.lang.String> data)
The data payload used for a silent push.
|
void |
setExpiresAfter(java.lang.String expiresAfter)
Optional.
|
void |
setIconReference(java.lang.String iconReference)
The icon image name of the asset saved in your application.
|
void |
setImageIconUrl(java.lang.String imageIconUrl)
The URL that points to an image used as the large icon to the
notification content view.
|
void |
setImageUrl(java.lang.String imageUrl)
The URL that points to an image used in the push notification.
|
void |
setMD5(java.lang.String mD5)
Optional.
|
void |
setRawContent(java.lang.String rawContent)
The Raw JSON formatted string to be used as the payload.
|
void |
setSilentPush(java.lang.Boolean silentPush)
Indicates if the message should display on the users device.
|
void |
setSmallImageIconUrl(java.lang.String smallImageIconUrl)
The URL that points to an image used as the small icon for the
notification which will be used to represent the notification in the
status bar and content view
|
void |
setSound(java.lang.String sound)
Indicates a sound to play when the device receives the notification.
|
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.
|
ADMMessage |
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.
|
ADMMessage |
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.
|
ADMMessage |
withBody(java.lang.String body)
The message body of the notification.
|
ADMMessage |
withConsolidationKey(java.lang.String consolidationKey)
Optional.
|
ADMMessage |
withData(java.util.Map<java.lang.String,java.lang.String> data)
The data payload used for a silent push.
|
ADMMessage |
withExpiresAfter(java.lang.String expiresAfter)
Optional.
|
ADMMessage |
withIconReference(java.lang.String iconReference)
The icon image name of the asset saved in your application.
|
ADMMessage |
withImageIconUrl(java.lang.String imageIconUrl)
The URL that points to an image used as the large icon to the
notification content view.
|
ADMMessage |
withImageUrl(java.lang.String imageUrl)
The URL that points to an image used in the push notification.
|
ADMMessage |
withMD5(java.lang.String mD5)
Optional.
|
ADMMessage |
withRawContent(java.lang.String rawContent)
The Raw JSON formatted string to be used as the payload.
|
ADMMessage |
withSilentPush(java.lang.Boolean silentPush)
Indicates if the message should display on the users device.
|
ADMMessage |
withSmallImageIconUrl(java.lang.String smallImageIconUrl)
The URL that points to an image used as the small icon for the
notification which will be used to represent the notification in the
status bar and content view
|
ADMMessage |
withSound(java.lang.String sound)
Indicates a sound to play when the device receives the notification.
|
ADMMessage |
withSubstitutions(java.util.Map<java.lang.String,java.util.List<java.lang.String>> substitutions)
Default message substitutions.
|
ADMMessage |
withTitle(java.lang.String title)
The message title that displays above the message on the user's device.
|
ADMMessage |
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 ADMMessage 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 ADMMessage 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 ADMMessage 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.lang.String getConsolidationKey()
public void setConsolidationKey(java.lang.String consolidationKey)
consolidationKey
- Optional. Arbitrary string used to indicate
multiple messages are logically the same and that ADM is
allowed to drop previously enqueued messages in favor of this
one.public ADMMessage withConsolidationKey(java.lang.String consolidationKey)
Returns a reference to this object so that method calls can be chained together.
consolidationKey
- Optional. Arbitrary string used to indicate
multiple messages are logically the same and that ADM is
allowed to drop previously enqueued messages in favor of this
one.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 ADMMessage 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 ADMMessage 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 ADMMessage clearDataEntries()
Returns a reference to this object so that method calls can be chained together.
public java.lang.String getExpiresAfter()
public void setExpiresAfter(java.lang.String expiresAfter)
expiresAfter
- Optional. Number of seconds ADM should retain the
message if the device is offlinepublic ADMMessage withExpiresAfter(java.lang.String expiresAfter)
Returns a reference to this object so that method calls can be chained together.
expiresAfter
- Optional. Number of seconds ADM should retain the
message if the device is offlinepublic java.lang.String getIconReference()
public void setIconReference(java.lang.String iconReference)
iconReference
- The icon image name of the asset saved in your
application.public ADMMessage withIconReference(java.lang.String iconReference)
Returns a reference to this object so that method calls can be chained together.
iconReference
- The icon image name of the asset saved in your
application.public java.lang.String getImageIconUrl()
public void setImageIconUrl(java.lang.String imageIconUrl)
imageIconUrl
- The URL that points to an image used as the large
icon to the notification content view.public ADMMessage withImageIconUrl(java.lang.String imageIconUrl)
Returns a reference to this object so that method calls can be chained together.
imageIconUrl
- The URL that points to an image used as the large
icon to the notification content view.public java.lang.String getImageUrl()
public void setImageUrl(java.lang.String imageUrl)
imageUrl
- The URL that points to an image used in the push
notification.public ADMMessage withImageUrl(java.lang.String imageUrl)
Returns a reference to this object so that method calls can be chained together.
imageUrl
- The URL that points to an image used in the push
notification.public java.lang.String getMD5()
public void setMD5(java.lang.String mD5)
mD5
- Optional. Base-64-encoded MD5 checksum of the data parameter.
Used to verify data integritypublic ADMMessage withMD5(java.lang.String mD5)
Returns a reference to this object so that method calls can be chained together.
mD5
- Optional. Base-64-encoded MD5 checksum of the data parameter.
Used to verify data integritypublic java.lang.String getRawContent()
public void setRawContent(java.lang.String rawContent)
rawContent
- The Raw JSON formatted string to be used as the
payload. This value overrides the message.public ADMMessage withRawContent(java.lang.String rawContent)
Returns a reference to this object so that method calls can be chained together.
rawContent
- The Raw JSON formatted string to be used as the
payload. This value overrides the message.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 users
device. Silent pushes can be used for Remote Configuration and
Phone Home use cases.public ADMMessage 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 users
device. Silent pushes can be used for Remote Configuration and
Phone Home use cases.public java.lang.String getSmallImageIconUrl()
public void setSmallImageIconUrl(java.lang.String smallImageIconUrl)
smallImageIconUrl
- The URL that points to an image used as the
small icon for the notification which will be used to
represent the notification in the status bar and content viewpublic ADMMessage withSmallImageIconUrl(java.lang.String smallImageIconUrl)
Returns a reference to this object so that method calls can be chained together.
smallImageIconUrl
- The URL that points to an image used as the
small icon for the notification which will be used to
represent the notification in the status bar and content viewpublic java.lang.String getSound()
public void setSound(java.lang.String sound)
sound
- Indicates a sound to play when the device receives the
notification. Supports default, or the filename of a sound
resource bundled in the app. Android sound files must reside
in /res/raw/public ADMMessage withSound(java.lang.String sound)
Returns a reference to this object so that method calls can be chained together.
sound
- Indicates a sound to play when the device receives the
notification. Supports default, or the filename of a sound
resource bundled in the app. Android sound files must reside
in /res/raw/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 ADMMessage 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 ADMMessage 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 ADMMessage 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 ADMMessage 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 ADMMessage 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.