GetPlatformApplicationAttributes() public method

Retrieves the attributes of the platform application object for the supported push notification services, such as APNS and GCM. For more information, see Using Amazon SNS Mobile Push Notifications.
/// Indicates that the user has been denied access to the requested resource. /// /// Indicates an internal service error. /// /// Indicates that a request parameter does not comply with the associated constraints. /// /// Indicates that the requested resource does not exist. ///
public GetPlatformApplicationAttributes ( GetPlatformApplicationAttributesRequest request ) : GetPlatformApplicationAttributesResponse
request Amazon.SimpleNotificationService.Model.GetPlatformApplicationAttributesRequest Container for the necessary parameters to execute the GetPlatformApplicationAttributes service method.
return Amazon.SimpleNotificationService.Model.GetPlatformApplicationAttributesResponse
Example #1
0
    public static void SNSMobilePushAPIsListApplicationsEndpoints()
    {
      #region SNSMobilePushAPIsListApplicationsEndpoints
      var snsClient = new AmazonSimpleNotificationServiceClient();
      var appsResponse = snsClient.ListPlatformApplications();

      foreach (var app in appsResponse.PlatformApplications)
      {
        Console.WriteLine();

        var appAttrsRequest = new GetPlatformApplicationAttributesRequest
        {
          PlatformApplicationArn = app.PlatformApplicationArn
        };

        var appAttrsResponse =
          snsClient.GetPlatformApplicationAttributes(appAttrsRequest);

        var endpointsByAppRequest =
          new ListEndpointsByPlatformApplicationRequest
          {
            PlatformApplicationArn = app.PlatformApplicationArn
          };

        var endpointsByAppResponse =
          snsClient.ListEndpointsByPlatformApplication(
          endpointsByAppRequest);

        Console.WriteLine("Application: " + app.PlatformApplicationArn);
        Console.WriteLine("  Properties: ");

        foreach (var attr in appAttrsResponse.Attributes)
        {
          Console.WriteLine("    " + attr.Key + ": " + attr.Value);
        }

        Console.WriteLine("  Endpoints: ");

        foreach (var endpoint in endpointsByAppResponse.Endpoints)
        {
          Console.WriteLine("     ARN: " + endpoint.EndpointArn);
          Console.WriteLine("     Attributes: ");

          foreach (var attr in endpoint.Attributes)
          {
            Console.WriteLine("       " + attr.Key + ": " + attr.Value);
          }
        }
      }
      #endregion

      Console.ReadLine();
    }