1.0.4 • Published 6 months ago

rn-screenshot-detect v1.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

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

yarn add rn-screenshot-detect

Usage

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 to learn how to contribute to the repository and the development workflow.

License

MIT


Made with create-react-native-library

1.0.4

6 months ago

1.0.3

6 months ago

1.0.2

6 months ago

1.0.1

6 months ago

1.0.0

6 months ago