1.
override fun onVerificationFailed(e: FirebaseException) {
// This callback is invoked in an invalid request for verification is made,
// for instance if the the phone number format is not valid.
//Log.w("phonepart", "onVerificationFailed", e)
if (e is FirebaseAuthInvalidCredentialsException) {
et_new_member_join_phone.error = "잘못된 폰 넘버입니다"
bt_confirm_phonenumber.isClickable = true
bt_confirm_phonenumber.text = "재요청"
} else if (e is FirebaseTooManyRequestsException) {
// The SMS quota for the project has been exceeded
et_new_member_join_phone.error = "요청회수가 초과되었습니다"
bt_confirm_phonenumber.isClickable = true
bt_confirm_phonenumber.text = "재요청"
}
else if(e is FirebaseAuthException)
{
et_new_member_join_phone.error = "가상 장치에서는 인증할 수 없습니다"
bt_confirm_phonenumber.isClickable = true
bt_confirm_phonenumber.text = "재요청"
}
}
2.
fireauth.signInWithEmailAndPassword(email, "grabage")
.addOnCompleteListener { task ->
if(!task.isSuccessful)
{
with(task.exception)
{
when(this) {
is FirebaseAuthInvalidUserException -> {
responseObserver(false)
}
else -> {
responseObserver(true)
}
}
}
}
}