# rn-screenshot-detect

> This module is used to prevent screen shots and detect screen shots.

Latest version **1.0.4** (published 2023-12-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install rn-screenshot-detect
pnpm add rn-screenshot-detect
yarn add rn-screenshot-detect
bun add rn-screenshot-detect
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2023-12-01 |
| First published | 2023-11-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >= 18.0.0 |
| Dependencies | 0 |
| Unpacked size | 22.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Nguyễn Văn Trọng |
| Maintainers | trongitnlu |
| Keywords | react-native, ios, android, rn-screenshot-detect, screenshot-detect |

## Links

- npm: https://www.npmjs.com/package/rn-screenshot-detect
- Repository: https://github.com/trongitnlu/rn-screenshot-detect
- Homepage: https://github.com/trongitnlu/rn-screenshot-detect#readme
- Issues: https://github.com/trongitnlu/rn-screenshot-detect/issues
- npm.io page: https://npm.io/package/rn-screenshot-detect

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 1.0.4 (latest) — 2023-12-01
- 1.0.3 — 2023-12-01
- 1.0.2 — 2023-12-01
- 1.0.1 — 2023-11-30
- 1.0.0 — 2023-11-30

## README

# rn-screenshot-detect

This module is used to prevent screen shots and detect screen shots.
The screen shot detection will only work on iOS, as Android does not provide the underlying functionality needed to track screenshots. But on Android, we can prevent user screen shots by using the `forbid()` method.

## Installation

```sh
yarn add rn-screenshot-detect
```

## Usage

```js
import { allow, forbid, useScreenshotDeterrent } from 'rn-screenshot-detect';

// ...

const [subscribe] = useScreenshotDeterrent();

React.useEffect(() => {
  forbid(); // work on android
  const unsubscribe = subscribe(() => {
    console.warn('user took screen shots');
  });
  return () => {
    allow(); // work on android
    unsubscribe();
  };
}, [subscribe]);
```

## Contributing

See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.

## License

MIT

---

Made with [create-react-native-library](https://github.com/callstack/react-native-builder-bob)

---
_Source: https://npm.io/package/rn-screenshot-detect · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
