简体   繁体   中英

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?

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM