blank page after recaptcha verification Authenticate with Firebase on iOS using a Phone Number Swift

In your app delegate's application(_:open:options:) method, call Auth.auth().canHandle(url).


For the blank re-captcha page issue I was able to resolve it by doing these 3 things:

1st thing-

  1. Inside the GoogleSerivce-Info.plist file make sure the REVERSED_CLIENT_ID is added to your project via the URL types using this. Follow the first part of the second step there: Add custom URL schemes to your Xcode project (look at the screenshot).

enter image description here

2nd thing-

  1. In the project navigator select the blue project icon

  2. Select Capabilities

  3. Open Background Modes

  4. Select Background fetch

enter image description here

3rd thing-

  1. Before verifying the phone number call PhoneAuthProvider.provider(auth: Auth.auth())
@IBAction func phoneButton(sender: UIButton) {

    // ***step 5***
    PhoneAuthProvider.provider(auth: Auth.auth())

    PhoneAuthProvider.provider().verifyPhoneNumber(phoneNumberTextField.text!, uiDelegate: nil) {
        (verificationID, error) in
            
        if let error = error {
            print(error.localizedDescription)
            return
        }
            
        guard let verificationId = verificationID else { return }

        // do something with verificationID
    }
}

On iOS, the appVerificationDisabledForTesting setting has to be set to TRUE before calling verifyPhoneNumber. This is processed without requiring any APNs token or sending silent push notifications in the background, making it easier to test in a simulator. This also disables the reCAPTCHA fallback flow.

Firebase Docs