pending
npm install @quan2nd/react-native-activity-stateReactNative plugin to detect when app(not ReactNative container) goes to background or foreground.
``sh`
yarn add @quan2nd/react-native-activity-state
js
import { onMoveToForeground, onMoveToBackground } from '@quan2nd/react-native-activity-state';// ...
React.useEffect(() => {
const subscriptionFore = onMoveToForeground(() => {
console.log('onMoveToForeground');
})
const subscriptionBack = onMoveToBackground(() => {
console.log('onMoveToBackground');
})
return () => {
subscriptionFore.remove();
subscriptionBack.remove();
}
}, []);
``See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT