

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

# 为 Amazon Chime SDK 消息传递将移动设备端点注册为应用程序实例用户
<a name="register-endpoint"></a>

要接收推送通知，应用程序实例用户必须首先使用 [https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_identity-chime_RegisterAppInstanceUserEndpoint.html](https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_identity-chime_RegisterAppInstanceUserEndpoint.html) API 注册一台移动设备。他们必须通过能够访问设备操作系统的设备令牌的移动应用程序进行注册。

为确保应用程序实例用户有权访问 ARN 中列出的 Amazon Pinpoint 应用程序，用户必须有权调用 Amazon Pinpoint ARN 上的 `mobiletargeting:GetApp`。否则，Amazon Chime SDK 在调用 [https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_identity-chime_RegisterAppInstanceUserEndpoint.html](https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_identity-chime_RegisterAppInstanceUserEndpoint.html) 时会引发 403 禁止错误。

此示例介绍了注册终端节点所需的策略。

------
#### [ JSON ]

****  

```
{ 
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Sid": "PermissionToRegisterEndpoint",
            "Effect": "Allow",
            "Action": "chime:RegisterAppInstanceUserEndpoint",
            "Resource": "arn:aws:chime:us-east-1:123456789012:app-instance/app_instance_id/user/app_instance_user_id"
        },
        {
            "Sid": "PermissionToGetAppOnPinpoint",
            "Effect": "Allow",
            "Action": "mobiletargeting:GetApp",
            "Resource": "arn:aws:mobiletargeting:us-east-1:123456789012:apps/project_id"
        }
    ]
}
```

------

**要注册终端节点**
+ 使用 Amazon Pinpoint ARN 和设备令牌调用 [https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_identity-chime_RegisterAppInstanceUserEndpoint.html](https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_identity-chime_RegisterAppInstanceUserEndpoint.html) API。