Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to prevent screen recording for iOS 18, isCaptured is deprecated while the replacement sceneCaptureState is not working for non-scene based app?

My App is very sensitive and it is a must to prevent any screen recording.

it was working fine using UIScreen.main.isCaptured and UIScreen.capturedDidChangeNotification. But for iOS 18 it became deprecated and is not working any more and the replacement as Apple says is sceneCaptureState. I tried that in a demo app and I found that it is working only for a scene-based app but it's not working for the old structure. so now i have that problem, my app is very big and does not support scenes at all, what shall I do to prevent screen recording ?

note the following code is what I am using and not working for non-scene-based app : window.traitCollection.sceneCaptureState == .active this line gives me wrong value if you killed the app and re-opened it again

registerForTraitChanges([UITraitSceneCaptureState.self]) this for observing the changes only and works fine

initiated recording screen the open the app for the first time then window.traitCollection.sceneCaptureState == .active this line gives me false value while it should give me true

Note: My app does not support any scene configuration

like image 455
Shrief_Nasr Avatar asked Oct 19 '25 11:10

Shrief_Nasr


1 Answers

This issue can be fixed by upgrading iOS to iOS18 beta(22A5325f) or higher.

like image 162
Junnpy Z Avatar answered Oct 22 '25 00:10

Junnpy Z



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!