react-native-prevent-screenshot-ios-android
Version:
This package is used to block taking screenshot, screen recording and screen sharing of specific screens for both Android and IOS apps
40 lines (26 loc) • 1.3 kB
Markdown
This package allows user to block taking screenshot, screen recording and screen sharing of specific screens for both Android and IOS apps
```sh
npm install react-native-prevent-screenshot-ios-android
```
```js
import { enableSecureView, disableSecureView, forbidAndroidShare, allowAndroidShare } from 'react-native-prevent-screenshot-ios-android';
import { Platform } from 'react-native'
// ...
if (Platform.OS === 'android') {
forbidAndroidShare(); //This function blocks the Screen share/Recording and taking screenshot for android devices.
allowAndroidShare(); //This function allows to provide back the Screen share/Recording and screenshot functionality for android devices
}
if (Platform.OS == 'ios') {
enableSecureView(); //This function blocks the Screen share/Recording and taking screenshot for iOS devices.
disableSecureView(); //This function allows to provide back the Screen share/Recording and screenshot functionality for iOS devices
}
```
See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.
MIT
---
Made with [create-react-native-library](https://github.com/callstack/react-native-builder-bob)