React Native AppState
⚛ Provides functionality to determine whether the app is in the foreground or background and notifies you when the state changes.
It implements the Lifecycle for Android and falls back to the AppState for iOS.
Why Use This?
The original AppState API provided by React Native behaves differently between Android and iOS, particularly regarding the background
state:
- On iOS, the
background
state signifies that the entire app is in the background. - On Android, the
background
state indicates that the React Native Activity is in the background, which might not necessarily mean the entire app is in the background.
By using react-native-appstate
, you can handle these differences seamlessly across both platforms.
Install
Install dependency package
yarn add react-native-appstate
Or
npm i -S react-native-appstate
Usage
TODO: write usage
Contribute
New features, bug fixes and improvements are welcome! For questions and suggestions use the issues.
Star History
License
The MIT License (MIT)
Copyright (c) 2024 Douglas Nassif Roma Junior
See the full license file.