My code:
PhoneAuthProvider.getInstance().verifyPhoneNumber(
phoneNumber, // Phone number to verify
60, // Timeout duration
TimeUnit.SECONDS, // Unit of timeout
this, // Activity (for callback binding)
new PhoneAuthProvider.OnVerificationStateChangedCallbacks() {
@Override
public void onVerificationCompleted(PhoneAuthCredential phoneAuthCredential) {
}
@Override
public void onVerificationFailed(FirebaseException e) {
}
@Override
public void onCodeSent(String s, PhoneAuthProvider.ForceResendingToken forceResendingToken) {
super.onCodeSent(s, forceResendingToken);
otpSent = s;
Log.d("AuthTest", "code sent!");
}
});
Here the phone number is entered in international format (+91 and 10 digits for India). Here, onCodeSent is not called if the user selects a valid phone number of his choice. On the other hand, if I go to Firebase console and enter a phone number for testing,
onCodeSent is executed.
I was following a YouTube tutorial here. Many people have asked this developer about the same problem "OTP (i.e, verification code) is not received". Author has not responded.
What's happening here? Has Firebase changed anything or set a limitation on free accounts, or am I missing something?