How does the firebase AuthStateListener work?

前端 未结 1 996
温柔的废话
温柔的废话 2020-12-06 10:59

I am developing an android app using firebase for user management and authentication. I was wondering when the auth state listener gets called and how it works, as in my app

相关标签:
1条回答
  • 2020-12-06 11:42

    As the Firebase API says:

    AuthStateListener is called when there is a change in the authentication state.

    OnAuthStateChanged gets invoked in the UI thread on changes in the authentication state:

    • Right after the listener has been registered
    • When a user is signed in
    • When the current user is signed out
    • When the current user changes
    • When there is a change in the current user's token (Notice this has been removed and moved to a separate listener, see FirebaseAuth.IdTokenListener)
    0 讨论(0)
提交回复
热议问题