'Firebase Phone Authentication pops up a reCAPTCHA verification window on iOS even if Background Modes and Push Notifications are enabled

I implemented Phone Authentication with Firebase on iOS. Authentication works. However, on iOS, a reCAPTCHA window pops up. I tried to enable Silent Notifications by enabling Background Modes and Push Notifications. It is skipping the reCAPTCHA test but it still pops up a blank page with a loading bar to do the verification automatically. Is there an extra step that I'm missing? Also, I'm new to XCode so I might be missing a configuration step (for example I didn't click any checkboxes on the Background Modes dropdown).

Do you have any suggestions on what I could be missing?



Solution 1:[1]

To ensure that both scenarios are working correctly, test your app on a physical iOS device with background app refresh both enabled and disabled. When background app refresh is disabled, you should be able to successfully sign in after completing the reCAPTCHA challenge. You can also test the reCAPTCHA flow by running your app on an iOS simulator, which always uses the reCAPTCHA flow.

For Disable reCAPTCHA Authentication Go and Enabling Background Modes capability Inside of the Background Modes and check "Remote Notification" checkbox.

for more detail refer to the firebase document https://firebase.google.com/docs/auth/ios/phone-auth

Solution 2:[2]

This almost cause me to waste a lot of time. I had previously installed a build from Testflight that was not fully configured to skip the Recaptcha. (the push/background-refresh hadn't been enabled when the build was published)

So I set that and my certs all set up, pushed a new build to Testflight, updated on the phone in testflight, but still saw the recaptcha.

I had to uninstall the app from my phone, and reinstall through testflight again. After that, logging in by phone no longer showed a recaptcha. :)

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Kavin Soni
Solution 2 SeanMC