

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# 使用 Amazon SNS 的代码示例 AWS SDKs
<a name="service_code_examples"></a>

以下代码示例展示了如何将 Amazon SNS 与 AWS 软件开发套件 (SDK) 配合使用。

*操作*是大型程序的代码摘录，必须在上下文中运行。您可以通过操作了解如何调用单个服务函数，还可以通过函数相关场景的上下文查看操作。

*场景*是向您展示如何通过在一个服务中调用多个函数或与其他 AWS 服务服务结合来完成特定任务的代码示例。

有关 S AWS DK 开发者指南和代码示例的完整列表，请参阅[将 Amazon SNS 与 AWS SDK](sdk-general-information-section.md)。本主题还包括有关入门的信息以及有关先前的 SDK 版本的详细信息。

**Contents**
+ [基本功能](service_code_examples_basics.md)
  + [开始使用 Amazon SNS](example_sns_Hello_section.md)
  + [操作](service_code_examples_actions.md)
    + [`CheckIfPhoneNumberIsOptedOut`](example_sns_CheckIfPhoneNumberIsOptedOut_section.md)
    + [`ConfirmSubscription`](example_sns_ConfirmSubscription_section.md)
    + [`CreateTopic`](example_sns_CreateTopic_section.md)
    + [`DeleteTopic`](example_sns_DeleteTopic_section.md)
    + [`GetSMSAttributes`](example_sns_GetSMSAttributes_section.md)
    + [`GetTopicAttributes`](example_sns_GetTopicAttributes_section.md)
    + [`ListPhoneNumbersOptedOut`](example_sns_ListPhoneNumbersOptedOut_section.md)
    + [`ListSubscriptions`](example_sns_ListSubscriptions_section.md)
    + [`ListTopics`](example_sns_ListTopics_section.md)
    + [`Publish`](example_sns_Publish_section.md)
    + [`SetSMSAttributes`](example_sns_SetSMSAttributes_section.md)
    + [`SetSubscriptionAttributes`](example_sns_SetSubscriptionAttributes_section.md)
    + [`SetSubscriptionAttributesRedrivePolicy`](example_sns_SetSubscriptionAttributesRedrivePolicy_section.md)
    + [`SetTopicAttributes`](example_sns_SetTopicAttributes_section.md)
    + [`Subscribe`](example_sns_Subscribe_section.md)
    + [`TagResource`](example_sns_TagResource_section.md)
    + [`Unsubscribe`](example_sns_Unsubscribe_section.md)
+ [场景](service_code_examples_scenarios.md)
  + [构建应用程序以将数据提交到 DynamoDB 表](example_cross_SubmitDataApp_section.md)
  + [构建 Amazon SNS 应用程序](example_cross_SnsPublishSubscription_section.md)
  + [为推送通知创建平台终端节点](example_sns_CreatePlatformEndpoint_section.md)
  + [创建无服务器应用程序来管理照片](example_cross_PAM_section.md)
  + [创建 Amazon Textract 浏览器应用程序](example_cross_TextractExplorer_section.md)
  + [创建 Amazon SNS 主题，并发布消息](example_sns_GettingStarted_048_section.md)
  + [创建并发布到 FIFO 主题](example_sns_PublishFifoTopic_section.md)
  + [检测视频中的人物和对象](example_cross_RekognitionVideoDetection_section.md)
  + [IoT Device Defender 入门](example_iot_GettingStarted_079_section.md)
  + [Config 入门](example_config_service_GettingStarted_053_section.md)
  + [将短信发布到主题](example_sns_UsageSmsTopic_section.md)
  + [发布大型消息](example_sns_PublishLargeMessage_section.md)
  + [发布 SMS 文本消息](example_sns_PublishTextSMS_section.md)
  + [将消息发布到队列](example_sqs_Scenario_TopicsAndQueues_section.md)
  + [使用 API Gateway 调用 Lambda 函数](example_cross_LambdaAPIGateway_section.md)
  + [使用计划的事件调用 Lambda 函数](example_cross_LambdaScheduledEvents_section.md)
+ [无服务器示例](service_code_examples_serverless_examples.md)
  + [通过 Amazon SNS 触发器调用 Lambda 函数](example_serverless_SNS_Lambda_section.md)