-
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 incorrectly says active
when launched from a geofence in the background
#28655
Comments
|
Hi @objectiveSee a repro or a Snack that demonstrates the issue would be helpful! Especially since this happens in a specific use case. |
In react-native-website, AppState API, this code snippet is expected to log App has come to the foreground!, however, it is not printed even if the components looks fine. Seems like there's a bug in the event listener that always resets the 'appState' state to
|
I've tested the class-based component version of the code snippet, it is working as expected. There seems an issue when using the functional component that uses |
This issue isn't related to geofences. It happens in a newly created React Native app. I've reproduced the issue in a new React Native app here: https://github.com/LaurenceRolandJames/AppStateActiveRepro/tree/master |
Hey @LaurenceRolandJames! Thank you for making a better sample code to demonstrate the bug! Also great that it sounds like you found the source problem as well as a workaround. I updated the initial comment with a link to your comment so that hopefully this issue gets picked up. 🐛🎶🚀 Thanks to @cHaLkdusT too! |
Hi @objectiveSee , Using react-native v0.62.2, I've retested this issue and seems working now. See reference for function component example here. Let me know if it works on your end so we can now close this issue. |
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. |
This issue was closed because it has been stalled for 7 days with no activity. |
Please provide all the information requested. Issues that do not follow this format are likely to stall.
Description
My app will be launched in the background response to a geo-fence event. In the task handler for being launched, I log the app state of the app. What I've noticed is that the app state is
active
however the app is 100% running in the background.I have provided some code to get you an insight, but in reality testing this with Geofencing takes some knowledge of geofencing. I'd be happy to share more code if we determine that this bug can be debugged :)
React Native version:
Steps To Reproduce
EDIT: This issue was reproduced in a sample app which is posted in a comment below. See #28655 (comment) for Sample App that demonstrates the bug clearly. You should use that code and ignore my steps below (which are more complicated since they also use the geofencing API)
Provide a detailed list of steps that reproduce the issue.
AppState
and you will see it to beactive
Expected Results
AppState should be
backgrounded
Snack, code example, screenshot, or link to a repository:
Example to setup geofencing:
The text was updated successfully, but these errors were encountered: