Answer the question
In order to leave comments, you need to log in
Why is displayName null after setting the value?
Good afternoon. I implement user registration using mail and password. Set username via
UserProfileChangeRequest request = new UserProfileChangeRequest.Builder()
.setDisplayName(name).build();
user.updateProfile(request);
public void registerUserWithEmailAndPassword(String name, String email, String password){
auth.createUserWithEmailAndPassword(email, password)
.addOnSuccessListener(authResult -> {
FirebaseUser user = authResult.getUser();
UserProfileChangeRequest request = new UserProfileChangeRequest.Builder()
.setDisplayName(name).build();
user.updateProfile(request);
db.collection(UserCollection.COLLECTION_NAME)
.document(user.getUid()).set(user);
message.postValue(R.string.user_has_been_added);
})
.addOnFailureListener(exception -> {
});
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question