1.0.2 • Published 3 years ago

react-native-noscreenshot v1.0.2

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

react-native-noscreenshot

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.

Getting started

$ npm i react-native-noscreenshot

$ react-native link react-native-noscreenshot

Usage

import ScreenshotDetector from 'react-native-noscreenshot';

// iOS
this.eventEmitter = ScreenshotDetector.subscribe(() => {
  Alert.alert('Screenshot detected!');
});
ScreenshotDetector.unsubscribe(this.eventEmitter);

// Android
ScreenshotDetector.DisableScreenShot()
ScreenshotDetector.EnableScreenshot()