我现在已经使用过 Firebase serval times 并且知道如何正确使用它。 我相信我偶然发现了一个错误,如果您有错误,我很乐意听到解决方案。
所以 - 我使用了 Firebase Google 身份验证并且它工作正常,然后我决定使用电子邮件 + 密码方法。 现在这是奇怪的部分 - 我创建了一个用户,我得到了成功的结果,但它没有保存用户 - 在 Autherecation 面板中看不到它 + 注销后无法与用户一起登录。
mLoginContainer.setVisibility(View.GONE);
mLoginProgress.setVisibility(View.VISIBLE);
mAuth.createUserWithEmailAndPassword(email,password).addOnCompleteListener(new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
if(task.isSuccessful())
Toast.makeText(LoginActivity.this,"",Toast.LENGTH_SHORT).show();
else
Toast.makeText(LoginActivity.this,"",Toast.LENGTH_SHORT).show();
mLoginContainer.setVisibility(View.VISIBLE);
mLoginProgress.setVisibility(View.GONE);
}
});
最佳答案
您需要在 firebase 控制台上启用电子邮件/密码。
Click here for Firebase Auth Doc
How to enable E-mail/password sign-in:
In the Firebase console, open the Auth section.
On the Sign in method tab, enable the Email/password sign-in method and click Save.
希望对你有帮助
关于android - Firebase 密码注册不保存用户,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45448806/