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

Screenshot prevention has stopped working with iOS 17 #28

Open
notclive opened this issue Jul 31, 2023 · 13 comments
Open

Screenshot prevention has stopped working with iOS 17 #28

notclive opened this issue Jul 31, 2023 · 13 comments
Labels
help wanted Extra attention is needed

Comments

@notclive
Copy link

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.

@ajayranga
Copy link

not working on ios 17

@Nikooos
Copy link
Contributor

Nikooos commented Sep 1, 2023

Running into the same problem here. Interested to see how we can get it working for iOS17 again.

@baesumin
Copy link

baesumin commented Sep 3, 2023

+1

@Nikooos
Copy link
Contributor

Nikooos commented Sep 7, 2023

This could offer a possible solution: https://gist.github.com/ashishkakkad8/747223d68f3675dce4f05e4396baec7e

@shonie2xx
Copy link

+1

@ajayranga
Copy link

HI any update on it

@riorafe
Copy link

riorafe commented Sep 25, 2023

+1
Its not working in IOS 17

@Nikooos
Copy link
Contributor

Nikooos commented Sep 27, 2023

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

#31

@killserver
Copy link
Owner

send update in version 1.1.9. check pls and thx all )

@killserver killserver added the help wanted Extra attention is needed label Oct 4, 2023
@vishalyad16
Copy link

vishalyad16 commented Oct 13, 2023

@killserver @Nikooos @notclive @riorafe After taking screenshot, warning pop-up is not closing & when we come to other screen it takes screenshot
### here is my code import ScreenshotPrevent, { addListener } from 'react-native-screenshot-prevent';
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();
}

@7dp
Copy link

7dp commented Jan 17, 2024

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:
image

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.

@GianniCarlo
Copy link

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

@7dp
Copy link

7dp commented Aug 27, 2024

Thanks @GianniCarlo !
I tried your PR and the enable/disable screenshot works as expected (tested on iOS 17.5 simulator, android not yet).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

10 participants