wn-na / react-native-capture-protection

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
MIT License
102 stars 10 forks source link

Prevent Screenshot is not working in android #54

Closed ricophie03 closed 1 week ago

ricophie03 commented 2 weeks ago

Hi, I'm tried to prevent any screenshot or screen recording on specific screen in my app. I tried to add an effect like your documentation here: React.useEffect(() => { bindProtection(); return () => { releaseProtection(true); }; }, []);

I tried it in ios simulator and the screenshot is expected to be black screen only. But in android, both my real device and emulator, I'm still able to screenshot while the screenrecord is stop automatically ( i expected the result of the record would be black screen only).

My Android device : Android 11 My Android emulator device :Android 13 react-native :0.72.7 react-native-capture-protection: 1.9.12

wn-na commented 2 weeks ago

hi @ricophie03. bindProtection is must be used with CaptureProtectionProvider. can you use it? or try preventScreenshot function?