Во-первых, у меня правильно настроен проект Firebase и включены электронная почта и телефон. аутентификация, я также создал учетную запись для выставления счетов и использую подписку Blaze, я включил «проверку приложения», настроил SHA-1 и SHA-265, а также разрешил страны, которые могут получать OTP.
OTP отлично работает при тестировании мобильных устройств номера через эмулятор, но когда я использую свой личный номер в эмуляторе, я получаю следующие ошибки:
Код: Выделить всё
I/PlayCore( 7150): UID: [10149] PID: [7150] OnRequestIntegrityTokenCallback : onRequestIntegrityToken
I/PlayCore( 7150): UID: [10149] PID: [7150] IntegrityService : Unbind from service.
W/System ( 7150): Ignoring header X-Firebase-Locale because its value was null.
D/EGL_emulation( 7150): app_time_stats: avg=43.46ms min=28.52ms max=86.14ms count=23
E/FirebaseAuth( 7150): [SmsRetrieverHelper] SMS verification code request failed: unknown status code: 17028 Invalid app info in play_integrity_token
D/FirebaseAuth( 7150): Invoking original failure callbacks after phone verification failure for +962785522213, error - This app is not authorized to use Firebase Authentication. Please verify that the correct package name, SHA-1, and SHA-256 are configured in the Firebase Console. [ Invalid app info in play_integrity_token ]
Код: Выделить всё
void _sendOtp() async {
await _auth.verifyPhoneNumber(
phoneNumber: widget.phoneNumber,
verificationCompleted: (PhoneAuthCredential credential) async {
await _auth.currentUser!.linkWithCredential(credential);
_completeRegistration();
},
verificationFailed: (FirebaseAuthException e) {
// Log the error message
print("Verification failed: ${e.message}");
// Check if the error contains debug information (Play Integrity token)
if (e.message != null && e.message!.contains("Invalid app info")) {
print("Debugging Information:");
print(
"This error may indicate an issue with the Play Integrity token or SHA keys.");
print("Please check your Firebase Console and app configuration.");
}
},
codeSent: (String verificationId, int? resendToken) {
setState(() {
_verificationId = verificationId;
});
},
codeAutoRetrievalTimeout: (String verificationId) {
setState(() {
_verificationId = verificationId;
});
},
);
}
Подробнее здесь: https://stackoverflow.com/questions/793 ... ne-numbers