public class APNSMessage
extends java.lang.Object
implements java.io.Serializable
| Constructor and Description | 
|---|
| APNSMessage() | 
| Modifier and Type | Method and Description | 
|---|---|
| APNSMessage | addDataEntry(java.lang.String key,
            java.lang.String value)The data payload used for a silent push. | 
| APNSMessage | addSubstitutionsEntry(java.lang.String key,
                     java.util.List<java.lang.String> value)Default message substitutions. | 
| APNSMessage | clearDataEntries()Removes all the entries added into Data. | 
| APNSMessage | 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.Integer | getBadge()Include this key when you want the system to modify the badge of your app
 icon. | 
| java.lang.String | getBody()The message body of the notification. | 
| java.lang.String | getCategory()Provide this key with a string value that represents the notification's
 type. | 
| java.lang.String | getCollapseId()An ID that, if assigned to multiple messages, causes APNs to coalesce the
 messages into a single push notification instead of delivering each
 message individually. | 
| java.util.Map<java.lang.String,java.lang.String> | getData()The data payload used for a silent push. | 
| java.lang.String | getMediaUrl()A URL that refers to the location of an image or video that you want to
 display in the push notification. | 
| java.lang.String | getPreferredAuthenticationMethod()The preferred authentication method, either "CERTIFICATE" or "TOKEN" | 
| java.lang.String | getPriority()The message priority. | 
| 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 | getSound()Include this key when you want the system to play a sound. | 
| java.util.Map<java.lang.String,java.util.List<java.lang.String>> | getSubstitutions()Default message substitutions. | 
| java.lang.String | getThreadId()Provide this key with a string value that represents the app-specific
 identifier for grouping notifications. | 
| java.lang.Integer | getTimeToLive()The length of time (in seconds) that APNs 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 | setBadge(java.lang.Integer badge)Include this key when you want the system to modify the badge of your app
 icon. | 
| void | setBody(java.lang.String body)The message body of the notification. | 
| void | setCategory(java.lang.String category)Provide this key with a string value that represents the notification's
 type. | 
| void | setCollapseId(java.lang.String collapseId)An ID that, if assigned to multiple messages, causes APNs to coalesce the
 messages into a single push notification instead of delivering each
 message individually. | 
| void | setData(java.util.Map<java.lang.String,java.lang.String> data)The data payload used for a silent push. | 
| void | setMediaUrl(java.lang.String mediaUrl)A URL that refers to the location of an image or video that you want to
 display in the push notification. | 
| void | setPreferredAuthenticationMethod(java.lang.String preferredAuthenticationMethod)The preferred authentication method, either "CERTIFICATE" or "TOKEN" | 
| 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 | setSilentPush(java.lang.Boolean silentPush)Indicates if the message should display on the users device. | 
| void | setSound(java.lang.String sound)Include this key when you want the system to play a sound. | 
| void | setSubstitutions(java.util.Map<java.lang.String,java.util.List<java.lang.String>> substitutions)Default message substitutions. | 
| void | setThreadId(java.lang.String threadId)Provide this key with a string value that represents the app-specific
 identifier for grouping notifications. | 
| void | setTimeToLive(java.lang.Integer timeToLive)The length of time (in seconds) that APNs 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. | 
| APNSMessage | 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. | 
| APNSMessage | 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. | 
| APNSMessage | withBadge(java.lang.Integer badge)Include this key when you want the system to modify the badge of your app
 icon. | 
| APNSMessage | withBody(java.lang.String body)The message body of the notification. | 
| APNSMessage | withCategory(java.lang.String category)Provide this key with a string value that represents the notification's
 type. | 
| APNSMessage | withCollapseId(java.lang.String collapseId)An ID that, if assigned to multiple messages, causes APNs to coalesce the
 messages into a single push notification instead of delivering each
 message individually. | 
| APNSMessage | withData(java.util.Map<java.lang.String,java.lang.String> data)The data payload used for a silent push. | 
| APNSMessage | withMediaUrl(java.lang.String mediaUrl)A URL that refers to the location of an image or video that you want to
 display in the push notification. | 
| APNSMessage | withPreferredAuthenticationMethod(java.lang.String preferredAuthenticationMethod)The preferred authentication method, either "CERTIFICATE" or "TOKEN" | 
| APNSMessage | withPriority(java.lang.String priority)The message priority. | 
| APNSMessage | withRawContent(java.lang.String rawContent)The Raw JSON formatted string to be used as the payload. | 
| APNSMessage | withSilentPush(java.lang.Boolean silentPush)Indicates if the message should display on the users device. | 
| APNSMessage | withSound(java.lang.String sound)Include this key when you want the system to play a sound. | 
| APNSMessage | withSubstitutions(java.util.Map<java.lang.String,java.util.List<java.lang.String>> substitutions)Default message substitutions. | 
| APNSMessage | withThreadId(java.lang.String threadId)Provide this key with a string value that represents the app-specific
 identifier for grouping notifications. | 
| APNSMessage | withTimeToLive(java.lang.Integer timeToLive)The length of time (in seconds) that APNs stores and attempts to deliver
 the message. | 
| APNSMessage | withTitle(java.lang.String title)The message title that displays above the message on the user's device. | 
| APNSMessage | 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
Actionpublic 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 | URLActionpublic APNSMessage 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 | 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 APNSMessage 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 java.lang.Integer getBadge()
public void setBadge(java.lang.Integer badge)
badge - Include this key when you want the system to modify the
            badge of your app icon. If this key is not included in the
            dictionary, the badge is not changed. To remove the badge, set
            the value of this key to 0.public APNSMessage withBadge(java.lang.Integer badge)
Returns a reference to this object so that method calls can be chained together.
badge - Include this key when you want the system to modify the
            badge of your app icon. If this key is not included in the
            dictionary, the badge is not changed. To remove the badge, set
            the value of this key to 0.public java.lang.String getBody()
public void setBody(java.lang.String body)
body - The message body of the notification.public APNSMessage 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 getCategory()
public void setCategory(java.lang.String category)
category - Provide this key with a string value that represents the
            notification's type. This value corresponds to the value in
            the identifier property of one of your app's registered
            categories.public APNSMessage withCategory(java.lang.String category)
Returns a reference to this object so that method calls can be chained together.
category - Provide this key with a string value that represents the
            notification's type. This value corresponds to the value in
            the identifier property of one of your app's registered
            categories.public java.lang.String getCollapseId()
public void setCollapseId(java.lang.String collapseId)
collapseId - An ID that, if assigned to multiple messages, causes
            APNs to coalesce the messages into a single push notification
            instead of delivering each message individually. The value
            must not exceed 64 bytes. Amazon Pinpoint uses this value to
            set the apns-collapse-id request header when it sends the
            message to APNs.public APNSMessage withCollapseId(java.lang.String collapseId)
Returns a reference to this object so that method calls can be chained together.
collapseId - An ID that, if assigned to multiple messages, causes
            APNs to coalesce the messages into a single push notification
            instead of delivering each message individually. The value
            must not exceed 64 bytes. Amazon Pinpoint uses this value to
            set the apns-collapse-id request header when it sends the
            message to APNs.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 APNSMessage 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 APNSMessage 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 APNSMessage clearDataEntries()
Returns a reference to this object so that method calls can be chained together.
public java.lang.String getMediaUrl()
public void setMediaUrl(java.lang.String mediaUrl)
mediaUrl - A URL that refers to the location of an image or video
            that you want to display in the push notification.public APNSMessage withMediaUrl(java.lang.String mediaUrl)
Returns a reference to this object so that method calls can be chained together.
mediaUrl - A URL that refers to the location of an image or video
            that you want to display in the push notification.public java.lang.String getPreferredAuthenticationMethod()
public void setPreferredAuthenticationMethod(java.lang.String preferredAuthenticationMethod)
preferredAuthenticationMethod - The preferred authentication method,
            either "CERTIFICATE" or "TOKEN"public APNSMessage withPreferredAuthenticationMethod(java.lang.String preferredAuthenticationMethod)
Returns a reference to this object so that method calls can be chained together.
preferredAuthenticationMethod - The preferred authentication method,
            either "CERTIFICATE" or "TOKEN"public java.lang.String getPriority()
public void setPriority(java.lang.String priority)
priority - The message priority. Amazon Pinpoint uses this value to
            set the apns-priority request header when it sends the message
            to APNs. Accepts the following values: "5" - Low priority.
            Messages might be delayed, delivered in groups, and throttled.
            "10" - High priority. Messages are sent immediately. High
            priority messages must cause an alert, sound, or badge on the
            receiving device. The default value is "10". The equivalent
            values for FCM or GCM messages are "normal" and "high". Amazon
            Pinpoint accepts these values for APNs messages and converts
            them. For more information about the apns-priority parameter,
            see Communicating with APNs in the APNs Local and Remote
            Notification Programming Guide.public APNSMessage 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 apns-priority request header when it sends the message
            to APNs. Accepts the following values: "5" - Low priority.
            Messages might be delayed, delivered in groups, and throttled.
            "10" - High priority. Messages are sent immediately. High
            priority messages must cause an alert, sound, or badge on the
            receiving device. The default value is "10". The equivalent
            values for FCM or GCM messages are "normal" and "high". Amazon
            Pinpoint accepts these values for APNs messages and converts
            them. For more information about the apns-priority parameter,
            see Communicating with APNs in the APNs Local and Remote
            Notification Programming Guide.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 APNSMessage 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 APNSMessage 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 getSound()
public void setSound(java.lang.String sound)
sound - Include this key when you want the system to play a sound.
            The value of this key is the name of a sound file in your
            app's main bundle or in the Library/Sounds folder of your
            app's data container. If the sound file cannot be found, or if
            you specify defaultfor the value, the system plays the default
            alert sound.public APNSMessage withSound(java.lang.String sound)
Returns a reference to this object so that method calls can be chained together.
sound - Include this key when you want the system to play a sound.
            The value of this key is the name of a sound file in your
            app's main bundle or in the Library/Sounds folder of your
            app's data container. If the sound file cannot be found, or if
            you specify defaultfor the value, the system plays the default
            alert sound.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 APNSMessage 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 APNSMessage 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 APNSMessage clearSubstitutionsEntries()
Returns a reference to this object so that method calls can be chained together.
public java.lang.String getThreadId()
public void setThreadId(java.lang.String threadId)
threadId - Provide this key with a string value that represents the
            app-specific identifier for grouping notifications. If you
            provide a Notification Content app extension, you can use this
            value to group your notifications together.public APNSMessage withThreadId(java.lang.String threadId)
Returns a reference to this object so that method calls can be chained together.
threadId - Provide this key with a string value that represents the
            app-specific identifier for grouping notifications. If you
            provide a Notification Content app extension, you can use this
            value to group your notifications together.public java.lang.Integer getTimeToLive()
public void setTimeToLive(java.lang.Integer timeToLive)
timeToLive - The length of time (in seconds) that APNs stores and
            attempts to deliver the message. If the value is 0, APNs does
            not store the message or attempt to deliver it more than once.
            Amazon Pinpoint uses this value to set the apns-expiration
            request header when it sends the message to APNs.public APNSMessage 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 APNs stores and
            attempts to deliver the message. If the value is 0, APNs does
            not store the message or attempt to deliver it more than once.
            Amazon Pinpoint uses this value to set the apns-expiration
            request header when it sends the message to APNs.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 APNSMessage 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 APNSMessage 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.ObjectObject.toString()public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.ObjectCopyright © 2018 Amazon Web Services, Inc. All Rights Reserved.