![](/img/trans.png)
[英]How do I get the user's name, email, and profile picture when the user logs in with their Facebook account?
[英]How to add user's full name and profile picture on logined user of firebase using android Studio
我为 Firebase 使用 OTP 移动身份验证编写代码,但我想添加用户名字段和用户个人资料图片上传部分,但我不知道该怎么做? 我试图到处寻找但没有找到我发现是用于电子邮件密码身份验证而不是用于移动 OTP 身份验证的任何人都可以告诉我如何在 firebase 中添加用户的全名和用户个人资料图片并检索它吗?
创建帐户后,您可以通过调用user.updateProfile
来更新用户的个人资料。 从那个链接:
FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser();
UserProfileChangeRequest profileUpdates = new UserProfileChangeRequest.Builder()
.setDisplayName("Jane Q. User")
.setPhotoUri(Uri.parse("https://example.com/jane-q-user/profile.jpg"))
.build();
user.updateProfile(profileUpdates)
.addOnCompleteListener(new OnCompleteListener<Void>() {
@Override
public void onComplete(@NonNull Task<Void> task) {
if (task.isSuccessful()) {
Log.d(TAG, "User profile updated.");
}
}
});
您需要在项目中添加 firebase 实时数据库/ Firebase Firestore 和 Firebase Storage Z8A5DA52ED126421A8A359。 并在注册时
和需要检索数据的活动使用 Glide lib 来加载图像并检索名称
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.