518 B
518 B
Example
How to prevent the screen in App switcher only (Android)
useEffect(() => {
const appStateFocusSub = AppState.addEventListener('focus', () => {
CaptureProtection.allow();
});
const appStateBlurSub = AppState.addEventListener('blur', () => {
CaptureProtection.prevent();
});
return () => {
appStateFocusSub.remove();
appStateBlurSub.remove();
};
}, []);