Screen Sharing Integration
Creating the Broadcast Upload Extension
Step 1: Add a Broadcast Upload Extension, without UI, to your app. Update deployment info to run in iOS 14.5 or newer.
For creating the extension you need to add a new target to your application, selecting the Broadcast Upload Extension template. Fill in the desired name, change the language to Swift, make sure Include UI Extension is not selected, as we don't need custom UI for our case, then press Finish (screenshot 1-TODO). You will see that a new folder with the extension's name was added to the project's tree, containing the SampleHandler.swift class. Also, make sure to update the Deployment Info, for the newly created extension, to iOS 14.5 or newer.
Step 2: Add required files to Broadcast Extension target
Check for ScreenShare.zip folder provided along with SDK, extract the zip to get desired files required to complete below mentioned steps. Copy SampleUploader.swift, SocketConnection.swift, DarwinNotificationCenter.swift and Atomic.swift files from the sample project to your extension. Make sure they are added to the extension's target. Update SampleHandler.swift with the code from the SampleHandler.swift file provided in zip.
Step 3: Setup app-group
Now as a next step needs to enable data sharing between app and broadcast extension. To enable data sharing, use Xcode or the Developer portal to enable app groups for the containing app and its contained app extensions. Next, register the app group in the portal and specify the app group to use in the containing app.
Add both the app and the extension to the same App Group. Next, add the app group id value to the app's Info.plist for the RTCAppGroupIdentifier key. Add a new key RTCScreenSharingExtension to the app's Info.plist with the extension's Bundle Identifier as the value.
In broadcast extension, update appGroupIdentifier constant with the App Group name your app and extension are both registered to. For this, search for group.com.sct.proconf in side broadcast extension folder and replace this with your app group name.
Step 4: Add required capabilities
Add voip to UIBackgroundModes, in the app's Info.plist, in order to work when the app is in the background.