How can I detect a user recording an iOS application using the ReplayKit screen recording APIs?

Apple publishes a reliable screen capture notification that I have used, but also want to know if the user is recording my application with the new ReplayKit API. We can try to get a UIScreenDidConnectNotification or check the .mirroredScreen property to see what happens, but none of them are reliable despite the old Apple technograph ( https://developer.apple.com/library/content/qa/qa1738/ _index.html ), in other words. We could look at the height of the status bar, but this has false positives. Has anyone got something for this?

+5
source share
1 answer

You tried to register RPScreenRecorderDelegate. There is a screenRecorderDidChangeAvailability callback.

https://developer.apple.com/documentation/replaykit/rpscreenrecorderdelegate?language=objc

+2
source

Source: https://habr.com/ru/post/1268718/


All Articles