I am making an app with firebase auth functionality for signing in and signing up . When I was searching , I came upon FireBase UI which seemed good . When I saw the auth documentation , the create user method accepted only Email ID and password , but the Firebase UI gets the First and last name of the user too. What does it do with the name entered? Is it stored somewhere in the auth or database or is it just for showcase? If I implement my own UI for sign up , can I add more details than just email id and password ?
I am one of the developers of FirebaseUI.
In order to save the display name, FirebaseUI issues a UserProfileChangeRequest
after sign in:
FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser();
UserProfileChangeRequest profileUpdates = new UserProfileChangeRequest.Builder()
.setDisplayName("Jane Q. User")
.setPhotoUri(Uri.parse("https://example.com/jane-q-user/profile.jpg"))
.build();
user.updateProfile(profileUpdates)
.addOnCompleteListener(new OnCompleteListener<Void>() {
@Override
public void onComplete(@NonNull Task<Void> task) {
if (task.isSuccessful()) {
Log.d(TAG, "User profile updated.");
}
}
});
This allows for the storage of some basic fields like display name and photo URL. For custom fields, you will need to store the information in the Firebase Realtime Database.
https://firebase.google.com/docs/auth/android/manage-users#update_a_users_profile
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With