Skip to content

wn-na/react-native-capture-protection

Repository files navigation

react-native-capture-protection

🚀 Simple control capture event (like screenshot, screen record) in Android, iOS + React Native

Simulator Screen Recording

Simulator Screen Recording - iPhone 15 Pro - 2024-07-02 at 21 19 17

Features

  • iOS Capture Event via screen recording, capture capture with Listener
  • allow, prevent Android, iOS Capture Event
  • allow, prevent iOS Record Screen
  • Provider, Hooks
  • = RN 0.64

  • support Android 14

Installation

npm install react-native-capture-protection
import {
  CaptureProtection,
  CaptureProtectionModuleStatus,
  isCapturedStatus
} from 'react-native-capture-protection';

const Component = (props) => {
  const { isPrevent, status } = useCaptureProtection();

  React.useEffect(() => {
    console.log('Prevent Status is', isPrevent);
  }, [isPrevent]);
  React.useEffect(() => {
    console.log('Capture Status is', isCapturedStatus(status));
  }, [status]);

  const onPrevent = () => {
    CaptureProtection.preventScreenRecord();
  }
  const onAllow = () => {
    CaptureProtection.allowScreenRecord();
  }

  ...

};

Docs

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