You are viewing documentation for version 2 of the AWS SDK for Ruby. Version 3 documentation can be found here.

Class: Aws::SNS::PlatformApplication

Inherits:
Resources::Resource show all
Defined in:
(unknown)

Instance Attribute Summary collapse

Attributes inherited from Resources::Resource

#client, #identifiers

Instance Method Summary collapse

Methods inherited from Resources::Resource

add_data_attribute, add_identifier, #data, data_attributes, #data_loaded?, identifiers, #load, #wait_until

Methods included from Resources::OperationMethods

#add_batch_operation, #add_operation, #batch_operation, #batch_operation_names, #batch_operations, #operation, #operation_names, #operations

Constructor Details

#initialize(arn, options = {}) ⇒ Object #initialize(options = {}) ⇒ Object

Overloads:

  • #initialize(arn, options = {}) ⇒ Object

    Parameters:

    • arn (String)

    Options Hash (options):

    • :client (Client)

      When `:client is not given, the options hash is used to construct a new Client object.

  • #initialize(options = {}) ⇒ Object

    Options Hash (options):

    • :arn (required, String)
    • :client (Client)

      When `:client is not given, the options hash is used to construct a new Client object.

Instance Attribute Details

#arnString (readonly)

Returns:

  • (String)

#attributesHash<String,String> (readonly)

Attributes include the following:

  • EventEndpointCreated -- Topic ARN to which EndpointCreated event notifications should be sent.

  • EventEndpointDeleted -- Topic ARN to which EndpointDeleted event notifications should be sent.

  • EventEndpointUpdated -- Topic ARN to which EndpointUpdate event notifications should be sent.

  • EventDeliveryFailure -- Topic ARN to which DeliveryFailure event notifications should be sent upon Direct Publish delivery failure (permanent) to one of the application\'s endpoints.

Returns:

  • (Hash<String,String>)

    Attributes include the following:.

Instance Method Details

#create_platform_endpoint(options = {}) ⇒ PlatformEndpoint

Examples:

Request syntax example with placeholder values


platformapplication.create_platform_endpoint({
  token: "String", # required
  custom_user_data: "String",
  attributes: {
    "String" => "String",
  },
})

Basic usage

platformendpoint = platformapplication.create_platform_endpoint(options)
platformendpoint.arn
#=> "platformendpoint-arn"

Options Hash (options):

  • :token (required, String)

    Unique identifier created by the notification service for an app on a device. The specific name for Token will vary, depending on which notification service is being used. For example, when using APNS as the notification service, you need the device token. Alternatively, when using GCM or ADM, the device token equivalent is called the registration ID.

  • :custom_user_data (String)

    Arbitrary user data to associate with the endpoint. Amazon SNS does not use this data. The data must be in UTF-8 format and less than 2KB.

  • :attributes (Hash<String,String>)

    For a list of attributes, see SetEndpointAttributes.

Returns:

See Also:

#deleteStruct

Deletes a platform application object for one of the supported push notification services, such as APNS and GCM. For more information, see Using Amazon SNS Mobile Push Notifications.

Examples:

Request syntax example with placeholder values


platformapplication.delete()

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#endpoints(options = {}) ⇒ Collection<PlatformEndpoint>

Returns a Collection of Aws::SNS::PlatformEndpoint resources. No API requests are made until you call an enumerable method on the collection. Client#list_endpoints_by_platform_application will be called multiple times until every Aws::SNS::PlatformEndpoint has been yielded.

Examples:

Request syntax example with placeholder values


platformapplication.endpoints({
  next_token: "String",
})

Enumerating Aws::SNS::PlatformEndpoint resources.

platformapplication.endpoints.each do |platformendpoint|
  # yields each platformendpoint
end

Enumerating Aws::SNS::PlatformEndpoint resources with a limit.

platformapplication.endpoints.limit(10).each do |platformendpoint|
  # yields at most 10 endpoints
end

Options Hash (options):

  • :next_token (String)

    NextToken string is used when calling ListEndpointsByPlatformApplication action to retrieve additional records that are available after the first page results.

Returns:

See Also:

#set_attributes(options = {}) ⇒ Struct

Sets 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. For information on configuring attributes for message delivery status, see Using Amazon SNS Application Attributes for Message Delivery Status.

Examples:

Request syntax example with placeholder values


platformapplication.set_attributes({
  attributes: { # required
    "String" => "String",
  },
})

Options Hash (options):

  • :attributes (required, Hash<String,String>)

    A map of the platform application attributes. Attributes in this map include the following:

    • PlatformCredential -- The credential received from the notification service. For APNS/APNS_SANDBOX, PlatformCredential is private key. For GCM, PlatformCredential is \"API key\". For ADM, PlatformCredential is \"client secret\".

    • PlatformPrincipal -- The principal received from the notification service. For APNS/APNS_SANDBOX, PlatformPrincipal is SSL certificate. For GCM, PlatformPrincipal is not applicable. For ADM, PlatformPrincipal is \"client id\".

    • EventEndpointCreated -- Topic ARN to which EndpointCreated event notifications should be sent.

    • EventEndpointDeleted -- Topic ARN to which EndpointDeleted event notifications should be sent.

    • EventEndpointUpdated -- Topic ARN to which EndpointUpdate event notifications should be sent.

    • EventDeliveryFailure -- Topic ARN to which DeliveryFailure event notifications should be sent upon Direct Publish delivery failure (permanent) to one of the application\'s endpoints.

    • SuccessFeedbackRoleArn -- IAM role ARN used to give Amazon SNS write access to use CloudWatch Logs on your behalf.

    • FailureFeedbackRoleArn -- IAM role ARN used to give Amazon SNS write access to use CloudWatch Logs on your behalf.

    • SuccessFeedbackSampleRate -- Sample rate percentage (0-100) of successfully delivered messages.

Returns:

  • (Struct)

    Returns an empty response.

See Also: