My Question:
I made a little Android App, where you can sign up and login with the firebase auth system. I made it like:
private FirebaseAuth firebaseAuth;
firebaseAuth = FirebaseAuth.getInstance()
then i used firebaseAuth.signinwithEmailAndPassword. Now my question: can i get the First name and the Last name from the user's email account? Like in youtube at the comments: example:
Firstname Lastname: Nice video
That not the email address is here, but the First and Last name, Greetings
You can get the user's name from their profile. From the Firebase documentation on reading the user profile:
To get a user's profile information, use the accessor methods of an instance of
FirebaseUser
. For example:FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser(); if (user != null) { // Name, email address, and profile photo Url String name = user.getDisplayName(); String email = user.getEmail(); Uri photoUrl = user.getPhotoUrl(); // Check if user's email is verified boolean emailVerified = user.isEmailVerified(); // The user's ID, unique to the Firebase project. Do NOT use this value to // authenticate with your backend server, if you have one. Use // FirebaseUser.getToken() instead. String uid = user.getUid(); }
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