Firebase only saves the user's email. I want to keep his name.
How to do it?
Here is some of my code with which I create and register a user:
public void loginByEmailMethod() {
ref.createUser(email, password, new Firebase.ValueResultHandler<Map<String, Object>>() {
@Override
public void onSuccess(Map<String, Object> result) {
System.out.println("Successfully created user account with uid: " + result.get("uid"));
Toast.makeText(getBaseContext(), "Account successfully created!", Toast.LENGTH_LONG).show();
}
@Override
public void onError(FirebaseError firebaseError) {
Toast.makeText(getBaseContext(), "Account not created!", Toast.LENGTH_LONG).show();
}
});
Handler handler = new Handler();
handler.postDelayed(new Runnable() {
@Override
public void run() {
ref.authWithPassword(email, password, new Firebase.AuthResultHandler() {
@Override
public void onAuthenticated(AuthData authData) {
System.out.println("User ID: " + authData.getUid() + ", Provider: " + authData.getProvider());
Intent mainActivityIntent = new Intent(SignupScreenActivity.this, MainActivity.class);
startActivity(mainActivityIntent);
Toast.makeText(getBaseContext(), "User logged in successfully!", Toast.LENGTH_LONG).show();
}
@Override
public void onAuthenticationError(FirebaseError firebaseError) {
Toast.makeText(getBaseContext(), "User not logged in!", Toast.LENGTH_LONG).show();
progressDialog.dismiss();
}
});
}
}, 2000);
}
The problem is that with this method I can save only the email address of the user, not his / her name.
Please let me know how I can save the name along with the email.
Thanks in advance.
user4909407
source
share