Facebook Auth is Working Well on Expo, but Not After Deploying and Testing the iOS app Through TestFlight
See original GitHub issueEnvironment
Expo CLI 2.6.5 environment info: System: OS: macOS High Sierra 10.13.6 Shell: 3.2.57 - /bin/bash Binaries: Node: 10.10.0 - /usr/local/bin/node Yarn: 1.9.4 - /usr/local/bin/yarn npm: 6.4.1 - /usr/local/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman IDEs: Xcode: 10.1/10B61 - /usr/bin/xcodebuild npmPackages: expo: ^30.0.1 => 30.0.1 react: 16.3.1 => 16.3.1 react-native: https://github.com/expo/react-native/archive/sdk-30.0.0.tar.gz => 0.55.4 react-navigation: ^2.16.0 => 2.16.0 npmGlobalPackages: expo-cli: 2.6.5
iOS
Steps to Reproduce
- I made an app which uses Expo Facebook Auth (using Expo.Facebook.logInWithReadPermissionsAsync)
- Using expo build:ios, I have deployed the app so that I can test through TestFlight
- When I tried to login via Facebook, I could not see any response.
Expected Behavior
It should be possible for a user to log in or sign up via Facebook
Actual Behavior
If I use Expo app to test my app before deploying (expo build:ios), I can sign in through Facebook. Once I press the Facebook login button, a page appears so that I can enter my facebook ID and password and I receive the token to use Firebase Auth. The problem is that when I deployed the app, downloaded it through TestFlight, and pressed the Facebook login button, nothing shows up.
Code:
const { type, token } = await Expo.Facebook.logInWithReadPermissionsAsync(someNumber, { permissions: ['public_profile', 'email']});
if (type === 'success') {
const credential = firebase.auth.FacebookAuthProvider.credential(token);
firebase.auth().signInAndRetrieveDataWithCredential(credential)
.then((user) => {
// some codes
}).catch((err) => {
// somecodes
})
}
Reproducible Demo
It does not make any problem on Expo.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:16
- Comments:64 (6 by maintainers)
I couldn’t get this to work for ages on Testflight even though working perfect on Expo client but then re-read all of the documents to make sure I had things correct. It turned out that where I had confused myself was that I had set up Auth for Expo client BUT when you build the expo client for testflight you are building a standalone app. This may be obvious to a lot of you on here but as a first timer I really hadn’t grasped that.
So… after I followed the instructions for getting my facebook scheme ID etc then reading further instructions to try to work out where to put things in my app.json, I ended up with the below. Works perfect for both my google log in and Facebook (i’m only testing ios builds). Oh, and I made sure that I had upgraded to v32.
Hope this helps some of you - I was stuck for two weeks! Grrrrr.
Interesting… 🤔 Is there anyone for whom upgrading to SDK32 didn’t help solve the issue?