Sends a message to an Amazon SNS topic or sends a text message (SMS message) directly to a phone number.
If you send a message to a topic, Amazon SNS delivers the message to each endpoint that is subscribed to the topic. The format of the message depends on the notification protocol for each subscribed endpoint.
messageId is returned, the message has been saved and Amazon SNS
will attempt to deliver it shortly.
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
for the TargetArn parameter. The EndpointArn is returned when making a call with the
For more information about formatting messages, see Send Custom Platform-Specific Payloads in Messages to Mobile Devices.
For .NET Core, PCL and Unity this operation is only available in asynchronous form. Please refer to PublishAsync.
public virtual PublishResponse Publish( PublishRequest request )
Container for the necessary parameters to execute the Publish service method.
|AuthorizationErrorException||Indicates that the user has been denied access to the requested resource.|
|EndpointDisabledException||Exception error indicating endpoint disabled.|
|InternalErrorException||Indicates an internal service error.|
|InvalidParameterException||Indicates that a request parameter does not comply with the associated constraints.|
|InvalidParameterValueException||Indicates that a request parameter does not comply with the associated constraints.|
|NotFoundException||Indicates that the requested resource does not exist.|
|PlatformApplicationDisabledException||Exception error indicating platform application disabled.|
Supported in: 4.5, 4.0, 3.5
Supported in: Windows Store Apps
Supported in: Windows Phone 8.1
Supported in: Xamarin Android
Supported in: Xamarin iOS (Unified)
Supported in: Xamarin.Forms
Supported Versions: 4.6 and above
Supported Platforms: Android, iOS, Standalone