How do I set the displayName of Firebase user?

前端 未结 3 1889
时光说笑
时光说笑 2020-12-29 05:20

According to the JS Auth documentation on the Firebase website, it only shows how to get the displayName and how to update displayName. So I tried to update it. But

3条回答
  •  旧巷少年郎
    2020-12-29 05:31

    I could´t use ({displayName: name}) directly (sintaxe error in editor). Then, I found another way:

    UserUpdateInfo updateInfo = UserUpdateInfo();
    updateInfo.displayName = name;
    result.user.updateProfile(updateInfo);
    

    This is in Dart (I am using Firebase with Flutter).

提交回复
热议问题