How to get userID by user Email Firebase android?

前端 未结 5 1639
夕颜
夕颜 2020-12-29 11:58

Given a email address, is it possbile to get userID of a person? For example,

If I have a variable email that has email of the person. Can I get their ID by doing so

5条回答
  •  一整个雨季
    2020-12-29 12:26

    This way you can login user with email and password and retrieve id:

    FirebaseAuth.getInstance().signInWithEmailAndPassword(email,password).addOnSuccessListener(new OnSuccessListener() {
              @Override
              public void onSuccess(AuthResult authResult) {
                  FirebaseUser user = authResult.getUser();
              }
          });
    

提交回复
热议问题