【发布时间】:2017-01-04 12:38:37
【问题描述】:
您好,我在 iOS 中使用 AWS Mobile hub,我遵循了 aut with cognito 的介绍。它说我必须从示例中导入用户池文件。我这样做了,但这会给我一个错误:
extension SignInViewController: AWSCognitoIdentityPasswordAuthentication {
func getDetails(_ authenticationInput: AWSCognitoIdentityPasswordAuthenticationInput, passwordAuthenticationCompletionSource: AWSTaskCompletionSource<AnyObject>) {
self.passwordAuthenticationCompletion = passwordAuthenticationCompletionSource
}
func didCompleteStepWithError(_ error: Error?) {
if let error = error {
DispatchQueue.main.async(execute: {
UIAlertView(title: "ERROR",
message: error.localizedDescription,
delegate: nil,
cancelButtonTitle: "Ok").show()
})
}
}
}
错误:
类型“SignInViewController”不符合协议 'AWSCognitoIdentityPasswordAuthentication'
还有:
协议需要函数 'getDetails(_:passwordAuthenticationCompletionSource:)' 类型 '(AWSCognitoIdentityPasswordAuthenticationInput, AWSTaskCompletionSource) -> 无效';你想添加一个存根吗? (AWSCognitoIdentityProvider.AWSCognitoIdentityPasswordAuthentication)
和:
候选人的类型不匹配 '(AWSCognitoIdentityPasswordAuthenticationInput, AWSTaskCompletionSource) -> ()'
【问题讨论】:
标签: ios amazon-web-services swift3 aws-mobilehub