Hello Friends 👋,
Welcome To Infinitbility! ❤️
Due to many security reasons, we want to prevent our users to take screenshots and a screen capture of our react native application.
Today, we will learn and see examples of preventing screen capture in react native.
To enable or disable screenshot, React native have package react-native-screen-capture-secure, this package help you to enable or disable screen capture.
To install the package with NPM
1npm install react-native-screen-capture-secure
To install the package with YARN
1yarn add react-native-screen-capture-secure
You should link the package in your application ( recommended by documentation )
1npx react-native link react-native-screen-capture-secure
React native screen capture secure provide two methods to enable and disable screen capture.
To disable screen capture,
To enable screen capture,
1import ScreenCaptureSecure from 'react-native-screen-capture-secure';23ScreenCaptureSecure.enableSecure();4ScreenCaptureSecure.disableSecure();
Thanks for reading…
Follow me on Twitter
Join our email list and get notified about new content
No worries, I respect your privacy and I will never abuse your email.
Every week, on Tuesday, you will receive a list of free tutorials I made during the week (I write one every day) and news on other training products I create.