简体   繁体   English

使用AWS开发工具包iOS登录AWS控制台

[英]Signing In to AWS console using AWS SDK iOS

I'm currently exploring AWS SNS, to integrate AWS SNS using AWS iOS SDK. 我目前正在探索AWS SNS,以使用AWS iOS SDK集成AWS SNS。

The guide shows that we have to use Amazon Cognito for authentication and then we can register the device token in the application created in AWS SNS. 该指南显示,我们必须使用Amazon Cognito进行身份验证,然后才能在AWS SNS中创建的应用程序中注册设备令牌。

Guide that I'm following - https://medium.com/aws-activate-startup-blog/a-guide-to-amazon-simple-notification-service-mobile-push-self-registration-for-ios-a2502e8d5fbd#.mt7t7ed89 我正在遵循的指南-https: //medium.com/aws-activate-startup-blog/a-guide-to-amazon-simple-notification-service-mobile-push-self-registration-for-ios-a2502e8d5fbd #.mt7t7ed89

After integrating this in my project - I get this error: 将其集成到我的项目中后-我收到此错误:

Error 
Domain=com.amazonaws.AWSSNSErrorDomain 
Code=1 "The operation couldn’t be completed. (com.amazonaws.AWSSNSErrorDomain error 1.)" 
UserInfo=0x12847e0 
{   
    Type=Sender, 
    Message=User: arn:aws:sts::xxxxxxxxx:assumed-role/xxxxxxxxxxxxxxx/CognitoIdentityCredentials is not authorized to perform: SNS:CreatePlatformEndpoint on resource: arn:aws:sns:ap-south-1:xxxxxxxxx:app/xxxxxxxxxxxxxxxxxxxx, 
    __text=(
    "\n    ",
    "\n    ",
    "\n    ",
    "\n  "
    ),
Code=AuthorizationError}

So please help me out to proceed. 所以请帮我继续。

Let me know steps to integrate AWS APIs for Authentication Flow in iOS. 让我知道在iOS中集成AWS API进行身份验证流程的步骤。

Thanks. 谢谢。

I'm sorry that you're having trouble with this. 抱歉您遇到了麻烦。
Do check if you have added SNS:CreatePlatformEndpoint to the policy for both Auth and Unauth roles on the specified resource. 请检查是否已将SNS:CreatePlatformEndpoint添加到指定资源上的Auth和Unauth角色的策略中。

It should look something like... 它看起来应该像...

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "sns:CreatePlatformEndpoint"
            ],
            "Resource": [
                "arn:aws:sns:ap-south-1:xxxxxxxxx:app/xxxxxxxxxxxxxxxxxxxx"
            ]
        }
    ]
} 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM