0
我正在构建使用Amazon MobileHub的iOS应用程序。目前它与Cognito相关联,注册和登录流程非常好。AWS Cognito检查并获取用户
我想实现的目标是让一个用户能够添加另一个用户作为的朋友可以这么说。为了做到这一点,我需要检查具有特定用户名的用户是否存在,如果有,请获取某些属性,如该用户的名称。
我试过使用获取用户>获取详细信息功能,但它给了我一个错误认证代理没有设置。
这是我使用的代码:
var pool: AWSCognitoIdentityUserPool?
let user = pool?.getUser(usernameField.text!)
self.pool = AWSCognitoIdentityUserPool.init(forKey: AWSCognitoUserPoolsSignInProviderKey)
user?.getDetails().continueWith { (task: AWSTask<AWSCognitoIdentityUserGetDetailsResponse>) -> Any? in
if let error = task.error as NSError? {
print("ERROR: " + error.localizedDescription)
return ""
}
print(task.result)
return ""
}
我想到的一个方法是存储用户名,我想访问DynamoDB,然后访问它存在的属性,但将只创建双不必要的条目。