Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I detect a user recording my iOS app with the ReplayKit screen recording APIs?

Apple posts a reliable notification for screenshot detection which I've been using, but I'd like to also detect if the user is recording my app with the new ReplayKit API. We can try to get a UIScreenDidConnectNotification or test the .mirroredScreen property to see if there's anything going on, but neither of these are reliable, despite Apple's old technote (https://developer.apple.com/library/content/qa/qa1738/_index.html) saying otherwise. We could look at the height of the status bar, but that has false positives. Has anyone gotten something working for this?

like image 473
meisel Avatar asked Oct 29 '22 06:10

meisel


1 Answers

Have you tried registering a RPScreenRecorderDelegate. There is a screenRecorderDidChangeAvailability callback.

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

like image 61
N3SS4H Avatar answered Nov 15 '22 07:11

N3SS4H