Firebase Android onAuthStateChanged called twice

前端 未结 6 1114
忘了有多久
忘了有多久 2020-12-02 20:16

I\'ve start working with new Firebase SDK.

When I\'m doing user login, I\'m onAuthStateChanged method is being called twice with same state (etc. user sign in).

6条回答
  •  隐瞒了意图╮
    2020-12-02 20:28

      try{
           FirebaseAuth.getInstance().signOut();
           FirebaseInstanceId.getInstance().deleteInstanceId();
       }catch (Exception ex){
           ex.printStackTrace();
       }
    

    When user logout from gmail then the user should also be logout from firebase. This is how I resolved this issue.

提交回复
热议问题