How to detect app is minimize or close state? #12288
-
I need to manage app on based on minimize or close app states. I have added AppState on change eventListner. And based on the AppState change minimize or close I need to trigger 2 different actions. Here is my code: AppState.addEventListener('change', this._handleAppStateChange); handleAppStateChange = async (appState) => { In both the conditions app is returning background only. Anyone help here for windows app only. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
It looks like the RN AppState API doesn't really consider that: https://reactnative.dev/docs/appstate#app-states You might consider writing your own native module to crate your own JS events for this state change and have them fire when the native close/minimize event happens. |
Beta Was this translation helpful? Give feedback.
It looks like the RN AppState API doesn't really consider that: https://reactnative.dev/docs/appstate#app-states
You might consider writing your own native module to crate your own JS events for this state change and have them fire when the native close/minimize event happens.