사용자의 유효성을 어떻게 확인할 수 있습니까?사용자의 유효성을 어떻게 확인할 수 있습니까?
private void firebaseAuthWithGoogle(final GoogleSignInAccount acct, final GoogleSignInResult result) {
AuthCredential credential = GoogleAuthProvider.getCredential(acct.getIdToken(), null);
mAuth.signInWithCredential(credential)
.addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
if (task.isSuccessful()) {
//HOW CAN I validate user is already signup or not
if (Singup == true) {
did not create account.
} else {
create account;
}
} else {
// If sign in fails, display a message to the user.
Log.w(TAG, "signInWithCredential:failure", task.getException());
Toast.makeText(Login.this, "Authentication failed.",
Toast.LENGTH_SHORT).show();
// updateUI(null);
}
}
});
}
이 문제를 해결할 수 있도록 도와주세요. 사용자가 이미 존재하거나 매번 계정이없는 경우 계정을 만듭니다.
확인에이 게시물을
if (Singup == true) { // did not create account. } else { // create account; }
을 대체 할 수 있습니다. com/questions/43030237/firebase-check-email-registered-if-login-via-fac eBook-and-google 사용자가 Firebase Database를 사용하여 새로운 것이거나 기존인지를 추적 할 수 있습니다. 그 메커니즘을 구축해야합니다. – bojeil