-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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 listener don't work when the app starts in react-native@0.59.x but work in react-native@0.56.0 #25204
Comments
I'm using 0.59.4, and it's fine. |
It's not work on my phone. What brand is your mobile phone and what model? |
|
I test it on my phone used 0.59.4, it's also not work. I mean to say AppState change listener only don't work when the app starts. It's work well when the app at background state or active state. If I kill the App and restart the App, the AppState change listener no feedback. I hope that I have already made it clear. |
What happened |
It doesn't work for me either on app start. (on Android, RN 0.59.8, I didn't test on iOS) Until there's a fix, the quick workaround I found was to directly call the AppState native module:
EDIT: (simpler solution)
This is what's written in the docs, I think it's way simpler & safer to use than my solution above haha, I didn't try it though EDIT: it works:
|
Please read https://facebook.github.io/react-native/docs/appstate carefully, and there is a solution to your issue. |
In
react-native@0.56.0
, I got the nextAppState is 'active' when the app starts, but inreact-native@0.59.9
, I got nothing.React Native version:
App1 use
react-native@0.59.9
App2 use
react-native@0.56.0
Why the AppState change listener don't work when the app starts in
react-native@0.59.9
, is that a bug?The text was updated successfully, but these errors were encountered: