-
Notifications
You must be signed in to change notification settings - Fork 614
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
appStateChange fired too late #479
Comments
I found https://github.com/capacitor-community/privacy-screen to be able to hide the screen in the task manager. Still I think this should work as expected. |
This issue may need more information before it can be addressed. In particular, it will need a reliable Code Reproduction that demonstrates the issue. Please see the Contributing Guide for how to create a Code Reproduction. Thanks! |
This issue does not need any more information. In order to reproduce the issue just build an Android app using the plugin and use the supplied example:
While debugging the app enable the debug console in Android Studio and look for In order to reproduce the The behavior in Android is buggy while in iOS it works as expected. |
I think that the actual issue is here: The function should call |
Sorry, but I can't reproduce. There is an feature request open for including more states so it could be fired on pause. Also, for Cordova compatibility we also fire the cordova pause event, you can use it like this: |
Bug Report
Plugin(s)
@capacitor/app
Capacitor Version
@capacitor/cli: 3.0.1
@capacitor/android: 3.0.1
@capacitor/core: 3.0.1
@capacitor/ios: 3.0.1
Platform(s)
Android
Current Behavior
Since for our app security/data privacy is a huge factor, we need to implement a way that the app content is hidden (white screen) when the app is backgrounded (e.g. in the task manager). For this is wanted to use the "appStateChange" event listener from @capacitor/app. The problem is that the event only fires when coming back into the app after putting it into the background. This makes it unusable for our use case.
Expected Behavior
"appStateChange" also fires before/when the app is backgrounded.
Other Technical Details
Tested on a real Android device and a simulated one.
The text was updated successfully, but these errors were encountered: