作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
注销 iOS 应用程序后,当我以新用户身份登录时,getIdentityId() 返回前一个用户的 Cognito Id。
有人在 iOS 中获得了使用 AWSCognito 的多用户帐户吗?
最佳答案
Cognito Id 存储在钥匙串(keychain)中。您可以使用 AWS iOS SDK 清除钥匙串(keychain)以完全摆脱旧的 Cognito Id。例如:
// check if a Cognito Id exists
if identityProvider.identityId != nil { // AWSCognitoCredentialsProvider
// delete the old Cognito Id
identityProvider.clearKeychain()
assert(identityProvider.identityId == nil)
}
// Get a new Cognito identity
let task: AWSTask = identityProvider.getIdentityId()
task.continueWithBlock { (task) -> AnyObject? in
if let error = task.error {
completion(error: error)
} else {
// The new cognito identity token is now stored in the keychain.
}
}
关于amazon-cognito - 如何从 ios 缓存中清除 Cognito Id,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39546435/
我是一名优秀的程序员,十分优秀!