ios - 无法从设备中删除 currentUser.uid

标签 ios swift firebase-authentication

Auth.auth().currentUser?.uid

无论用户是否作为经过身份验证的用户存在,此调用都会返回一个 uid。我尝试从 Firebase 门户网站的身份验证部分手动删除用户,并且尝试通过以下方式在 Swift 中删除用户:

Auth.auth().currentUser?.delete(completion: { (error) in

    print(error)
})

然后我收到这个错误:

Optional(Error Domain=FIRAuthErrorDomain Code=17011 "There is no user record corresponding to this identifier. The user may have been deleted." UserInfo={NSLocalizedDescription=There is no user record corresponding to this identifier. The user may have been deleted., error_name=ERROR_USER_NOT_FOUND})

即使在删除应用程序并在设备上重建它之后,uid 仍然存在。

我只需要在删除用户时清除 uid,但我这辈子都做不到。我真的需要能够在第一次使用该应用程序时测试全新的设备/帐户,这对于这个持久的 uid 是不可能的。我在这里缺少哪一步?

如果有帮助,我正在使用匿名用户帐户进行此操作。理想情况下,我将能够注册一个新的匿名帐户,并在每次从设备上删除它时看到它出现。

最佳答案

这可能是 Firebase Auth iOS 错误。我已经向 Firebase Auth 提交了一个错误。您可以做的是捕获该错误(当您尝试删除用户时)并在检测到用户时 signOut,这样他们就不会再保留了。

关于ios - 无法从设备中删除 currentUser.uid,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48846728/

相关文章:

ios - 在 Objective-C 中使用 NSPredicate 过滤自定义数据类的数组

swift - 使用 React native 框架的 Eddystone 信标扫描

ios - 来自 ViewController 外部的 Alamofire 请求

firebase - 具有电子邮件和密码身份验证的Firebase Dart

java - 如何检查电子邮件 ID 在 Firebase 中是否有效?

android - Firebase AB 测试 iOS 用户定位应用程序版本不起作用

ios - 让 View Controller 远离导航堆栈

iphone - 一种在大型 Xcode 项目中查找孤立图像的方法

ios - 字典中的自定义键

Firebase 身份验证 - 如何处理延迟