[英]Firebase Tasks: sign in + create account
My app works with Firebase Authentication. 我的应用程序可与Firebase身份验证一起使用。 And when user starts app I need to add new user in Firebase, but I have 3 state:
当用户启动应用程序时,我需要在Firebase中添加新用户,但是我有3种状态:
For these 3 states, I must do the next: 对于这3个状态,我必须执行以下操作:
How to make the first item correctly using Tasks? 如何使用“任务”正确制作第一项? How to control errors?
如何控制错误?
I determine whether the signed user or not, using: 我使用以下方法确定是否已签名的用户:
mAuthListener = new FirebaseAuth.AuthStateListener() {
@Override
public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) {
user = firebaseAuth.getCurrentUser();
if (user != null) {
// User is signed in
firebaseAuthUser = true;
} else {
// User is signed out
firebaseAuthUser = false;
}
}
};
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.