🚀 Simple control capture event (like screenshot, screen record) in Android, iOS + React Native
= RN 0.64
npm install react-native-capture-protection
import {
CaptureProtection,
CaptureProtectionModuleStatus,
isCapturedStatus
} from 'react-native-capture-protection';
const Component = (props) => {
const { isPrevent, status } = useCaptureProtection();
React.useEffect(() => {
console.log('Prevent Status is', isPrevent);
}, [isPrevent]);
React.useEffect(() => {
console.log('Capture Status is', isCapturedStatus(status));
}, [status]);
const onPrevent = () => {
CaptureProtection.preventScreenRecord();
}
const onAllow = () => {
CaptureProtection.allowScreenRecord();
}
...
};
See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT
Made with create-react-native-library