I’m encountering an issue with Firebase Authentication in my Android application. Whenever I attempt to verify a phone number using Firebase Authentication, I receive the following error message:
This request is missing a valid app identifier, meaning that Play Integrity checks, and reCAPTCHA checks were unsuccessful.
I’ve thoroughly reviewed and implemented all necessary configurations, including proper integration of reCAPTCHA.
I’ve ensured that my project settings on the Firebase Console are correctly configured.
I’ve reviewed the source code related to phone authentication and verified the correct implementation of reCAPTCHA token passing.
Despite these efforts, the issue persists, and I’m unable to proceed with phone number verification in my application.
My code Java
private void startPhoneNumberVerification(String phoneNumber) {
Log.d(“PhoneNumberVerification”, “Iniciando verificação do número de telefone: ” + phoneNumber); // Log de depuração adicionado
PhoneAuthOptions options =
PhoneAuthOptions.newBuilder(firebaseAuth)
.setPhoneNumber(phoneNumber) // Número de telefone a ser verificado
.setTimeout(60L, TimeUnit.SECONDS) // Tempo limite da solicitação de verificação
.setActivity(this) // Atividade que iniciará a solicitação
.setCallbacks(new PhoneAuthProvider.OnVerificationStateChangedCallbacks() {
@Override
public void onVerificationCompleted(PhoneAuthCredential phoneAuthCredential) {
signInWithPhoneAuthCredential(phoneAuthCredential);
}
@Override
public void onVerificationFailed(FirebaseException e) {
Log.e("PhoneNumberVerification", "Falha na verificação do número de telefone", e); // Log de erro adicionado
Toast.makeText(Register.this, "Falha ao verificar o número de telefone", Toast.LENGTH_SHORT).show();
}
@Override
public void onCodeSent(String s, PhoneAuthProvider.ForceResendingToken forceResendingToken) {
super.onCodeSent(s, forceResendingToken);
verificationId = s;
Log.d("PhoneNumberVerification", "Código de verificação enviado com sucesso: " + verificationId); // Log de depuração adicionado
// Navega para a atividade OTPVerification para inserir o código de verificação
Intent intent = new Intent(Register.this, OTPVerification.class);
intent.putExtra("verificationId", verificationId);
startActivity(intent);
}
})
// Você pode adicionar outras configurações, como token reCAPTCHA, se necessário
.build();
// Inicie o processo de verificação do número de telefone com as opções configuradas
PhoneAuthProvider.verifyPhoneNumber(options);
}
I attempted to verify a phone number using Firebase Authentication in my Android app. I expected the verification to be successful and for the user to proceed to the next step of the registration process. However, I received the error “This request is missing a valid app identifier,” indicating that the Play Integrity checks and reCAPTCHA checks were unsuccessful.
Matheus SIlva is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.