The Publish
action sends a message to all of a topic's subscribed endpoints. When a messageId
is returned, the message has been saved and Amazon SNS will attempt to deliver it to the topic's subscribers shortly. The format of the outgoing message to each subscribed endpoint depends on the notification protocol selected.
To use the Publish
action for sending a message to a mobile endpoint, such as an app on a Kindle device or mobile phone, you must specify the EndpointArn. The EndpointArn is returned when making a call with the CreatePlatformEndpoint
action. The second example below shows a request and response for publishing to a mobile endpoint.
@param publishRequest Container for the necessary parameters toexecute the Publish service method on AmazonSNS.
@return The response from the Publish service method, as returned byAmazonSNS.
@throws NotFoundException
@throws PlatformApplicationDisabledException
@throws EndpointDisabledException
@throws AuthorizationErrorException
@throws InternalErrorException
@throws InvalidParameterException
@throws AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
@throws AmazonServiceException If an error response is returned by AmazonSNS indicating either a problem with the data in the request, or a server side issue.