本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
將行動裝置端點註冊為應用程式執行個體使用者
若要接收推送通知,應用程式執行個體使用者必須先使用 RegisterAppInstanceUserEndpointAPI 註冊行動裝置。他們必須從可以訪問設備操作系統設備令牌的移動應用程序進行註冊。
若要確保應用程式執行個體使用者能夠存取 ARN 中列出的 Amazon Pinpoint 應用程式,使用者必須擁有在 Amazon Pinpoint ARN mobiletargeting:GetApp
上呼叫的權限。否則,Amazon Chime SDK 在調用RegisterAppInstanceUserEndpoint時拋出 403 禁止錯誤。
此範例顯示註冊端點所需的策略。
{ "Version": "2012-10-17", "Statement": [ { "Sid": "PermissionToRegisterEndpoint", "Effect": "Allow", "Action": "chime:RegisterAppInstanceUserEndpoint", "Resource": "arn:aws:chime:
region
:aws_account_id
:app-instance/app_instance_id
/user/app_instance_user_id
" }, { "Sid": "PermissionToGetAppOnPinpoint", "Effect": "Allow", "Action": "mobiletargeting:GetApp", "Resource": "arn:aws:mobiletargeting:region
:aws_account_id
:apps/project_id
" } ] }
註冊端點
使用 Amazon Pinpoint ARN 和您的設備令牌來調用 API。RegisterAppInstanceUserEndpoint