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.