How to save extra info during user signup process using firebase authentication

前端 未结 4 1302
悲哀的现实
悲哀的现实 2021-01-07 02:59

I\'m building a website where I\'ve integrated firebase authentication for login/signup of site users.

Users can login/signup via either email-password or mobile OTP

4条回答
  •  清酒与你
    2021-01-07 03:17

    First signup and onCompletemethod check if signup is successful.

         if (task.isSuccessful()) { 
       // String userId = task.getResult().getUser().getUid();
       //  get user unique id 
       // saveUserData()
        }
    

    get user unique id and use it as key and store data like

    applicationName->usersNode->userId->data
    

    check if data is stored successfully proceed to next activity or Home page else remove user from auth and ask him to retry again.

提交回复
热议问题