即使删除应用程序也保存了Firebase FAuthData [英] Firebase FAuthData saved even after deletion of app

查看:41
本文介绍了即使删除应用程序也保存了Firebase FAuthData的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

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

解决方案

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

以下是示例代码:

 让ref = Firebase(URL:"https://< YOUR-FIREBASE-APP> .firebaseio.com")ref.removeUser("bobtony@example.com",密码:"correcthorsebatterystaple",withCompletionBlock:{错误如果错误!= nil {//有一个错误处理请求} 别的 {//成功删除}}) 

因此,您需要添加一个名为删除用户"或删除用户"的按钮,并且在该按钮操作上,需要触发上述代码以从Firebase数据库中删除用户.因此,当用户再次安装应用并尝试登录时,找不到重新记录的内容,用户需要再次向您的应用注册才能重新登录.

Been wondering how Firebase knows which user the device belongs to after app has been deleted?

Even after I delete the app, when I install it again, it knows the user.

I can't find in the documentation anything about this.

解决方案

Firebase does not watch on user uninstall app or install app and that saved the data based on it's backend. You need to do code for all the funtional work based on firebased API.

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

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

Following its a Sample code:

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
    }
})

So you need to add one button called Delete user or Remove user and on that button action you need to fire above code for delete user from firebase database. So when user install app again and try to login there recored not found and user need to register again with your app to logged in back.

这篇关于即使删除应用程序也保存了Firebase FAuthData的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆