facebookScheme on Standalone Android is broken, CustomTabActivity doesn't do anything.
See original GitHub issue🐛 Bug Report
Summary of Issue
- Cross-post from this forum post.
- The
facebookScheme
on standalone Android resolves to aCustomTabActivity
that is completely blank and doesn’t do anything.
Environment - output of expo diagnostics
& the platform(s) you’re targeting
Expo CLI 3.24.2 environment info:
System:
OS: Windows 10 10.0.18362
Binaries:
Node: 12.18.2 - C:\Program Files\nodejs\node.EXE
Yarn: 1.21.1 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 6.14.5 - C:\Program Files\nodejs\npm.CMD
npmPackages:
expo: ~38.0.8 => 38.0.9
react: ~16.11.0 => 16.11.0
react-dom: ~16.11.0 => 16.11.0
react-native: https://github.com/expo/react-native/archive/sdk-38.0.2.tar.gz => 0.62.2
react-native-web: ~0.11.7 => 0.11.7
Reproducible Demo
Code is reduced to a single file, one package (expo-auth-session
), and only adding the facebook*
properties to app.json
. See this post.
APK download (available up to 29 days of this post).
Steps to Reproduce
expo init
minimal typescriptexpo install expo-auth-session
- create new facebook project, add login, add
https://auth.expo.io/@user/slug
- copy code from reproducible post
- make a standalone build
Expected Behavior vs Actual Behavior
- Web: it works
- Expo client: it works (using proxy)
- Android standalone client: clicking “continue” OR “cancel” returns to a second activity with just the app title in an appbar.
Reproduce by running:
adb shell am start -W -a android.intent.action.VIEW -d "fb<FACEBOOKID>://authorize?code=invalid&state=a01bCdEFJK" com.example.app
Other things
Because I had not seen this issue anywhere else, I suspected this was a me problem; but I think it might not be. It’s also not unique to expo-auth-session
, as you can tell by the shellscript reproduction.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:6
- Comments:49 (7 by maintainers)
Top Results From Across the Web
Standalone: Android Facebook Auth never returns from com ...
Here is a minimal repro. It will work on web, but it will open the “custom tabs activity” with a blank screen when...
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 >Expo Authsession For Fb Login Not Redirecting To ... - ADocLib
Expo can be used to login to many popular providers on iOS Android and web! ... facebookScheme on Standalone Android is broken CustomTabActivity...
Read more >5 common errors found in a React Native app (using Expo)
When creating a mobile app with React Native, you can use Expo to streamline some ... doesn't work on Android the same way...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Now with EAS Build, you can create custom dev clients and builds that have modified
AndroidManifest.xml
files. In this case, I would suggest adding the FB scheme directly to the manifest and avoid usingfacebookScheme
which would generate the extra activity that is used inexpo-facebook
.withAndroidScheme.js
Then in your
app.json
If you use the vscode-expo extension, you can use <kbd>⌘⇧P</kbd> and type “Expo: Preview modifier” then select “android.manifest” to see a preview of what the AndroidManifest.xml will look like after you build with
eas build -p android
orexpo run:android
.There is no workaround to prevent the double activity. The only workaround is to eject and fix
AndroidManifest.xml
manually.