In my Android app, I am creating user and sending verification email. I want to proceed to the next page when the user has verified by clicking the link in the email received. However, the verification status didn't update so I cannot proceed. I have tried signing out and signing in again which works but I don't want to refresh the status in this way. Any ideas?
Here is my code:
public void onClickContinueBtn() {
final FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser();
user.reload().addOnCompleteListener(new OnCompleteListener<Void>() {
@Override
public void onComplete(@NonNull Task<Void> task) {
if(task.isSuccessful()) {
if(!user.isEmailVerified()){
// not verified block
// get into here even if verified
} else {
// email verified, go to next page
}
} else {
// do nothing, or show error
}
}
});
}