{"repo":"douglasjunior/react-native-applifecycle","free":true,"listed":false,"github":"https://github.com/douglasjunior/react-native-applifecycle","clone":"git clone https://github.com/douglasjunior/react-native-applifecycle.git","description":"⚛ Enhances the reliability of managing app lifecycles across iOS and Android platforms, ensuring consistent behavior regarding foreground and background states.","language":"TypeScript","stars":130,"topics":["appstate","lifecycle","react-native","android","ios"],"license":"MIT","category":"mobile-apps","readme_excerpt":"React-Native App Lifecycle ⚛ Enhances the reliability of managing app lifecycles across iOS and Android platforms, ensuring consistent behavior regarding foreground and background states. 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-applifecycle , you can handle these differences seamlessly across both platforms, ensuring that the state background will be dispatched only when the entire app is in background. Install Install dependency package Or Usage The App Lifecycle API is compatible with the original AppState. Subscribing to the change listener: Getting the current state with hook : For more details, see the Sample Project. Lifecycle States - active - The app is running in the foreground - background - The app is running in the background. The user is either: - in another app - on the home screen - [iOS] inactive - This is a state that occurs when transitioning between foreground & background, and during periods of inactivity such as entering the multitasking view, opening the Notification Center or in the event of a","default_branch":null,"files":null,"tree":[],"storefront":"/r/douglasjunior","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/douglasjunior/react-native-applifecycle/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}