我是AWS移动中心的新手,并且真的很困惑。我在移动集线器中有一个数据库,并且能够访问它。现在我想添加登录视图。我创建了一个池,其中包含一些通过移动集线器输入并集成的用户帐户。我按照AWS中的指南,在viewdidload中调用UI中的构建。运行时,实际会弹出登录UI,并可以检测用户名和密码是否不匹配。但是,我按下登录按钮,没有任何反应,永远留在登录视图上。任何人都熟悉这种情况吗?
if !AWSSignInManager.sharedInstance().isLoggedIn {
AWSAuthUIViewController.presentViewController(with: self.navigationController!,
configuration: nil,
completionHandler: { (provider: AWSSignInProvider, error: Error?) in
if error != nil {
print("Error occurred: \(String(describing: error))")
} else {
print("Sign in successful.")
}
})
}
委托与指南相同
class AppDelegate:UIResponder,UIApplicationDelegate {
func application(_ application: UIApplication, open url: URL,
sourceApplication: String?, annotation: Any) -> Bool {
return AWSMobileClient.sharedInstance().interceptApplication(
application, open: url,
sourceApplication: sourceApplication,
annotation: annotation)
}
func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions:
[UIApplicationLaunchOptionsKey: Any]?) -> Bool {
return AWSMobileClient.sharedInstance().interceptApplication(
application, didFinishLaunchingWithOptions:
launchOptions)
}
}
错误无法获取ID
由于
答案 0 :(得分:0)
看起来您需要查看您的Cognito用户/角色政策,问题是您的用户池不支持未经身份验证的访问