Firebase Phone Auth Recaptcha "Error: Invalid Format"

Please provide the following:

  1. SDK Version: 37
  2. Platforms(Android/iOS/web/all): iOS
  3. Managed workflow (not bare)
    System:
      OS: macOS 10.15.4
      Shell: 5.7.1 - /bin/zsh
    Binaries:
      Node: 10.18.1 - ~/.nvm/versions/node/v10.18.1/bin/node
      Yarn: 1.19.1 - /usr/local/bin/yarn
      npm: 6.14.4 - ~/.nvm/versions/node/v10.18.1/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    IDEs:
      Xcode: 11.3/11C29 - /usr/bin/xcodebuild
    npmPackages:
      expo: ^37.0.0 => 37.0.3
      react: 16.9.0 => 16.9.0
      react-native: https://github.com/expo/react-native/archive/sdk-37.0.0.tar.gz => 0.61.4
      react-navigation: 4.0.10 => 4.0.10

Using this link to set this up: FirebaseRecaptcha - Expo Documentation

I’ve run:

$ expo install expo-firebase-recaptcha
$ expo install react-native-webview

  1. I copied the code that is put in the example (I have changed nothing).
  2. I mount this example component into one of my screens.
  3. I see the phone verification inputs and I enter my phone number.
  4. The recaptcha web view opens in a browser
  5. I click the checkbox to verify I’m not a robot.
  6. Some pictures appear, I select accordingly.
  7. The web browser closes back into my app.
  8. I see a red error message “Error: Invalid format.”

Something is either wrong with my setup (I have firebase running perfectly with email auth) or something is wrong with the Recaptcha. :man_shrugging:

Any help?

This demo doesn’t work on my phone, I get the same error as described above. My " OAuth redirect domains" is set to my app.json firebase’s authDomain, which I obtained when setting up my Firebase account. These are the same properties used when I initialize firebase within my app. And I use those same properties in the above Snack, which results in the same “Error: Invalid format” error.

Same Error

1 Like

@notbrent any help?

@ijzerenhein are you experiencing the same issue I’m having with the Snack?

@adriaanbalt I believe invalid format means that the phone number that you entered is not recognised as a valid phone number. You can try by adding a test phone number in the firebase console Authentication -> Sign in method -> Phone

1 Like

Turns out the phone numbers has to include the country code ie: +1 for the USA

1 Like

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.