public class GCMMessage
extends java.lang.Object
implements java.io.Serializable
Constructor and Description |
---|
GCMMessage() |
Modifier and Type | Method and Description |
---|---|
GCMMessage |
addDataEntry(java.lang.String key,
java.lang.String value)
The data payload used for a silent push.
|
GCMMessage |
addSubstitutionsEntry(java.lang.String key,
java.util.List<java.lang.String> value)
Default message substitutions.
|
GCMMessage |
clearDataEntries()
Removes all the entries added into Data.
|
GCMMessage |
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 |
getCollapseKey()
This parameter identifies a group of messages (e.g., with collapse_key:
"Updates Available") that can be collapsed, so that only the last message
gets sent when delivery can be resumed.
|
java.util.Map<java.lang.String,java.lang.String> |
getData()
The data payload used for a silent push.
|
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 |
getPriority()
The message priority.
|
java.lang.String |
getRawContent()
The Raw JSON formatted string to be used as the payload.
|
java.lang.String |
getRestrictedPackageName()
This parameter specifies the package name of the application where the
registration tokens must match in order to receive the message.
|
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.Integer |
getTimeToLive()
The length of time (in seconds) that FCM or GCM stores and attempts to
deliver the message.
|
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 |
setCollapseKey(java.lang.String collapseKey)
This parameter identifies a group of messages (e.g., with collapse_key:
"Updates Available") that can be collapsed, so that only the last message
gets sent when delivery can be resumed.
|
void |
setData(java.util.Map<java.lang.String,java.lang.String> data)
The data payload used for a silent push.
|
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 |
setPriority(java.lang.String priority)
The message priority.
|
void |
setRawContent(java.lang.String rawContent)
The Raw JSON formatted string to be used as the payload.
|
void |
setRestrictedPackageName(java.lang.String restrictedPackageName)
This parameter specifies the package name of the application where the
registration tokens must match in order to receive the message.
|
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 |
setTimeToLive(java.lang.Integer timeToLive)
The length of time (in seconds) that FCM or GCM stores and attempts to
deliver the message.
|
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.
|
GCMMessage |
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.
|
GCMMessage |
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.
|
GCMMessage |
withBody(java.lang.String body)
The message body of the notification.
|
GCMMessage |
withCollapseKey(java.lang.String collapseKey)
This parameter identifies a group of messages (e.g., with collapse_key:
"Updates Available") that can be collapsed, so that only the last message
gets sent when delivery can be resumed.
|
GCMMessage |
withData(java.util.Map<java.lang.String,java.lang.String> data)
The data payload used for a silent push.
|
GCMMessage |
withIconReference(java.lang.String iconReference)
The icon image name of the asset saved in your application.
|
GCMMessage |
withImageIconUrl(java.lang.String imageIconUrl)
The URL that points to an image used as the large icon to the
notification content view.
|
GCMMessage |
withImageUrl(java.lang.String imageUrl)
The URL that points to an image used in the push notification.
|
GCMMessage |
withPriority(java.lang.String priority)
The message priority.
|
GCMMessage |
withRawContent(java.lang.String rawContent)
The Raw JSON formatted string to be used as the payload.
|
GCMMessage |
withRestrictedPackageName(java.lang.String restrictedPackageName)
This parameter specifies the package name of the application where the
registration tokens must match in order to receive the message.
|
GCMMessage |
withSilentPush(java.lang.Boolean silentPush)
Indicates if the message should display on the users device.
|
GCMMessage |
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
|
GCMMessage |
withSound(java.lang.String sound)
Indicates a sound to play when the device receives the notification.
|
GCMMessage |
withSubstitutions(java.util.Map<java.lang.String,java.util.List<java.lang.String>> substitutions)
Default message substitutions.
|
GCMMessage |
withTimeToLive(java.lang.Integer timeToLive)
The length of time (in seconds) that FCM or GCM stores and attempts to
deliver the message.
|
GCMMessage |
withTitle(java.lang.String title)
The message title that displays above the message on the user's device.
|
GCMMessage |
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 GCMMessage 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 GCMMessage 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 GCMMessage 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 getCollapseKey()
public void setCollapseKey(java.lang.String collapseKey)
collapseKey
- This parameter identifies a group of messages (e.g.,
with collapse_key: "Updates Available") that can be collapsed,
so that only the last message gets sent when delivery can be
resumed. This is intended to avoid sending too many of the
same messages when the device comes back online or becomes
active.public GCMMessage withCollapseKey(java.lang.String collapseKey)
Returns a reference to this object so that method calls can be chained together.
collapseKey
- This parameter identifies a group of messages (e.g.,
with collapse_key: "Updates Available") that can be collapsed,
so that only the last message gets sent when delivery can be
resumed. This is intended to avoid sending too many of the
same messages when the device comes back online or becomes
active.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 GCMMessage 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 GCMMessage 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 GCMMessage clearDataEntries()
Returns a reference to this object so that method calls can be chained together.
public java.lang.String getIconReference()
public void setIconReference(java.lang.String iconReference)
iconReference
- The icon image name of the asset saved in your
application.public GCMMessage 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 GCMMessage 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 GCMMessage 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 getPriority()
public void setPriority(java.lang.String priority)
priority
- The message priority. Amazon Pinpoint uses this value to
set the FCM or GCM priority parameter when it sends the
message. Accepts the following values: "Normal" - Messages
might be delayed. Delivery is optimized for battery usage on
the receiving device. Use normal priority unless immediate
delivery is required. "High" - Messages are sent immediately
and might wake a sleeping device. The equivalent values for
APNs messages are "5" and "10". Amazon Pinpoint accepts these
values here and converts them. For more information, see About
FCM Messages in the Firebase documentation.public GCMMessage withPriority(java.lang.String priority)
Returns a reference to this object so that method calls can be chained together.
priority
- The message priority. Amazon Pinpoint uses this value to
set the FCM or GCM priority parameter when it sends the
message. Accepts the following values: "Normal" - Messages
might be delayed. Delivery is optimized for battery usage on
the receiving device. Use normal priority unless immediate
delivery is required. "High" - Messages are sent immediately
and might wake a sleeping device. The equivalent values for
APNs messages are "5" and "10". Amazon Pinpoint accepts these
values here and converts them. For more information, see About
FCM Messages in the Firebase documentation.public 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 GCMMessage 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.String getRestrictedPackageName()
public void setRestrictedPackageName(java.lang.String restrictedPackageName)
restrictedPackageName
- This parameter specifies the package name of
the application where the registration tokens must match in
order to receive the message.public GCMMessage withRestrictedPackageName(java.lang.String restrictedPackageName)
Returns a reference to this object so that method calls can be chained together.
restrictedPackageName
- This parameter specifies the package name of
the application where the registration tokens must match in
order to receive 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 GCMMessage 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 GCMMessage 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 GCMMessage 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 GCMMessage 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 GCMMessage 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 GCMMessage clearSubstitutionsEntries()
Returns a reference to this object so that method calls can be chained together.
public java.lang.Integer getTimeToLive()
public void setTimeToLive(java.lang.Integer timeToLive)
timeToLive
- The length of time (in seconds) that FCM or GCM stores
and attempts to deliver the message. If unspecified, the value
defaults to the maximum, which is 2,419,200 seconds (28 days).
Amazon Pinpoint uses this value to set the FCM or GCM
time_to_live parameter.public GCMMessage withTimeToLive(java.lang.Integer timeToLive)
Returns a reference to this object so that method calls can be chained together.
timeToLive
- The length of time (in seconds) that FCM or GCM stores
and attempts to deliver the message. If unspecified, the value
defaults to the maximum, which is 2,419,200 seconds (28 days).
Amazon Pinpoint uses this value to set the FCM or GCM
time_to_live parameter.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 GCMMessage 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 GCMMessage 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.