question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Facebook Auth is Working Well on Expo, but Not After Deploying and Testing the iOS app Through TestFlight

See original GitHub issue

Environment

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

  1. I made an app which uses Expo Facebook Auth (using Expo.Facebook.logInWithReadPermissionsAsync)
  2. Using expo build:ios, I have deployed the app so that I can test through TestFlight
  3. 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:closed
  • Created 5 years ago
  • Reactions:16
  • Comments:64 (6 by maintainers)

github_iconTop GitHub Comments

15reactions
GBGitUsercommented, Apr 16, 2019

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.

{
  "expo": {
    "name": "myApp",
    "description": "myApp description!",
    "slug": "myApp",
    "privacy": "public",
    "sdkVersion": "32.0.0",
    "platforms": ["ios", "android"],
    "version": "0.0.8",
    "orientation": "portrait",
    "icon": "./assets/images/icon.png",
    "splash": {
      "image": "./assets/images/splash.png",
      "resizeMode": "contain",
      "backgroundColor": "#000000"
    },
    "updates": {
      "fallbackToCacheTimeout": 0
    },
    "assetBundlePatterns": ["**/*"],
    "facebookScheme": "fbxxxxxxx",
    "facebookAppId": "xxxxxxxxx",
    "facebookDisplayName": "myApp",
    "ios": {
      "supportsTablet": true,
      "bundleIdentifier": "xxxxxxxxx",
      "config": {
        "googleSignIn": {
          "reservedClientId": "xxxxxxxxxx"
        }
      },
      "icon": "./assets/images/icon.png",
      "infoPlist": {
        "NSCameraUsageDescription": "App needs permission to access your photos to set your venue photo.",
        "NSLocationWhenInUseUsageDescription": "App uses your location to show remote working venues near to you.",
        "LSApplicationQueriesSchemes": [
          "fbapi",
          "fb-messenger-share-api",
          "fbauth2",
          "fbshareextension"
        ]
      }
    }
  }
}
12reactions
sjchmielacommented, Jan 21, 2019

Interesting… 🤔 Is there anyone for whom upgrading to SDK32 didn’t help solve the issue?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Expo Facebook Auth Is Working on Expo App, But Not With ...
It is working well when I tested my app on iOS Expo App. Once I press a button related with Facebook sign in,...
Read more >
App crashes on TestFlight with exc… | Apple Developer Forums
The app works fine in the expo app, in the app downloaded from the app store and emulator but it crashes in the...
Read more >
Is your app crashing on TestFlight? Issues and potential ...
This article looks into problems that may crash your app on TestFlight and provides potential workarounds and solutions.
Read more >
Expo-ios / facebook login doesn't work standalone app
I used expo simulator to test the app on both ios and android and they both seem to work, but when I created...
Read more >
Publish to App Store Connect - Visual Studio App Center
The connected account must have App Manager permissions to publish an app. For more information, review the Apple App Distribution Guide. Set up ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found