Amazon.SimpleNotificationService.AmazonSimpleNotificationServiceClient.Publish C# (CSharp) Метод

Publish() публичный Метод

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.

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 CreatePlatformEndpoint action.

For more information about formatting messages, see Send Custom Platform-Specific Payloads in Messages to Mobile Devices.

/// Indicates that the user has been denied access to the requested resource. /// /// Exception error indicating endpoint disabled. /// /// Indicates an internal service error. /// /// Indicates that a request parameter does not comply with the associated constraints. /// /// Indicates that a request parameter does not comply with the associated constraints. /// /// Indicates that the requested resource does not exist. /// /// Exception error indicating platform application disabled. ///
public Publish ( PublishRequest request ) : PublishResponse
request PublishRequest Container for the necessary parameters to execute the Publish service method.
Результат PublishResponse
        public PublishResponse Publish(PublishRequest request)
        {
            var marshaller = new PublishRequestMarshaller();
            var unmarshaller = PublishResponseUnmarshaller.Instance;

            return Invoke<PublishRequest,PublishResponse>(request, marshaller, unmarshaller);
        }

Same methods

AmazonSimpleNotificationServiceClient::Publish ( string topicArn, string message ) : PublishResponse
AmazonSimpleNotificationServiceClient::Publish ( string topicArn, string message, string subject ) : PublishResponse

Usage Example

Пример #1
0
 public static void PublishMessage(string topicArn, string message, string subject = null)
 {
     using (var client = new AmazonSimpleNotificationServiceClient(Settings.AccessKey, Settings.Secret))
     {
         client.Publish(topicArn, message, subject);
     }
 }
All Usage Examples Of Amazon.SimpleNotificationService.AmazonSimpleNotificationServiceClient::Publish
AmazonSimpleNotificationServiceClient