Problem login with Facebook and Firebase

🐛 Bug Report

After upgraded Expo version 37, I can’t do Facebook sign in with Firebase Auth on iOS and returned this message. However worked on Android.
I checked Facebook App Id and App secret and entered it to Firebase Facebook auth console.

Possible Unhandled Promise Rejection (id: 0):
[Error: Unsuccessful debug_token response from Facebook: {"error":{"message":"(#100) The App_id in the input_token did not match the Viewing App","type":"OAuthException","code":100,"fbtrace_id":"********"}}]


Expo CLI 3.20.3 environment info:
OS: macOS 10.15.4
Shell: 5.8 – /usr/local/bin/zsh
Node: 10.16.0 – ~/.nodebrew/current/bin/node
Yarn: 1.22.4 – /usr/local/bin/yarn
npm: 6.14.5 – ~/.nodebrew/current/bin/npm
Watchman: 4.9.0 – /usr/local/bin/watchman
Android Studio: 3.5 AI-191.8026.42.35.6010548
Xcode: 11.4.1/11E503a – /usr/bin/xcodebuild
expo: ^37.0.0 => 37.0.8
react: 16.9.0 => 16.9.0
react-dom: 16.9.0 => 16.9.0
react-native: => 0.61.4
react-native-web: ^0.11.7 => 0.11.7
react-navigation: ~4.0.10 => 4.0.10
expo-cli: 3.20.3
This happened on iOS simulator.

5 thoughts on “Problem login with Facebook and Firebase

  1. Thanks @Katsukiniwa but not being able to use the Expo client app with Facebook login (and firebase) to me is a dealbreaker. The Expo client app is one of the main reasons why I am using Expo. If I cannot log in in my app, the rest is not testable. It seems like they didn’t think about the consequences carefully before making this change.

  2. I downgraded to the previous version of Expo and it works fine now. I’ll hold off on the upgrade until this issue is resolved.

    Note the issue is that firebase.auth().signInAndRetrieveDataWithCredential(credential) will not work because the app_id entered in firebase does not match with the credentials created for Facebook login (expo client id FB app).

  3. Having this same issue. Downgrading to SDK 36 solves the problem as @alter-io points out but doing so means I can’t take advantage of other SDK 37 features like Firebase Analytics.

    Is there any way to use my own app_id for Facebook login with SDK 37, or at least a way to integrate analytics with SDK 36? This is throwing a pretty significant wrench in development.

  4. It seems like a decision was made to hardcode Expo’s facebook app details in the OAuth requests coming from the ios App Store version of Expo. This saves developers the time of having to create an app and get an App Id on facebooks site if all they want to do is us facebook for a login (and look at profile details). The thing is, by doing this, not only does firebase auth not work anymore but also you are confined to only using public_profile and email permissions, so if your app uses any of the other 13 permissions available, it is now broken. Which is now referred to as a “slight downside.” Considering it takes all of a couple minutes to create an App on facebook’s site I don’t know if this was a good trade.

  5. Yes, Facebook login integrated with Firebase works on the managed workflow in SDK 37. I linked the documentation that explained this above, but since it seems to still be a point of confusion for folks, I’ll explain it here:

    In order to solve a bug with logging in via the Facebook app when developing in the App Store Expo client, we decided to use our own Facebook App ID. This has the added benefit of you not having to do any set up at all when you want to test out Facebook Login features when using the App Store Expo client.

    However this means you can no longer integrate with Firebase in development when using the App Store Expo client. But you can integrate with Firebase in both:

    • a standalone app (built with expo build:ios) AND
    • a custom Expo client build

    since in both of those cases you are using your own Facebook App ID and app secret (identical to what was done in SDK 36 and below).

    For a guide on how to build a custom Expo client app (spoiler: it’s super easy, and if it’s not for you, let us know so we can make the process better!) refer to this documentation