I just implemented Firebase authUI
in an app but I\'d like my users to be able to have usernames/display names that aren\'t their names on those accounts, without f
By default, by login in with Google or Facebook you can assign to that user his name from the service that is using (google or facebook) but with FirebaseAuth once you are logged in you can display any sort of dialog requesting the user to complete a certain profile with data, name, birth date and more, and then just store that data inside that userID that is generated with Google-Facebook sign in and display that data to the user.
Yes you can. As @Gastón Saillén mentioned in his answer, when you first sing-in, you get the data from the registration provider but once you are signed in with Firebase, you can set a custom user name by updating the existing one using UserProfileChangeRequest.Builder.setDisplayName() method like this:
FirebaseUser firebaseUser = FirebaseAuth.getInstance().getCurrentUser();
UserProfileChangeRequest userProfileChangeRequest = new UserProfileChangeRequest.Builder()
.setDisplayName("aedgar777")
.build();
firebaseUser.updateProfile(userProfileChangeRequest).addOnCompleteListener(new OnCompleteListener<Void>() {
@Override
public void onComplete(@NonNull Task<Void> task) {
if (task.isSuccessful()) {
Log.d(TAG, "aedgar777 updated!");
}
}
});