Firebase: How to keep an Android user logged in?

前端 未结 4 1670
猫巷女王i
猫巷女王i 2021-02-05 11:53

I\'m using Firebase SimpleLogin to enable Email / Password authentication. Creation of users and subsequent login is all working fine. However, whenever I leave the app (even if

4条回答
  •  悲哀的现实
    2021-02-05 12:41

    [Engineer at Firebase] In order to transparently handle persistent sessions in the Firebase Simple Login Java client, you need to use the two-argument constructor which accepts an Android context, i.e. SimpleLogin(com.firebase.client.Firebase ref, android.content.Context context) every time you instantiate the Simple Login Java client.

    See https://www.firebase.com/docs/java-simple-login-api/javadoc/com/firebase/simplelogin/SimpleLogin.html for the full API reference.

提交回复
热议问题