【发布时间】:2019-12-08 12:02:45
【问题描述】:
我首先使用 Firebase 创建带有电子邮件和密码的用户帐户,然后我更新了可以访问的个人资料图片 当前用户.getphotourl()。通过以下代码
mAuth.createUserWithEmailAndPassword(email, password)
.addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
if (task.isSuccessful()) {
// user account created successfully
showMessage("Account created");
// after we created user account we need to update his profile picture and name
updateUserInfo(name, pickedImgUri, mAuth.getCurrentUser());
} else {
// account creation failed
showMessage("account creation failed" + task.getException().getMessage());
regBtn.setVisibility(View.VISIBLE);
loadingProgress.setVisibility(View.INVISIBLE);
}
}
});
在主页中,现在显示用户图像和电子邮件。但是在下一个活动中,当我使用手机身份验证并输入代码,然后在 homeactivity 用户图像和电子邮件中都是空白的..
我想将用户电话号码用于以后的访问而不是登录。但我认为最好只为电话创建数据库,使用电话身份验证并在必要时检索电话号码。但是使用电话验证,旧电子邮件,配置文件网址被替换或发生类似错误。
我该如何解决?这是预期的行为吗?
【问题讨论】:
-
这个方法
updateUserInfo里面的代码是什么?
标签: java android firebase firebase-authentication