in my app the user logged in using phone number auth from firebase , after logged he can add his email from profile fragment , i want to verify this email by sending email link from firebase but the problem always Failed to send the email, i dont know why
this is my code
btn.setOnClickListener {
firebaseUser.sendEmailVerification()
.addOnSuccessListener {
Toast.makeText(requireContext(), "is Success!!!", Toast.LENGTH_SHORT).show()
}
.addOnFailureListener {
Toast.makeText(requireContext(), "is Failure!!!", Toast.LENGTH_SHORT).show()
}
}
and i have enable email link and Email/Password auth in firebase , What could be the problem?
The sendEmailVerification
method returns a Task
. When a task fails, it contains an exception with details on the root cause of that failure. If you log the exception, you can find out what went wrong.
...
}.addOnFailureListener { exception ->
...
}
My first guess is that you’re hitting rate limits by repeated testing btw, but the details of the exception will confirm (or deny) that.