Skip to content

Commit

Permalink
Merge pull request #37 from alalbuquerque22/patch-1
Browse files Browse the repository at this point in the history
Update README.md w fix example
  • Loading branch information
killserver authored Mar 14, 2024
2 parents 243590b + 6190936 commit 4fbf330
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ import RNScreenshotPrevent, { addListener } from 'react-native-screenshot-preven
/* (IOS, Android) for android might be the only step to get secureView
* on IOS enables blurry view when app goes into inactive state
*/
RNPreventScreenshot.enabled(true/false);
RNScreenshotPrevent.enabled(true/false);

/* (IOS) enableSecureView for IOS13+
* creates a hidden secureTextField which prevents Application UI capture on screenshots
*/
if(!__DEV__) RNPreventScreenshot.enableSecureView();
if(!__DEV__) RNScreenshotPrevent.enableSecureView();

/* (IOS) enableSecureView for IOS13+
* creates a hidden secureTextField which prevents Application UI capture on screenshots
Expand All @@ -73,7 +73,7 @@ if(!__DEV__) RNPreventScreenshot.enableSecureView(imgUri);
/* (IOS) disableSecureView for IOS13+
* remove a hidden secureTextField which prevents Application UI capture on screenshots
*/
if(!__DEV__) RNPreventScreenshot.disableSecureView();
if(!__DEV__) RNScreenshotPrevent.disableSecureView();

/* (IOS) notification handler
* notifies when user has taken screenshot (yes, after taking) - you can show alert or do some actions
Expand All @@ -85,7 +85,7 @@ addListener(fn);

/** example using the listener */
useEffect(() => {
const subscription = RNPreventScreenshot.addListener(() => {
const subscription = RNScreenshotPrevent.addListener(() => {
console.log('Screenshot taken');
showAlert({
title: 'Warning',
Expand Down

0 comments on commit 4fbf330

Please sign in to comment.