1

I am working on an app in which I have used firebase database & auth for the user authentication. Now when I logged in with a user id and delete the app from the iPhone, when I again install the app it automatically takes me to the home screen without the login procedure.

I am not able to understand why it is not asking for the user to login after the app is installed again. As according to my knowledge iPhone saves these types of things in the sandbox & when we delete the app its sandbox is also deleted & a new one is created when we install the app again.

Anyone who can help me to figure out this issue?

Thanks In Advance

Anshul Bhatheja
  • 673
  • 3
  • 21

1 Answers1

4
  • This is not the iOS problem.
  • Reality is if we keep things inside keychain they can be accessed back after app reinstall,So if you want to maintain a login session don't use the one provided firebase logic that will behave like same.
  • use UserDefaults to keep a bool value to check if user is logged in.
  • By doing this you will face no problem even if app is reinstalled.
Zeeshan Ahmed
  • 834
  • 8
  • 13
  • Thanks for your answer, I understood that firebase is using the keychain for the same but if the keychain sharing is off in the capabilities then how can firebase is able to access the keychain? – Anshul Bhatheja Apr 10 '19 at 11:56
  • dont know about that dear but firebase is doing this. I also do it this way. – Zeeshan Ahmed Apr 10 '19 at 11:59
  • 1
    Yes, I think the logic of the @ZeeshanAhmed is correct, but we all need to find how firebase using the keychain, if anyone knows about this mention in comments. – Nicky Apr 10 '19 at 12:25