NOTE: forked and adapted from https://github.com/blend/react-native-screenshot-detector
The goal is to prevent the user from taking screenshots in your app.
Accordingly, this library exports different APIs for Android and iOS. See Usage below.
$ npm i react-native-noscreenshot
$ react-native link react-native-noscreenshot
import ScreenshotDetector from 'react-native-noscreenshot';
// iOS
this.eventEmitter = ScreenshotDetector.subscribe(() => {
Alert.alert('Screenshot detected!');
});
ScreenshotDetector.unsubscribe(this.eventEmitter);
// Android
ScreenshotDetector.DisableScreenShot()
ScreenshotDetector.EnableScreenshot()