-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
AppState change doesn't fire on launch on iOS #18836
Comments
Thanks for posting this! It looks like your issue may refer to an older version of React Native. Can you reproduce the issue on the latest release, v0.55? Thank you for your contributions. |
Yes it still reproduces. |
I'm having a similar issue on RN55.2 but only in release builds... which took some time to debug. |
Thanks for posting this! It looks like your issue may refer to an older version of React Native. Can you reproduce the issue on the latest release, v0.55? Thank you for your contributions. |
1 similar comment
Thanks for posting this! It looks like your issue may refer to an older version of React Native. Can you reproduce the issue on the latest release, v0.55? Thank you for your contributions. |
It looks like your issue may refer to an older version of React Native. Can you reproduce the issue on the latest release, v0.55? |
Yes this still reproduces. |
I see the same issue as well, and as @markusekblad mentioned, it seems to only appear in release builds. I suspect this is just a timing issue since release builds likely load all the RN javascript much earlier/faster than debug builds. |
Actually let me correct what I said previously. I don't see any initial AppState change firing after launch at all in debug builds in iOS. The first change event happens if I put the app into the inactive/background states by tapping the home button on the sim. Will investigate release build behavior next. |
It seems only happening on >= iOS11 and in release mode. |
Same with @yung93. Got the issue on iOS 11 release mode only. |
not working for us on debug either |
reproduced in 0.46 and so annoying. |
I'm seeing cases where the app state never transitions to active and stays at |
I also see this issue in RN 55.3. I get appState 'unknown' when it should be 'active'. |
Does anyone test on 0.56? |
+1, RN 0.55 / Expo SDK 27. Fires correctly in dev environment, but not on production build |
+1 Ihave the same issue on RN 0.57 (debug mode) |
I'm still seeing this as well on 0.57 |
Any update on the issue? It happens to me on IOS on release mode as well. |
I am seeing this as well with React Native 0.59.4, on iOS 11.4.1 |
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions. |
Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information. |
AppState's change event doesn't fire on first launch on iOS, but does fire on Android. The currentState does change however because the RCTAppState.getCurrentAppState call eventually returns with the active state.
Environment
Environment:
OS: macOS High Sierra 10.13.3
Node: 8.9.4
Yarn: 1.5.1
npm: 5.6.0
Watchman: 4.7.0
Xcode: Xcode 9.2 Build version 9C40b
Android Studio: 3.0 AI-171.4443003
Packages: (wanted => installed)
react: 16.2.0 => 16.2.0
react-native: 0.54.3 => 0.54.3
Steps to Reproduce
This prints:
Expected Behavior
The change handler should fire since the currentState does change from unknown to active.
Actual Behavior
change handler never fires.
To fix either:
I'm not sure how to do (2) since it means dispatching an event always on startup, not sure where you'd put that code? (1) is easy enough change RCTAppState.getCurrentAppState to not take a callback at all and just dispatch an event instead.
becomes
The text was updated successfully, but these errors were encountered: