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

iOS 18 support #52

Open elsa17z opened 1 month ago

elsa17z commented 1 month ago

Thank you for this amazing library! The iOS screen recording detection, isCaptured is deprecated from iOS 18 onwards, and has been replaced by sceneCaptureState https://developer.apple.com/documentation/uikit/uitraitcollection/4292628-scenecapturestate?language=objc, would it be possible to implement this so screen recording detection on iOS can support iOS 18 and above? Thanks!

wn-na commented 4 weeks ago

@elsa17z hi, Thanks for letting i know! i'll add it as soon

wn-na commented 3 weeks ago

@elsa17z Hi, I've checked, but I'm trying to convert it to a swift over that value and use that function to fix it. For now, the function I'm using is still working on iOS 18, so can you be patient?

https://developer.apple.com/documentation/swiftui/environmentvalues/isscenecaptured

elsa17z commented 3 weeks ago

Thank you for your work! We will be patient, we have added a manual thing for user to confirm they have started the screen recording in iOS 18 instead.

wn-na commented 3 weeks ago

@elsa17z Thank you for your response. I'm working as quickly and carefully as possible and hope to have some good news for you soon.