Share the current screen to another user in the call.

My goal is to implement a screen sharing function like Skype, Discord etc. My biggest problem in that implementation is that when you have an active RPScreenRecorder.shared() screen recording and then leave the app, the screen recording stops.

For my goal it is necessary to be able to share the screen even if the app is in background. For example: The local user shares his current screen to another user, then exits the app to show the other user his Photo Library in realtime.

Problem 1:

I have came across ReplayKit and "RPBroadcastSampleHandler", but this extension is only called when I explicitly run the app with the "ScreenShare" scheme that I created. When I try to run the app on the normal/main scheme the extension functions aren't called.

Problem 2:

I can't call my pod functionalities from the "RPBroadcastSampleHandler" class. It just says "-PodName- not found" when I try to import the pod I need to use.

There are no full documentations on that topic and I would really appreciate anybody who can explain to me what I am doing wrong.