You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Simplify broadcast extension setup with standard format for identifiers (livekit#573)
When configuring a broadcast extension, manually setting the info keys
`RTCAppGroupIdentifier` and `RTCScreenSharingExtension` is no longer
required when using the standard format. The standard format is as
follows:
- App group: `group.<main-app-bundle-id>`
- Broadcast extension: `<main-app-bundle-id>.broadcast`
---------
Co-authored-by: Hiroshi Horie <[email protected]>
Copy file name to clipboardExpand all lines: Docs/ios-screen-sharing.md
+16-12Lines changed: 16 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -44,15 +44,17 @@ flowchart LR
44
44
45
45
To use the Broadcast Capture mode, follow these steps to add a Broadcast Upload Extension target and associated configuration to your project. You can also refer to the [example app](https://github.com/livekit-examples/swift-example), which demonstrates this configuration.
2. From the template chooser, select "Broadcast Upload Extension"
54
-
3. Name the extension (e.g. "BroadcastExtension"). Take note of the extension's bundle identifier, as it will be needed later.
55
-
4. Replace the default content of `SampleHandler.swift` in the new target with the following:
54
+
3. Name the extension (e.g. "BroadcastExtension").
55
+
4. Press "Finish"
56
+
5. From the "Signing & Capabilities" tab of the new target, change the bundle identifier to be the same as your main app with `.broadcast` added to the end. To use a custom identifier, see *[Custom Identifiers](#custom-identifiers)* below.
57
+
6. Replace the default content of `SampleHandler.swift` in the new target with the following:
56
58
57
59
```swift
58
60
importLiveKit
@@ -75,14 +77,9 @@ In order for the broadcast extension to communicate with your app, they must be
75
77
2. Select the "Signing & Capabilities" tab and press the "+ Capability" button.
76
78
3. Add the "App Groups" capability.
77
79
4. Press "+" to add a new app group.
78
-
5. Enter an app group identifier in the format `group.<domain>.<group_name>`. Be sure to use the same identifier for both targets.
79
-
80
-
#### 3. Add Properties to Info.plist
81
-
82
-
1. Set `RTCAppGroupIdentifier` in the Info.plist of **both targets** to the group identifier from the previous step.
83
-
2. Set `RTCScreenSharingExtension` in the Info.plist of your **primary app target** to the broadcast extension's bundle identifier.
80
+
5. Add the target to the group `group.<main-app-bundle-id>`. To use a custom identifier, see *[Custom Identifiers](#custom-identifiers)* below.
84
81
85
-
#### 4. Begin Screen Share
82
+
#### 3. Begin Screen Share
86
83
87
84
With setup of the broadcast extension complete, broadcast capture will be used by default when enabling screen share:
88
85
```swift
@@ -102,6 +99,8 @@ While running your app in a debug session in Xcode, check the debug console for
102
99
103
100
### Advanced Usage
104
101
102
+
#### Manual Track Publication
103
+
105
104
When using broadcast capture, a broadcast can be initiated externally (for example, via control center). By default, when a broadcast begins, the local participant automatically publishes a screen share track. In some cases, however, you may want to handle track publication manually. You can achieve this by using `BroadcastManager`:
@@ -129,3 +128,8 @@ class MyDelegate: BroadcastManagerDelegate {
129
128
}
130
129
BroadcastManager.shared.delegate=MyDelegate()
131
130
```
131
+
132
+
#### Custom Identifiers
133
+
134
+
By default, the app group identifier is expected to be `group.<main-app-bundle-id>`, and the broadcast extension's bundle identifier is expected to be `<main-app-bundle-id>.broadcast`.
135
+
To override these values, set `RTCAppGroupIdentifier` in Info.plistfor both targets (both broadcast extension and main app), and set `RTCScreenSharingExtension` in Info.plist for your main app.
0 commit comments