June 2018
Beginner to intermediate
394 pages
9h 2m
English
The FirebaseUser object returns the provider-specific data in the getProviderData method, using which we can access the information of a user:
FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser();if (user != null) { for (UserInfo profile : user.getProviderData()) { // unique id of the provider (ex: facebook.com) String providerId = profile.getProviderId(); // UID of the provider String uid = profile.getUid(); // Name, email address, and profile photo Url String name = profile.getDisplayName(); String email = profile.getEmail(); Uri photoUrl = profile.getPhotoUrl(); }; }
This code snippet explains the details of provider-based information for the logged in user. Using the UserInfo class, we ...
Read now
Unlock full access