See screen recording.
Before the robots verification in browser opens, this is logged: "SafetyNet Attestation fails basic integrity".
This app is not published to Google Play, just testing in Emulator and on physical Android devices.
After the recaptcha returns, codeSent
returns and the other verifyPhoneNumber()
params work just fine.
await FirebaseAuth.instance.verifyPhoneNumber(
phoneNumber: '$_countryCode$_phoneNumber',
verificationCompleted:(PhoneAuthCredential credential) {
print('verificationCompleted');
},
verificationFailed: (FirebaseAuthException e) {
print('verificationFailed');
},
codeSent: (String verificationId, int resendToken) {
print('codeSent');
},
codeAutoRetrievalTimeout: (String verificationId) {
print('codeAutoRetrievalTimeout');
},
);
[
Firebase Phone Auth has been updated since I last used it.
The docs state:
reCAPTCHA verification: In the event that SafetyNet cannot be used, such as when the user does not have Google Play Services support, or when testing your app on an emulator, Firebase Authentication uses a reCAPTCHA verification to complete the phone sign-in flow.
It was surprising to me to see the reCAPTCHA after not having seen it prior and so I thought I had some settings incorrect somewhere.
Just a good safety feature and works seamlessly with Firebase Phone Auth.
Another thing to note is that this problem still occurs on a real device when Android Device Verification is not enabled in Google Cloud Platform.
The docs state:
In the Google Cloud Console, enable the Android DeviceCheck API for your project. The default Firebase API Key will be used, and needs to be allowed to access the DeviceCheck API.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With