ddikodroid / react-native-capture-protection

It’s a library for React Native to control simple capture events(i.e. Screenshot or Screen record)

Home Page:https://www.npmjs.com/package/react-native-capture-protection

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

react-native-capture-protection

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

Simulator Screen Recording

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.73 and higher

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

About

It’s a library for React Native to control simple capture events(i.e. Screenshot or Screen record)

https://www.npmjs.com/package/react-native-capture-protection

License:MIT License


Languages

Language:Java 32.5%Language:Objective-C++ 24.4%Language:TypeScript 22.3%Language:C++ 9.5%Language:Ruby 3.9%Language:Objective-C 3.7%Language:JavaScript 2.4%Language:Starlark 0.8%Language:CMake 0.4%Language:C 0.1%Language:Swift 0.1%