get currently logged in user firebase auth code example
Example 1: firebase user name java
FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser();
if (user != null) {
String name = user.getDisplayName();
String email = user.getEmail();
Uri photoUrl = user.getPhotoUrl();
boolean emailVerified = user.isEmailVerified();
String uid = user.getUid();
}
Example 2: firebase auth get current user
var user = firebase.auth().currentUser;var name, email, photoUrl, uid, emailVerified;if (user != null) { name = user.displayName; email = user.email; photoUrl = user.photoURL; emailVerified = user.emailVerified; uid = user.uid;