Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable the screenshot prevention in specific screen #49

Open
MichelNassarFC opened this issue Aug 20, 2024 · 1 comment
Open

Enable the screenshot prevention in specific screen #49

MichelNassarFC opened this issue Aug 20, 2024 · 1 comment

Comments

@MichelNassarFC
Copy link

How are we able to enable the screenshot prevention in specific screen?
For now if it's enabled in a screen, it will be enabled everywhere unless if i disableSecureView on screen unfocus, and if i do that, the app starts taking around 1gb ram after focusing/unfocusing the screen for like 10 times, solution?

useEffect(() => {
if(!DEV){
if (isFocused) {
RNScreenshotPrevent.enabled(true);
isIOS &&
RNScreenshotPrevent.enableSecureView(Image.resolveAssetSource(screenshotPreventImage).uri);
} else {
RNScreenshotPrevent.disableSecureView();
RNScreenshotPrevent.enabled(false);
}
}
return () => {
RNScreenshotPrevent.disableSecureView();
RNScreenshotPrevent.enabled(false);
};
}, [isFocused]);

@atipezda
Copy link

Same problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants