Navigate back to the homepage

How to enable or disable screenshot in react native?

Infinitbility
React Native
December 7th, 2021 · 1 min read
How to enable or disable screenshot in react native?

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.

Installation

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

Usages

React native screen capture secure provide two methods to enable and disable screen capture.

To disable screen capture, ScreenCaptureSecure.enableSecure();. To enable screen capture, ScreenCaptureSecure.disableSecure();.

1import ScreenCaptureSecure from 'react-native-screen-capture-secure';
2
3ScreenCaptureSecure.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.

Looking For React Native Tutorial?

we are trying to create the best Tutorial for react native developers.

When you want a daily updates about React Native Tutorial or infinitbility update subscribe to our newsletter.

Read React Native Tutorial

Request New Tutorial or Article on mail [email protected]

Guide book

Guidebook: The Javascript Monorepo

Tutorials

Categories

More articles from Infinitbility

How to delete item from AsyncStorage in react native?

How to delete item from AsyncStorage in react native?

React native asyncstorage remove item example

December 6th, 2021 · 1 min read
How to get value from asyncstorage in react native?

How to get value from asyncstorage in react native?

React Native asyncstorage getItem example

December 5th, 2021 · 1 min read
© 2020–2022 Infinitbility
About
Link to $https://medium.com/infinitbilityLink to $https://www.facebook.com/InfinitbilityLink to $https://github.com/infinitbilityLink to $https://twitter.com/infinitbilityLink to $https://www.buymeacoffee.com/infinitbilityLink to $mailto:[email protected]