Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android standalone freezes on splash-screen if getExpoPushTokenAsync() is called during startup #1388

Closed
andrioid opened this issue Feb 6, 2018 · 6 comments

Comments

@andrioid
Copy link

andrioid commented Feb 6, 2018

Environment

Environment:
OS: macOS High Sierra 10.13.2
Node: 8.9.0
Yarn: 1.3.2
npm: 5.5.1
Watchman: 4.9.0
Xcode: Xcode 9.2 Build version 9C40b
Android Studio: 2.3 AI-162.4069837

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:
https://exp-xde-diagnostics.s3.amazonaws.com/parkpark-b4eca031-6a99-419f-b166-cc46d5144436.tar.gz

Fails: Standalone (Android)
Works: Standalone (iOS), Client

Tested SDK's: 24, 25

Steps to Reproduce

Call this during app-loading
const token = await Notifications.getExpoPushTokenAsync()

Expected Behavior

App finished loading, shows main screen.

Actual Behavior

  1. App starts and shows loading screen
  2. App starts initialising from redux (permissions, gps coordinates (i can see the gps icon pop up in the status bar)
  3. App shows splash screen forever
  4. Nothing get's reported to Sentry, even though all of those calls are wrapped in try/catch. It's like the JS thread is completely derailed.

Reproducible Demo

This isn't reproducable in the Expo client, so a snack would be useless.

I made a new app that demonstrates this bug. Funny enough, it went fine on the first run. So it's like something goes terribly wrong if it's called twice.

Code: https://github.com/andrioid/expo-android-splash-bug
APK: https://rink.hockeyapp.net/apps/16c5afff006e45b8ba23411102c76779

Forum post

https://forums.expo.io/t/frozen-splash-screen-on-sdk-25-android-stand-alone/7046

Workaround

Move fetching push notification token out of init, and ask when the splash screen isn't being shown.

@andrioid andrioid changed the title Android stand-alone freezes on splash-screen if getExpoPushTokenAsync() is called during startup Android standalone freezes on splash-screen if getExpoPushTokenAsync() is called during startup Feb 6, 2018
@terribleben
Copy link
Contributor

Not sure what our intended behavior is in this case. Maybe we just need to fail quickly instead of letting the promise hang.

@andrioid
Copy link
Author

andrioid commented Feb 8, 2018

@terribleben: do you have any idea what is causing this and why it happens in app shell, but not the Expo client?

@aatreya
Copy link

aatreya commented Jun 16, 2018

We're running into this as well. Could this happen if the client has trouble reaching the Expo push server, or if that request fails for some reason?

@roblingle
Copy link

roblingle commented Jul 17, 2018

I seem to be having a similar issue when I run in Genymotion. After logging in, that call never returns or fails.

Edit: Works fine in iOS emulator and on my Android device. I added a network test and things seem fine there.

@vshab
Copy link

vshab commented Oct 29, 2018

I had this issue until I added google-services.json to my app as it written here: https://docs.expo.io/versions/latest/guides/using-fcm#client-setup

@AdamJNavarro
Copy link
Contributor

Hey @andrioid,

In an effort to clean up and gain more clarity over our issues, we're closing old issues that may no longer apply to our currently supported versions. If you are able to still repro this, please open a new issue with a repro case and we'll be happy to investigate.

Cheers,
Adam

@lock lock bot added the outdated label Aug 6, 2019
@lock lock bot locked and limited conversation to collaborators Aug 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants