I am implementing Google sign-in method to my app, but the app also requires a username just like social media. so should I give an add username option on the next screen when the user registers through google or is there any other method also to add the username option also in the app?
Asked
Active
Viewed 70 times
0
Alex Mamo
- 130,605
- 17
- 163
- 193
Nikhil Kumar
- 11
-
Please provide enough code so others can better understand or reproduce the problem. – Community Apr 16 '22 at 09:16
1 Answers
1
When you sign in to Firebase with the Google provider, the FirebaseUser object already contains the user name. You can simply read it by calling getDisplayName(). If you need "another" user name, then indeed you need a screen where you should let the user input that. Then you should get the user input and save it either in Firestore or in the Realtime Database, so you can later use it in your app's code.
Alex Mamo
- 130,605
- 17
- 163
- 193