abbas jafari
abbas jafari

Reputation: 81

How to disable reCaptcha in android?

I want to disable reCaptcha but I can't do that, I follow some steps from this link, but it doesn't work for me.

First I added SHA-1 and SHA-256 to the firebase project and also in the Google Cloud Console, I enabled the Android DeviceCheck API for my project. The default Firebase API Key will be used and needs to be allowed to access the DeviceCheck API.

But reCaptcha still enable, please help me.

Upvotes: 1

Views: 3267

Answers (2)

Himanshi Thakur
Himanshi Thakur

Reputation: 2299

As per firebase the reCAPTCHA flow will only be triggered:

a. When SafetyNet is unavailable.

b. If the user does not have Google Play Services support or when you are testing your app on an emulator.

c. Your device does not pass suspicion checks like your device is rooted or have unlocked bootloader .

If any of above conditions are true in your case then reCAPTCHA will be displayed.

Upvotes: 2

fukit0
fukit0

Reputation: 974

In integration testing section, according to official firebase document:

In addition to manual testing, Firebase Authentication provides APIs to help write integration tests for phone auth testing. These APIs disable app verification by disabling the reCAPTCHA requirement in web and silent push notifications in iOS. This makes automation testing possible in these flows and easier to implement. In addition, they help provide the ability to test instant verification flows on Android.

On Android, call setAppVerificationDisabledForTesting() before the signInWithPhoneNumber call. This disables app verification automatically, allowing you to pass the phone number without manually solving it. Note that even though reCAPTCHA and/or SafetyNet are disabled, using a real phone number will still fail to complete sign in. Only fictional phone numbers can be used with this API.

// Turn off phone auth app verification.
FirebaseAuth.getInstance().getFirebaseAuthSettings()
   .setAppVerificationDisabledForTesting();

Hope it works.

Upvotes: 4

Related Questions