You are viewing documentation for version 2 of the AWS SDK for Ruby. Version 3 documentation can be found here.
Class: Aws::SNS::PlatformEndpoint
- Inherits:
-
Resources::Resource
- Object
- Resources::Resource
- Aws::SNS::PlatformEndpoint
- Defined in:
- (unknown)
Instance Attribute Summary collapse
-
#arn ⇒ String
readonly
-
#attributes ⇒ Hash<String,String>
readonly
Attributes include the following:.
Attributes inherited from Resources::Resource
Instance Method Summary collapse
-
#delete ⇒ Struct
Deletes the endpoint for a device and mobile app from Amazon SNS.
-
#initialize ⇒ Object
constructor
-
#publish(options = {}) ⇒ Types::PublishResponse
Sends a message to an Amazon SNS topic, a text message (SMS message) directly to a phone number, or a message to a mobile platform endpoint (when you specify the
TargetArn
).If you send a message to a topic, Amazon SNS delivers the message to each endpoint that is subscribed to the topic.
-
#set_attributes(options = {}) ⇒ Struct
Sets the attributes for an endpoint for a device on one of the supported push notification services, such as GCM (Firebase Cloud Messaging) and APNS.
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
Instance Attribute Details
#arn ⇒ String (readonly)
#attributes ⇒ Hash<String,String> (readonly)
Attributes include the following:
CustomUserData
– 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.Enabled
– flag that enables/disables delivery to the endpoint. Amazon SNS will set this to false when a notification service indicates to Amazon SNS that the endpoint is invalid. Users can set it back to true, typically after updating Token.Token
– device token, also referred to as a registration id, for an app and mobile device. This is returned from the notification service when an app and mobile device are registered with the notification service.The device token for the iOS platform is returned in lowercase.
Instance Method Details
#delete ⇒ Struct
Deletes the endpoint for a device and mobile app from Amazon SNS. This action is idempotent. For more information, see Using Amazon SNS Mobile Push Notifications.
When you delete an endpoint that is also subscribed to a topic, then you must also unsubscribe the endpoint from the topic.
#publish(options = {}) ⇒ Types::PublishResponse
Sends a message to an Amazon SNS topic, a text message (SMS message) directly to a phone number, or a message to a mobile platform endpoint (when you specify the TargetArn
).
If you send a message to a topic, Amazon SNS delivers the message to each endpoint that is subscribed to the topic. The format of the message depends on the notification protocol for each subscribed endpoint.
When a messageId
is returned, the message has been saved and Amazon SNS will attempt to deliver it shortly.
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.
You can publish messages only to topics and endpoints in the same AWS Region.
#set_attributes(options = {}) ⇒ Struct
Sets the attributes for an endpoint for a device on one of the supported push notification services, such as GCM (Firebase Cloud Messaging) and APNS. For more information, see Using Amazon SNS Mobile Push Notifications.