Reputation: 93
Following some guides and youtube videos, I made a login with Google and an activity profile what show my username, image profile email, using:
String name = user.getDisplayName();
String email = user.getEmail();
Uri photoUrl = user.getPhotoUrl();
I've also made another activity to update the username with another typed by me. But here is my question. All this info, where is saved?
In my database i dont have nothing. all empty. I think the info is saved in local but it-s not. I tested my app with both in my smartphone and on my pc. If i change my username in my pc, then i can see the update in my smartphone.
The info about the currentuser, where is stored?
Upvotes: 4
Views: 45
Reputation: 180
For most of the authentication protocols it supports, Firebase doesn't store user data anywhere. Even for the protocols where it does store data (I only know of email+password doing this), it stores this information in a place that your application can't access (though you can find those users in the dashboard of your Firebase).
To quote the Firebase documentation:
Upvotes: 0
Reputation: 139029
The user
object on which you are calling those methdos: getDisplayName()
, getEmail()
and getPhotoUrl()
is of type FirebaseUser and you are getting this kind of object from the authentication process, more preciselly by calling getCurrentUser()
method on the firebaseAuth
object like this:
FirebaseUser firebaseUser = firebaseAuth.getCurrentUser();
But before that you need to instantiate the firebaseAuth
object by calling the static FirebaseAuth.getInstance() method like this:
FirebaseAuth firebaseAuth = FirebaseAuth.getInstance();
As you can see in the offical documentation of FirebaseUser
class, beside of getting the data, you can also update it using the different types of methods. This data is not added to the database unless you add it yourself. This is a common practice when you need to have more details about the user (others that are provided by the FirebaseUser object).
Upvotes: 1
Reputation: 1859
It is saved in Firebase Authentication module, which has limited fields available. If you need to see the information, it is in your Firebase Console, under Authentication option in the side menu.
Upvotes: 1