expo: Release Channel & AuthSession Redirect Error %2F

Environment

Environment: OS: macOS Sierra 10.12.6 Node: 8.9.1 Yarn: 1.3.2 npm: 5.6.0 Watchman: 4.7.0 Xcode: Xcode 9.2 Build version 9C40b Android Studio: 2.2 AI-145.3360264

Packages: (wanted => installed) expo: ^25.0.0 => 25.0.0 react: 16.2.0 => 16.2.0 react-native: https://github.com/expo/react-native/archive/sdk-25.0.0.tar.gz => 0.52.0

Diagnostics report: If the core team needs this information, I can provide it, but there are many strings contained within that are business sensitive.

Using Expo client, loading my app. Fails on Android 7. Works on iOS 11 and in iPhone iOS simulator.

Steps to Reproduce

  1. Setup project to publish with release channel defined.
  2. Create an authentication flow with the AuthSession.startAsync, and AuthSession.getRedirectUrl as the redirectUrl for the OAuth flow.
  3. In the expo client, launch a release channel build of app, trigger authentication flow.
  4. Complete authentication flow.

Expected Behavior

Expected behavior is that it launches the web browser, shows our oauth flow, when done, successfully redirects back to the release channel specific Expo client app.

Actual Behavior

Authentication flow completes, but fails to redirect back to Expo client release channel app, and instead returns an error such as the following:

Could not load exp://exp.host/@username/app?release-channel=dev%2F

Reproducible Demo

I can make one if there is activity here requesting a demo.

This has been documented by another fellow on the forums. I wanted to make this issue for better tracking and visibility.

Thank you for the consideration.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 1
  • Comments: 17 (4 by maintainers)

Most upvoted comments

…currently figuring out how to use a custom scheme to deep link back to the standalone app, havent successfully done so yet unfortunately. But will be sure to post when it seems to be working!

landed a PR so this will be resolved in SDK 26

thanks for catching this folks! and @mgscreativa for the workaround. i’ll look into getting a fix out for our next release

found the bit about the returnUrl option in AuthSession.startAsync https://docs.expo.io/versions/latest/sdk/auth-session.html

worked around by providing the returnUrl that looks like exp://expo.io/{@yourname}/{your-app-slug}?release-channel={your_release_channel}+expo-auth-session

Hi @ryanmr @mgscreativa , thank you very much for your report.

It does seem to be a bug, so it looks like android is adding an extra / to the AuthSession redirect.

I couldnt get it to work with a standalone android app (didnt give iOS a go). I ended up ditching AuthSession for the Expo Facebook integration https://docs.expo.io/versions/latest/sdk/facebook.html

appears to be successfully getting a token and redirecting for my standalone android app

ah, good catch!

Well, finally got it sorted out by checking if the device is android, because this issue happens on android devices…

So I check if I’m not on iOS, not on development and I have a release channel set in the manifest

  getAuthSessionReturnUrl = () => {
    const { manifest } = Constants;

    return Platform.OS !== 'ios' &&
      process.env.NODE_ENV !== 'development' &&
      Constants.manifest.releaseChannel !== undefined
      ? `exp://expo.io/@myusername/app-slug?release-channel=${manifest.releaseChannel}+expo-auth-session`
      : null;
  };

is there a workaround for this in the mean time @fxfactorial ?