删除应用后,Firebase FAuthData即被保存

WYS*_*WYS 5 ios firebase swift

想知道Firebase在删除应用后如何知道该设备属于哪个用户?

即使在我删除应用程序后,当我再次安装它时,它也知道用户.

我在文档中找不到任何关于此的内容.

Nit*_*hel 1

Firebase 不会监视用户卸载应用程序或安装应用程序,并且会根据其后端保存数据。您需要为基于 firebased API 的所有功能工作编写代码。

https://www.firebase.com/docs/ios/api/#firebase_createUserpasswordwithValueCompletionBlock

https://www.firebase.com/docs/ios/guide/login/password.html

在此输入图像描述

下面是示例代码:

let ref = Firebase(url: "https://<YOUR-FIREBASE-APP>.firebaseio.com")
ref.removeUser("bobtony@example.com", password: "correcthorsebatterystaple",
    withCompletionBlock: { error in
    if error != nil {
        // There was an error processing the request
    } else {
        // removed successfully
    }
})
Run Code Online (Sandbox Code Playgroud)

因此,您需要添加一个名为“删除用户”或“删除用户”的按钮,并且在该按钮操作上,您需要触发上述代码以从 firebase 数据库中删除用户。因此,当用户再次安装应用程序并尝试登录时,会发现未找到记录,并且用户需要再次注册您的应用程序才能重新登录。