expo: 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":"********"}}]
Environment
Expo CLI 3.20.3 environment info: System: OS: macOS 10.15.4 Shell: 5.8 - /usr/local/bin/zsh Binaries: 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 IDEs: Android Studio: 3.5 AI-191.8026.42.35.6010548 Xcode: 11.4.1/11E503a - /usr/bin/xcodebuild npmPackages: expo: ^37.0.0 => 37.0.8 react: 16.9.0 => 16.9.0 react-dom: 16.9.0 => 16.9.0 react-native: https://github.com/expo/react-native/archive/sdk-37.0.1.tar.gz => 0.61.4 react-native-web: ^0.11.7 => 0.11.7 react-navigation: ~4.0.10 => 4.0.10 npmGlobalPackages: expo-cli: 3.20.3 This happened on iOS simulator.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 23
- Comments: 27 (7 by maintainers)
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.
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_profileandemailpermissions, 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.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:
expo build:ios) ANDsince 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
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.
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).
@MattGoldwater I wasnt able to make it work. Expoâs Facebook AppID is supposed to be internally set but its still asking for one, when I enter my own it will not work.
I decided to drop Expo completely and Iâve moved my app to React Native CLI standard workflow. Facebook login is working fine now.
expo SDK 37 works for the Faceboook login part, but we still canât use the credential to login with Firebase for the reason you mentioned 𤯠So I think this issue should be closed? since itâs Problem login with Facebook and Firebase
I wouldnât say itâs wrong, I just didnât know what configuration it was referring to, setting up the info.plist file? I might recommend putting a note about it in the
Facebook.logInWithReadPermissionsAsync(options)section, if you skipped straight there you might not realize why itâs not working as expected.I wasnât aware there was an issue with the redirect in previous versions of Expo, from what others have said it sounded like there werenât any issues before, but I canât confirm that from personal experience.
The fix is in production, hereâs the relevant documentation: