public void SetEndpointAttribute(string endpointarn, string key, string value) { try { var endpoint = GetEndpoint(string.Empty, endpointarn); if (string.IsNullOrEmpty(endpoint)) { throw new ArgumentNullException("endpointarn"); } Dictionary <string, string> attributes = (Dictionary <string, string>)GetEndpointAttributes(endpointarn); attributes[key] = value; using (var snsclient = new AmazonSimpleNotificationServiceClient(_accesskey, _secretkey)) { var result = snsclient.SetEndpointAttributes(new SetEndpointAttributesRequest() { EndpointArn = endpointarn, Attributes = attributes }); } } catch (Exception ex) { throw new Exception("SetEndpointAttribute " + ex.Message); } }
public static void SNSMobilePushAPIsSetEndpointAttributes() { #region SNSMobilePushAPIsSetEndpointAttributes var snsClient = new AmazonSimpleNotificationServiceClient(); var request = new SetEndpointAttributesRequest { EndpointArn = "arn:aws:sns:us-east-1:80398EXAMPLE:" + "endpoint/GCM/TimeCardProcessingApplication/" + "d84b5f0d-7136-3bbe-9b42-4e001EXAMPLE", Attributes = new Dictionary <string, string>() { { "Enabled", "true" } } }; snsClient.SetEndpointAttributes(request); #endregion }