Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase FAuthData saved even after deletion of app [duplicate]

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.

like image 903
WYS Avatar asked Nov 08 '22 17:11

WYS


1 Answers

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

enter image description here

Following its a Sample code:

let ref = Firebase(url: "https://<YOUR-FIREBASE-APP>.firebaseio.com")
ref.removeUser("[email protected]", 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.

like image 185
Nitin Gohel Avatar answered Nov 15 '22 04:11

Nitin Gohel