Open notclive opened 1 year ago
not working on ios 17
Running into the same problem here. Interested to see how we can get it working for iOS17 again.
+1
This could offer a possible solution: https://gist.github.com/ashishkakkad8/747223d68f3675dce4f05e4396baec7e
+1
HI any update on it
+1 Its not working in IOS 17
I've made this PR that addresses this issues. It works for me by patching this package, but I wanted to contribute with a PR. @killserver
https://github.com/killserver/react-native-screenshot-prevent/pull/31
send update in version 1.1.9. check pls and thx all )
@killserver @Nikooos @notclive @riorafe After taking screenshot, warning pop-up is not closing & when we come to other screen it takes screenshot
componentDidMount(){ // Prevent screenshots when the component is mounted ScreenshotPrevent.enabled(true); ScreenshotPrevent.enableSecureView(); // Add a listener to handle screenshot prevention events this.subscription = addListener(() => { }); } componentWillUnmount() { this._engine?.destroy(); ScreenshotPrevent.enabled(false); ScreenshotPrevent.disableSecureView(); this.subscription.remove(); }
Hi! Thanks for this useful package. 👍🏼 So I have tried version v1.1.9 on iPhone X running iOS 17.2.1, but Im still able to take screenshot.
The screenshot:
Code (App.tsx
):
!__DEV__ && PreventScreenshot.enableSecureView()
package.json
:
"react": "17.0.2",
"react-native": "0.65.1",
"react-native-screenshot-prevent": "^1.1.9",
Any kind of help would be appreciated, thanks.
I've put up a PR that should fix this issue, the only thing is that since we didn't need the image functionality in my workplace, I didn't have time to test and keep support for it, but the main idea is to add the textfield secure layer to the app's UIWindow, and from there it should work, and we should be able to add the image as a background to the textfield so it works
Thanks @GianniCarlo ! I tried your PR and the enable/disable screenshot works as expected (tested on iOS 17.5 simulator, android not yet).
I understand that the iOS screenshot prevention is unofficial, and is based on a bit of a hack. It looks like this hack has stopped working as of iOS 17.