Skip to main content

I'm using React Native (iOS) and Firebase Phone Authentication.

At one point, I enabled reCAPTCHA Enterprise from the Firebase Console via:

Authentication -> Phone -> App verification -> Enable reCAPTCHA Enterprise

After that, phone number auth started triggering reCAPTCHA verification. Later, I disabled reCAPTCHA Enterprise in the console, but Firebase still behaves as if it's enabled. Even though appVerificationDisabledForTesting = true is set in development, production builds continue showing this error:

'auth/unknown', '[auth/unknown] The reCAPTCHA SDK is not linked to your app. See https://cloud.google.com/recaptcha-enterprise/docs/instrument-ios-apps'

We are seeing the same problem. I have tried to re-enable enterprise API, and then remove all site keys, and disable API again. This doesn’t help. I have also enable user audit logs showing when we call signInWithPhoneNumber(), the identity toolkit attempts to “GetRecaptchaConfig” with request showing “version” = “RECAPTCHA_ENTERPRISE”.

have you figure out ways to solve it?


no I just turned on reCAPTCHA Enterprise, create keys again, linked project and install this package

"@google-cloud/recaptcha-enterprise-react-native": "^18.7.1"

'auth/unknown', ',auth/unknown] The reCAPTCHA SDK is not linked to your app. See https://cloud.google.com/recaptcha-enterprise/docs/instrument-ios-apps'

error is gone but I am getting this error :

'auth/internal-error', ''auth/internal-error] An internal error has occurred, please try again.'
 

  const handleNext = async () => {
if (!formattedValue) {
Toast.show('Please enter your phone number', Toast.SHORT);
return;
}

try {
setIsLoading(true);
// Check if user already exists
const userExists = await FirebaseService.checkUserExists('+44 7444 555666');
const currentFlowType = userExists ? 'login' : 'signup';

// Set the flow type state
setFlowType(currentFlowType);
const confirmation = await auth().signInWithPhoneNumber(formattedValue);


// Small delay to ensure keyboard dismissal completes before navigation
setTimeout(() => {
navigation.navigate('otp', {
flowType: currentFlowType,
phoneNumber: formattedValue,
phoneNumberWithoutCountryCode: phoneNumberWithoutCountryCode,
confirmation: confirmation,
inviteCode: inviteCode
});
}, 100);

} catch (error: any) {
console.error('Phone auth error:', error.code, error.message);
Toast.show('Error' + error.message || 'Failed to send verification code.', Toast.SHORT);
} finally {
setIsLoading(false);
}
};


my sms auth is not working, still stuck on this.
you can not disable reCAPTCHA ENTERPRISE , only solution is to make a new Firebase project I guess if you find any solution please share with me. Some data is persist in FIREBASE Backend, even if you disable it on front end there is no going back, Once you Enable data is persist in backend which we can resolve. I have shared my findings.


Once you enable RECAPTCHA_ENTERPRISE then Firebase persist some data in the backend which we can not remove even if you disable it, SO I re-enable it again, create keys link project and install this package

"@google-cloud/recaptcha-enterprise-react-native": "^18.7.1"

now error is gone but after I am getting generic error:

'auth/internal-error', ''auth/internal-error] An internal error has occurred, please try again.'

now I am stuck on this, please share if you bypass internal error, thanks.
 


Are you still having the issue? just sharing my change and results.

 

Change I did

I did another approach by turning off the reCAPTCHA config.

We have been told to use below link to look at “disableRequest”

https://cloud.google.com/identity-platform/docs/recaptcha-enterprise#phone-provider_3

I created this script: (chatgpt did I lied)

import { google } from 'googleapis';

async function disableRecaptchaConfig() {
const auth = await google.auth.getClient({
scopes: c'https://www.googleapis.com/auth/identitytoolkit'],
});

const identityToolkit = google.identitytoolkit({
version: 'v2',
auth,
});

const projectId = 'your-project-id'; // Replace with your Firebase project ID

// retrieve the config first
const { data: currentConfig } = await identityToolkit.projects.getConfig({
name: `projects/${projectId}/config`,
});
console.log('Current Config:', JSON.stringify(currentConfig, null, 2));

const res = await identityToolkit.projects.updateConfig({
name: `projects/${projectId}/config`,
requestBody: {
...currentConfig, // I never tried this line but this will protect you from overwrite your current config
recaptchaConfig: {
...currentConfig.recaptchaConfig, // also never tried this line
phoneEnforcementState: 'OFF',
useSmsBotScore: false,
},
},
});

console.log('✅ reCAPTCHA config updated:', res.data);*/
}

disableRecaptchaConfig();

 

 

Result 1: My MacOS debug environment

This in result, ended up with the another error message (same as Umairbadar39 error) in my mac debug xcode environment.

Error during signInWithPhoneNumber: NativeFirebaseError: rauth/internal-error] An internal error has occurred, please try again.
    at signInWithPhoneNumber (

User audit logs: (debug build in mac react native debug environment) (Timestamp from bottom up)

you can see the sign in of existing account go through

  1. GetRecaptchaConfig 
  2. VerifyIosClient
  3. GetProjectConfig

 

Result 2: Previous Build already on TestFlight

At the same time, our previous compiled build is working! I have no idea why though.

User audit logs: (Testflight app we build previously) (Timestamp from bottom up)

You can see the sign in of existing account go through

  1. GetRecaptchaConfig
  2. SendVerificationCode

 

 

 

 


Reply