I use authentication firebase to login and logout(by email/password). Now I would like to add information in this user(Name, age,...) ? How to do it? Please help me . Thanks
Asked
Active
Viewed 100 times
0
-
check this http://stackoverflow.com/questions/37415863/firebase-setting-additional-user-properties/37420701#37420701 – tompadre May 03 '17 at 13:32
1 Answers
0
After you log in the user , you can update his info using this method:
FirebaseUser mFirebaseUser = mFirebaseAuth.getCurrentUser();
mFirebaseUser.updateProfile(new UserProfileChangeRequest.Builder()
.setDisplayName("Someone")
.setPhotoUri(someImageUri)
.build());
For additional fields you would have to create entries in the Realtime DB.

Hristo Stoyanov
- 1,960
- 1
- 12
- 24
-
It adds the info into the internal firebase profile system (aka. the FirebaseUser) , the only limitation is you can only add name and photo. – Hristo Stoyanov May 03 '17 at 14:06
-
oh, how to get id of from authentication to add new Node in database ? after that i can add Name,age,image, description . I am sorry if you don't understand because I am new android and my english is not good :) – Thuận Trần May 03 '17 at 14:10
-