ListPlatformApplications() 공개 메소드

Lists the platform application objects for the supported push notification services, such as APNS and GCM. The results for ListPlatformApplications are paginated and return a limited list of applications, up to 100. If additional records are available after the first page results, then a NextToken string will be returned. To receive the next page, you call ListPlatformApplications using the NextToken string received from the previous call. When there are no more records to return, NextToken will be null. 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. ///
public ListPlatformApplications ( ) : ListPlatformApplicationsResponse
리턴 Amazon.SimpleNotificationService.Model.ListPlatformApplicationsResponse
        public IEnumerable<string> ListApplications()
        {
            try
            {

                using (var snsclient = new AmazonSimpleNotificationServiceClient(_accesskey, _secretkey))
                {
                    var listapps = snsclient.ListPlatformApplications(new ListPlatformApplicationsRequest());
                    return listapps.PlatformApplications.Select(s => s.PlatformApplicationArn);
                }
            }
            catch (Exception ex)
            {
                throw new Exception("ListApplications " + ex.Message);
            }
        }
예제 #2
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();
    }