> ## Documentation Index
> Fetch the complete documentation index at: https://documentation.onesignal.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Amazon：生成 Amazon API 密钥

> 分步指南

所有 **Amazon** 应用程序都需要 Amazon API 密钥。

## 要求：

* 一个 Amazon 应用程序。
* 一个 [Amazon Developer 账户](https://developer.amazon.com/login.html)。
* 一个 [OneSignal 账户](https://onesignal.com/)（如果您还没有的话）。

<Steps titleSize="h2">
  <Step title="创建安全配置文件">
    登录您的 [Amazon Developer 帐户](https://developer.amazon.com/login.html)并选择您的应用。

    点击 **Device Messaging** 选项卡，然后点击 **Create a New Security Profile**。

    <Frame>
      <img src="https://mintcdn.com/onesignal/tc0EvmtSSX56SX0c/images/docs/92REq7thRFiW728xOiNS_AmazonSecurityProfile1.png?fit=max&auto=format&n=tc0EvmtSSX56SX0c&q=85&s=f9bcc17153bcd37e78ace556b5c6b2e3" width="976" height="573" data-path="images/docs/92REq7thRFiW728xOiNS_AmazonSecurityProfile1.png" />
    </Frame>

    为您的安全配置文件提供所需的名称和描述，然后点击保存。

    <Frame>
      <img src="https://mintcdn.com/onesignal/RWtLFPeffHrC81wI/images/docs/aIDGySBrR7iFANxPak1L_AmazonSecurityProfile2.png?fit=max&auto=format&n=RWtLFPeffHrC81wI&q=85&s=51b2c5defe0c7574892e298475e9b37d" width="927" height="394" data-path="images/docs/aIDGySBrR7iFANxPak1L_AmazonSecurityProfile2.png" />
    </Frame>

    您应该会收到一系列成功消息。接下来，点击**查看安全配置文件**继续。

    <Frame>
      <img src="https://mintcdn.com/onesignal/6tscVAtiSqz353kV/images/docs/D4frRRzJQue8WZufNbDr_AmazonSecurityProfile3.png?fit=max&auto=format&n=6tscVAtiSqz353kV&q=85&s=0936b1b5aff5919fa3a8ede15b2bf06f" width="865" height="366" data-path="images/docs/D4frRRzJQue8WZufNbDr_AmazonSecurityProfile3.png" />
    </Frame>

    然后您将看到一个设置页面，列出您的**客户端 ID** 和**客户端密码**。保持此页面开放，因为您在步骤 2 中将需要此信息。

    <Frame>
      <img src="https://mintcdn.com/onesignal/6v_cVPknFpo5qSVB/images/docs/06k5hfGR5OtUjHqSvzHp_AmazonSecurityProfile4.png?fit=max&auto=format&n=6v_cVPknFpo5qSVB&q=85&s=861a5e61a21b3df438d16164c7a16389" width="912" height="341" data-path="images/docs/06k5hfGR5OtUjHqSvzHp_AmazonSecurityProfile4.png" />
    </Frame>
  </Step>

  <Step title="配置您的 OneSignal 应用程序的 Amazon 平台设置">
    在 OneSignal 仪表板中，从“所有应用”页面选择您的应用，然后转到设置。在原生应用平台下，点击 Amazon Fire。

    <Frame>
      <img src="https://mintcdn.com/onesignal/ciRrThfP6xMpI7GY/images/docs/0228067-settings-platforms-amazon.jpg?fit=max&auto=format&n=ciRrThfP6xMpI7GY&q=85&s=b13a44382021c0eda86d6a9ff7796f13" width="2480" height="1180" data-path="images/docs/0228067-settings-platforms-amazon.jpg" />
    </Frame>

    将您的客户端 ID 和客户端密码粘贴到字段中，然后点击保存。

    <Frame>
      <img src="https://mintcdn.com/onesignal/Z6xkXGfmy814If53/images/docs/d5e8d7e-settings-platforms-amazon-configure.jpg?fit=max&auto=format&n=Z6xkXGfmy814If53&q=85&s=2cbf928c8c4194421d8bbc5cfa68bb17" width="2480" height="1132" data-path="images/docs/d5e8d7e-settings-platforms-amazon-configure.jpg" />
    </Frame>
  </Step>

  <Step title="创建 Amazon API 密钥">
    在将您的应用发布到 Amazon App Store 之前，需要按照以下步骤测试推送通知。

    返回您应用的 Amazon 安全配置文件页面，并选择 **Android/Kindle 设置**选项卡。

    为 **API 密钥名称**输入您喜欢的任何名称。

    输入您的 Android 包名。**注意**：包名区分大小写。

    输入您用于签名 APK 文件的 Android Keystore 的 MD5 签名。请参阅 [Amazon 的说明](https://developer.amazon.com/public/apis/engage/login-with-amazon/docs/android_app_signatures.html) 来获取此值。

    我们建议不使用默认的调试 keystore，但如果您使用，请确保使用您的生产 keystore 再次执行此操作，或让 Amazon 为您签名应用。

    完成后，点击 **Generate New Key**。

    <Frame>
      <img src="https://mintcdn.com/onesignal/6tscVAtiSqz353kV/images/docs/QmpjKGuXTnqb9BSTNyPA_AmazonSecurityProfile6.png?fit=max&auto=format&n=6tscVAtiSqz353kV&q=85&s=08ec7fa49a093ba5da1151c0b2e3d1b8" width="906" height="399" data-path="images/docs/QmpjKGuXTnqb9BSTNyPA_AmazonSecurityProfile6.png" />
    </Frame>

    复制结果中显示的**密钥**并将其保存到名为 `api_key.txt` 的新文件中。

    构建应用时，此文件需要位于 APK 根目录中的 `/assets/` 中。

    有关此文件放置的更多详细信息，可以在我们的 [Amazon SDK 设置](./amazon-sdk-setup) 文档中找到。

    <Frame>
      <img src="https://mintcdn.com/onesignal/KSCNwSpBCNSQ8xdF/images/docs/vFkWzWcASaSyBzMlF6ps_AmazonSecurityProfile7.png?fit=max&auto=format&n=KSCNwSpBCNSQ8xdF&q=85&s=84b572223fd92ee102ac1a4bb28a616d" width="910" height="612" data-path="images/docs/vFkWzWcASaSyBzMlF6ps_AmazonSecurityProfile7.png" />
    </Frame>
  </Step>
</Steps>

<Check>
  \*\*完成！\*\*您现在有了一个从您的应用程序发送推送通知的密钥。🥳
</Check>

接下来，在您的应用程序中安装 OneSignal SDK。如果您需要帮助，我们有一个指南：

* [Amazon SDK Setup](./amazon-sdk-setup)

***
