

文档 AWS SDK 示例 GitHub 存储库中还有更多 [S AWS DK 示例](https://github.com/awsdocs/aws-doc-sdk-examples)。

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

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

以下代码示例向您展示了如何使用带有 AWS 软件开发套件 (SDK) 的 Amazon 简单通知服务。

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

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

**更多资源**
+  **[Amazon SNS 开发人员指南](https://docs.aws.amazon.com/sns/latest/dg/welcome.html)**——有关 Amazon SNS 的更多信息。
+ **[Amazon SNS API 参考](https://docs.aws.amazon.com/sns/latest/api/welcome.html)**——有关所有可用的 Amazon SNS 操作的详细信息。
+ **[AWS 开发者中心](https://aws.amazon.com/developer/code-examples/?awsf.sdk-code-examples-product=product%23sns)** — 您可以按类别或全文搜索筛选的代码示例。
+ **[AWS SDK 示例](https://github.com/awsdocs/aws-doc-sdk-examples)** — 包含首选语言完整代码的 GitHub 存储库。包括有关设置和运行代码的说明。

**Contents**
+ [基本功能](sns_code_examples_basics.md)
  + [开始使用 Amazon SNS](sns_example_sns_Hello_section.md)
  + [操作](sns_code_examples_actions.md)
    + [`CheckIfPhoneNumberIsOptedOut`](sns_example_sns_CheckIfPhoneNumberIsOptedOut_section.md)
    + [`ConfirmSubscription`](sns_example_sns_ConfirmSubscription_section.md)
    + [`CreateTopic`](sns_example_sns_CreateTopic_section.md)
    + [`DeleteTopic`](sns_example_sns_DeleteTopic_section.md)
    + [`GetSMSAttributes`](sns_example_sns_GetSMSAttributes_section.md)
    + [`GetTopicAttributes`](sns_example_sns_GetTopicAttributes_section.md)
    + [`ListPhoneNumbersOptedOut`](sns_example_sns_ListPhoneNumbersOptedOut_section.md)
    + [`ListSubscriptions`](sns_example_sns_ListSubscriptions_section.md)
    + [`ListTopics`](sns_example_sns_ListTopics_section.md)
    + [`Publish`](sns_example_sns_Publish_section.md)
    + [`SetSMSAttributes`](sns_example_sns_SetSMSAttributes_section.md)
    + [`SetSubscriptionAttributes`](sns_example_sns_SetSubscriptionAttributes_section.md)
    + [`SetSubscriptionAttributesRedrivePolicy`](sns_example_sns_SetSubscriptionAttributesRedrivePolicy_section.md)
    + [`SetTopicAttributes`](sns_example_sns_SetTopicAttributes_section.md)
    + [`Subscribe`](sns_example_sns_Subscribe_section.md)
    + [`TagResource`](sns_example_sns_TagResource_section.md)
    + [`Unsubscribe`](sns_example_sns_Unsubscribe_section.md)
+ [场景](sns_code_examples_scenarios.md)
  + [构建应用程序以将数据提交到 DynamoDB 表](sns_example_cross_SubmitDataApp_section.md)
  + [构建 Amazon SNS 应用程序](sns_example_cross_SnsPublishSubscription_section.md)
  + [为推送通知创建平台终端节点](sns_example_sns_CreatePlatformEndpoint_section.md)
  + [创建无服务器应用程序来管理照片](sns_example_cross_PAM_section.md)
  + [创建 Amazon Textract 浏览器应用程序](sns_example_cross_TextractExplorer_section.md)
  + [创建 Amazon SNS 主题，并发布消息](sns_example_sns_GettingStarted_048_section.md)
  + [创建并发布到 FIFO 主题](sns_example_sns_PublishFifoTopic_section.md)
  + [检测视频中的人物和对象](sns_example_cross_RekognitionVideoDetection_section.md)
  + [IoT Device Defender 入门](sns_example_iot_GettingStarted_079_section.md)
  + [Config 入门](sns_example_config_service_GettingStarted_053_section.md)
  + [将短信发布到主题](sns_example_sns_UsageSmsTopic_section.md)
  + [发布大型消息](sns_example_sns_PublishLargeMessage_section.md)
  + [发布 SMS 文本消息](sns_example_sns_PublishTextSMS_section.md)
  + [将消息发布到队列](sns_example_sqs_Scenario_TopicsAndQueues_section.md)
  + [使用 API Gateway 调用 Lambda 函数](sns_example_cross_LambdaAPIGateway_section.md)
  + [使用计划的事件调用 Lambda 函数](sns_example_cross_LambdaScheduledEvents_section.md)
+ [无服务器示例](sns_code_examples_serverless_examples.md)
  + [通过 Amazon SNS 触发器调用 Lambda 函数](sns_example_serverless_SNS_Lambda_section.md)