iosiphonereplaykit

Use ReplayKit to record any app on screen


I am trying to create an iPhone app that records not only the app's screen but if put into the background it records everything on the screen, including other apps. This is how recording from "Control Center" works. The difference is I want to get access to the video immediately without user intervention, with the user's consent of course.

I've implemented code using ReplayKit2 on iOS 12 that uses an embedded Broadcast Upload Extension. I have not found any examples online that work like this.

I posted the code on Bitbucket: https://bitbucket.org/breelig/replaykitbroadcasttofile/src/master/

The closet similar question I found on SO is: ReplayKit stops screen recording in background mode of the application or outside the app?

Update

Based on the good responses by @KaneCheshire and @AndreyA. below and other random sources I was able to develop a solution that works. Please see the code in my BitBucket link above.


Solution

  • From the docs:

    Apps on a user’s device can share the recording function, with each app having its own instance of RPScreenRecorder. Your app can record the audio and video inside of the app, along with user commentary through the microphone

    The only other way to record the screen is through a Broadcast Upload Extension, which requires the user to initiate it through Control Centre.