@cometchat/skills 4.3.0 → 4.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/bin/install.js +27 -0
- package/package.json +14 -1
- package/skills/cometchat/SKILL.md +233 -69
- package/skills/cometchat/references/asking-questions.md +48 -0
- package/skills/cometchat-a11y/SKILL.md +3 -2
- package/skills/cometchat-android-v5/SKILL.md +2 -1
- package/skills/cometchat-android-v5-calls/SKILL.md +36 -22
- package/skills/cometchat-android-v5-calls/references/README.md +1 -1
- package/skills/cometchat-android-v5-calls/references/add-calls-to-existing-chat.md +7 -5
- package/skills/cometchat-android-v5-calls/references/audio-controls.md +4 -4
- package/skills/cometchat-android-v5-calls/references/call-layouts.md +33 -25
- package/skills/cometchat-android-v5-calls/references/call-session.md +2 -2
- package/skills/cometchat-android-v5-calls/references/custom-ui.md +5 -5
- package/skills/cometchat-android-v5-calls/references/event-listeners.md +2 -2
- package/skills/cometchat-android-v5-calls/references/idle-timeout.md +20 -14
- package/skills/cometchat-android-v5-calls/references/in-call-chat.md +1 -1
- package/skills/cometchat-android-v5-calls/references/migration-v4-to-v5.md +43 -27
- package/skills/cometchat-android-v5-calls/references/participant-management.md +3 -3
- package/skills/cometchat-android-v5-calls/references/raise-hand.md +25 -19
- package/skills/cometchat-android-v5-calls/references/recording.md +2 -2
- package/skills/cometchat-android-v5-calls/references/ringing-integration.md +1 -1
- package/skills/cometchat-android-v5-calls/references/screen-sharing.md +5 -9
- package/skills/cometchat-android-v5-calls/references/session-settings.md +3 -3
- package/skills/cometchat-android-v5-calls/references/setup.md +1 -1
- package/skills/cometchat-android-v5-calls/references/share-invite.md +9 -4
- package/skills/cometchat-android-v5-calls/references/video-controls.md +4 -4
- package/skills/cometchat-android-v5-calls/references/voip-calling.md +2 -2
- package/skills/cometchat-android-v5-components/SKILL.md +4 -3
- package/skills/cometchat-android-v5-core/SKILL.md +5 -3
- package/skills/cometchat-android-v5-customization/SKILL.md +171 -7
- package/skills/cometchat-android-v5-extensions/SKILL.md +7 -4
- package/skills/cometchat-android-v5-features/SKILL.md +5 -4
- package/skills/cometchat-android-v5-placement/SKILL.md +2 -1
- package/skills/cometchat-android-v5-production/SKILL.md +2 -1
- package/skills/cometchat-android-v5-push/SKILL.md +2 -3
- package/skills/cometchat-android-v5-testing/SKILL.md +2 -1
- package/skills/cometchat-android-v5-theming/SKILL.md +2 -1
- package/skills/cometchat-android-v5-troubleshooting/SKILL.md +3 -2
- package/skills/cometchat-android-v6/SKILL.md +2 -1
- package/skills/cometchat-android-v6-builder-settings/SKILL.md +11 -7
- package/skills/cometchat-android-v6-calls/SKILL.md +79 -18
- package/skills/cometchat-android-v6-calls/references/advanced-features.md +87 -0
- package/skills/cometchat-android-v6-calls/references/call-layouts.md +24 -15
- package/skills/cometchat-android-v6-calls/references/call-session.md +2 -2
- package/skills/cometchat-android-v6-calls/references/device-management.md +17 -16
- package/skills/cometchat-android-v6-calls/references/idle-timeout.md +7 -4
- package/skills/cometchat-android-v6-calls/references/in-call-chat.md +13 -8
- package/skills/cometchat-android-v6-calls/references/raise-hand.md +6 -4
- package/skills/cometchat-android-v6-compose-components/SKILL.md +52 -29
- package/skills/cometchat-android-v6-compose-customization/SKILL.md +156 -1
- package/skills/cometchat-android-v6-compose-placement/SKILL.md +129 -40
- package/skills/cometchat-android-v6-compose-theming/SKILL.md +27 -1
- package/skills/cometchat-android-v6-core/SKILL.md +208 -28
- package/skills/cometchat-android-v6-events/SKILL.md +4 -1
- package/skills/cometchat-android-v6-extensions/SKILL.md +2 -1
- package/skills/cometchat-android-v6-features/SKILL.md +26 -2
- package/skills/cometchat-android-v6-kotlin-components/SKILL.md +31 -1
- package/skills/cometchat-android-v6-kotlin-customization/SKILL.md +172 -1
- package/skills/cometchat-android-v6-kotlin-placement/SKILL.md +20 -5
- package/skills/cometchat-android-v6-kotlin-theming/SKILL.md +36 -5
- package/skills/cometchat-android-v6-migration/SKILL.md +44 -42
- package/skills/cometchat-android-v6-production/SKILL.md +6 -3
- package/skills/cometchat-android-v6-push/SKILL.md +43 -2
- package/skills/cometchat-android-v6-testing/SKILL.md +11 -8
- package/skills/cometchat-android-v6-troubleshooting/SKILL.md +26 -5
- package/skills/cometchat-angular-calls/SKILL.md +256 -389
- package/skills/cometchat-angular-calls/references/add-calls-to-existing-chat.md +3 -2
- package/skills/cometchat-angular-calls/references/call-layouts.md +29 -12
- package/skills/cometchat-angular-calls/references/call-session.md +2 -2
- package/skills/cometchat-angular-calls/references/custom-ui.md +18 -10
- package/skills/cometchat-angular-calls/references/device-management.md +53 -34
- package/skills/cometchat-angular-calls/references/group-calls.md +45 -24
- package/skills/cometchat-angular-calls/references/idle-timeout.md +31 -15
- package/skills/cometchat-angular-calls/references/ngzone-and-async-callbacks.md +7 -6
- package/skills/cometchat-angular-calls/references/raise-hand.md +9 -4
- package/skills/cometchat-angular-calls/references/recording-screen-share.md +32 -39
- package/skills/cometchat-angular-calls/references/ringing-integration.md +3 -1
- package/skills/cometchat-angular-calls/references/share-invite.md +11 -5
- package/skills/cometchat-angular-calls/references/virtual-background.md +29 -0
- package/skills/cometchat-angular-components/SKILL.md +149 -620
- package/skills/cometchat-angular-core/SKILL.md +232 -312
- package/skills/cometchat-angular-customization/SKILL.md +415 -223
- package/skills/cometchat-angular-features/SKILL.md +216 -334
- package/skills/cometchat-angular-patterns/SKILL.md +168 -359
- package/skills/cometchat-angular-placement/SKILL.md +189 -560
- package/skills/cometchat-angular-production/SKILL.md +241 -92
- package/skills/cometchat-angular-push/SKILL.md +280 -294
- package/skills/cometchat-angular-testing/SKILL.md +430 -158
- package/skills/cometchat-angular-theming/SKILL.md +190 -265
- package/skills/cometchat-angular-troubleshooting/SKILL.md +192 -157
- package/skills/cometchat-astro-patterns/SKILL.md +3 -2
- package/skills/cometchat-calls/SKILL.md +25 -19
- package/skills/cometchat-calls/references/use-case-broadcast.md +15 -10
- package/skills/cometchat-calls/references/use-case-marketplace.md +2 -3
- package/skills/cometchat-calls/references/use-case-support.md +3 -4
- package/skills/cometchat-calls/references/use-case-team.md +23 -12
- package/skills/cometchat-calls/references/use-case-telehealth.md +3 -4
- package/skills/cometchat-components/SKILL.md +163 -25
- package/skills/cometchat-core/SKILL.md +258 -20
- package/skills/cometchat-customization/SKILL.md +50 -25
- package/skills/cometchat-features/SKILL.md +314 -35
- package/skills/cometchat-flutter-v5/SKILL.md +10 -4
- package/skills/cometchat-flutter-v5-calls/SKILL.md +188 -158
- package/skills/cometchat-flutter-v5-calls/references/add-calls-to-existing-chat.md +48 -24
- package/skills/cometchat-flutter-v5-calls/references/call-layouts.md +20 -15
- package/skills/cometchat-flutter-v5-calls/references/call-session.md +100 -145
- package/skills/cometchat-flutter-v5-calls/references/device-management.md +12 -8
- package/skills/cometchat-flutter-v5-calls/references/group-calls.md +30 -36
- package/skills/cometchat-flutter-v5-calls/references/idle-timeout.md +15 -13
- package/skills/cometchat-flutter-v5-calls/references/in-call-chat.md +12 -9
- package/skills/cometchat-flutter-v5-calls/references/migration-v4-to-v5.md +115 -65
- package/skills/cometchat-flutter-v5-calls/references/raise-hand.md +41 -30
- package/skills/cometchat-flutter-v5-calls/references/ringing-integration.md +17 -14
- package/skills/cometchat-flutter-v5-calls/references/share-invite.md +8 -2
- package/skills/cometchat-flutter-v5-conversations/SKILL.md +2 -1
- package/skills/cometchat-flutter-v5-core/SKILL.md +5 -4
- package/skills/cometchat-flutter-v5-customization/SKILL.md +136 -5
- package/skills/cometchat-flutter-v5-events/SKILL.md +2 -1
- package/skills/cometchat-flutter-v5-messages/SKILL.md +2 -1
- package/skills/cometchat-flutter-v5-production/SKILL.md +15 -6
- package/skills/cometchat-flutter-v5-push/SKILL.md +2 -1
- package/skills/cometchat-flutter-v5-testing/SKILL.md +17 -6
- package/skills/cometchat-flutter-v5-theming/SKILL.md +2 -1
- package/skills/cometchat-flutter-v5-troubleshooting/SKILL.md +7 -6
- package/skills/cometchat-flutter-v5-users-groups/SKILL.md +3 -2
- package/skills/cometchat-flutter-v6/SKILL.md +17 -16
- package/skills/cometchat-flutter-v6-calls/SKILL.md +72 -57
- package/skills/cometchat-flutter-v6-calls/references/add-calls-to-existing-chat.md +5 -3
- package/skills/cometchat-flutter-v6-calls/references/advanced-features.md +89 -0
- package/skills/cometchat-flutter-v6-calls/references/call-layouts.md +15 -12
- package/skills/cometchat-flutter-v6-calls/references/call-session.md +2 -2
- package/skills/cometchat-flutter-v6-calls/references/device-management.md +9 -3
- package/skills/cometchat-flutter-v6-calls/references/group-calls.md +10 -10
- package/skills/cometchat-flutter-v6-calls/references/idle-timeout.md +15 -7
- package/skills/cometchat-flutter-v6-calls/references/in-call-chat.md +6 -3
- package/skills/cometchat-flutter-v6-calls/references/raise-hand.md +23 -16
- package/skills/cometchat-flutter-v6-components/SKILL.md +32 -11
- package/skills/cometchat-flutter-v6-conversations/SKILL.md +39 -11
- package/skills/cometchat-flutter-v6-core/SKILL.md +182 -21
- package/skills/cometchat-flutter-v6-customization/SKILL.md +97 -25
- package/skills/cometchat-flutter-v6-events/SKILL.md +3 -2
- package/skills/cometchat-flutter-v6-features/SKILL.md +15 -6
- package/skills/cometchat-flutter-v6-messages/SKILL.md +111 -60
- package/skills/cometchat-flutter-v6-migration/SKILL.md +18 -25
- package/skills/cometchat-flutter-v6-placement/SKILL.md +79 -50
- package/skills/cometchat-flutter-v6-production/SKILL.md +13 -12
- package/skills/cometchat-flutter-v6-push/SKILL.md +41 -19
- package/skills/cometchat-flutter-v6-testing/SKILL.md +4 -4
- package/skills/cometchat-flutter-v6-theming/SKILL.md +38 -5
- package/skills/cometchat-flutter-v6-troubleshooting/SKILL.md +182 -17
- package/skills/cometchat-flutter-v6-users-groups/SKILL.md +12 -4
- package/skills/cometchat-i18n/SKILL.md +140 -79
- package/skills/cometchat-ios/SKILL.md +4 -2
- package/skills/cometchat-ios-calls/SKILL.md +225 -95
- package/skills/cometchat-ios-calls/references/add-calls-to-existing-chat.md +11 -9
- package/skills/cometchat-ios-calls/references/audio-modes-and-controls.md +45 -0
- package/skills/cometchat-ios-calls/references/avaudiosession-routing.md +6 -7
- package/skills/cometchat-ios-calls/references/call-layouts.md +31 -91
- package/skills/cometchat-ios-calls/references/call-session.md +51 -54
- package/skills/cometchat-ios-calls/references/callkit-and-pushkit.md +33 -29
- package/skills/cometchat-ios-calls/references/custom-ui.md +38 -38
- package/skills/cometchat-ios-calls/references/group-calls.md +33 -70
- package/skills/cometchat-ios-calls/references/idle-timeout.md +24 -25
- package/skills/cometchat-ios-calls/references/in-call-chat.md +19 -23
- package/skills/cometchat-ios-calls/references/migration-v4-to-v5.md +128 -70
- package/skills/cometchat-ios-calls/references/picture-in-picture.md +20 -20
- package/skills/cometchat-ios-calls/references/raise-hand.md +14 -227
- package/skills/cometchat-ios-calls/references/recording-screen-share.md +35 -122
- package/skills/cometchat-ios-calls/references/ringing-integration.md +17 -16
- package/skills/cometchat-ios-calls/references/share-invite.md +8 -12
- package/skills/cometchat-ios-calls/references/swiftui-uikit-hosting.md +4 -4
- package/skills/cometchat-ios-components/SKILL.md +200 -12
- package/skills/cometchat-ios-core/SKILL.md +173 -45
- package/skills/cometchat-ios-customization/SKILL.md +276 -110
- package/skills/cometchat-ios-features/SKILL.md +64 -36
- package/skills/cometchat-ios-placement/SKILL.md +15 -12
- package/skills/cometchat-ios-production/SKILL.md +12 -4
- package/skills/cometchat-ios-push/SKILL.md +53 -19
- package/skills/cometchat-ios-testing/SKILL.md +14 -9
- package/skills/cometchat-ios-theming/SKILL.md +39 -3
- package/skills/cometchat-ios-troubleshooting/SKILL.md +41 -21
- package/skills/cometchat-native-bare-patterns/SKILL.md +36 -19
- package/skills/cometchat-native-calls/SKILL.md +29 -17
- package/skills/cometchat-native-calls/references/add-calls-to-existing-chat.md +2 -2
- package/skills/cometchat-native-calls/references/call-layouts.md +15 -14
- package/skills/cometchat-native-calls/references/call-session.md +2 -2
- package/skills/cometchat-native-calls/references/custom-ui.md +12 -8
- package/skills/cometchat-native-calls/references/device-management.md +53 -30
- package/skills/cometchat-native-calls/references/group-calls.md +35 -30
- package/skills/cometchat-native-calls/references/idle-timeout.md +6 -6
- package/skills/cometchat-native-calls/references/in-call-chat.md +10 -8
- package/skills/cometchat-native-calls/references/migration-v4-to-v5.md +2 -2
- package/skills/cometchat-native-calls/references/raise-hand.md +15 -13
- package/skills/cometchat-native-calls/references/recording-screen-share.md +49 -170
- package/skills/cometchat-native-calls/references/share-invite.md +7 -5
- package/skills/cometchat-native-calls/references/voip-push-end-to-end.md +4 -2
- package/skills/cometchat-native-components/SKILL.md +84 -52
- package/skills/cometchat-native-core/SKILL.md +102 -33
- package/skills/cometchat-native-customization/SKILL.md +150 -28
- package/skills/cometchat-native-expo-patterns/SKILL.md +60 -29
- package/skills/cometchat-native-features/SKILL.md +24 -17
- package/skills/cometchat-native-placement/SKILL.md +19 -10
- package/skills/cometchat-native-production/SKILL.md +9 -3
- package/skills/cometchat-native-push/SKILL.md +2 -1
- package/skills/cometchat-native-testing/SKILL.md +1 -2
- package/skills/cometchat-native-theming/SKILL.md +54 -29
- package/skills/cometchat-native-troubleshooting/SKILL.md +11 -5
- package/skills/cometchat-nextjs-patterns/SKILL.md +22 -8
- package/skills/cometchat-placement/SKILL.md +42 -3
- package/skills/cometchat-production/SKILL.md +12 -5
- package/skills/cometchat-react-calls/SKILL.md +220 -10
- package/skills/cometchat-react-calls/references/add-calls-to-existing-chat.md +4 -3
- package/skills/cometchat-react-calls/references/call-layouts.md +5 -6
- package/skills/cometchat-react-calls/references/call-session.md +1 -1
- package/skills/cometchat-react-calls/references/custom-ui.md +61 -15
- package/skills/cometchat-react-calls/references/device-management.md +55 -51
- package/skills/cometchat-react-calls/references/group-calls.md +18 -23
- package/skills/cometchat-react-calls/references/idle-timeout.md +25 -12
- package/skills/cometchat-react-calls/references/in-call-chat.md +7 -7
- package/skills/cometchat-react-calls/references/migration-v4-to-v5.md +9 -11
- package/skills/cometchat-react-calls/references/raise-hand.md +14 -14
- package/skills/cometchat-react-calls/references/recording-screen-share.md +39 -38
- package/skills/cometchat-react-calls/references/ringing-integration.md +2 -2
- package/skills/cometchat-react-calls/references/share-invite.md +4 -5
- package/skills/cometchat-react-calls/references/testing-calls-on-web.md +20 -2
- package/skills/cometchat-react-calls/references/virtual-background.md +32 -0
- package/skills/cometchat-react-patterns/SKILL.md +45 -5
- package/skills/cometchat-react-push/SKILL.md +258 -72
- package/skills/cometchat-react-router-patterns/SKILL.md +12 -6
- package/skills/cometchat-react-testing/SKILL.md +14 -5
- package/skills/cometchat-theming/SKILL.md +181 -18
- package/skills/cometchat-troubleshooting/SKILL.md +40 -20
|
@@ -33,25 +33,25 @@ No code needed beyond CallKit setup. The skill defaults to this path for standal
|
|
|
33
33
|
|
|
34
34
|
---
|
|
35
35
|
|
|
36
|
-
## SDK-managed PiP
|
|
36
|
+
## SDK-managed PiP — `CometChatCalls.enterPIPMode()` / `exitPIPMode()`
|
|
37
37
|
|
|
38
|
-
> **
|
|
38
|
+
> **Verified against `CometChatCallsSDK` v5 Swift interface:** the SDK exposes two STATIC methods on `CometChatCalls` to toggle its internal picture-in-picture mode — `CometChatCalls.enterPIPMode()` and `CometChatCalls.exitPIPMode()`. There is NO `CallSession.shared.enablePictureInPictureLayout()` (no `CallSession` type exists), and NO `CometChatCalls.attachPictureInPictureLayer(layer)` / `detachPictureInPictureLayer()`. The SDK does NOT expose video frames or a `CMSampleBuffer` pipeline to drive a host-app `AVPictureInPictureController`.
|
|
39
39
|
|
|
40
40
|
### What works today
|
|
41
41
|
|
|
42
42
|
| Goal | API |
|
|
43
43
|
|---|---|
|
|
44
|
-
| Switch the SDK's call surface to compact
|
|
45
|
-
| Switch back to full layout | `
|
|
44
|
+
| Switch the SDK's call surface to compact PiP mode | `CometChatCalls.enterPIPMode()` |
|
|
45
|
+
| Switch back to full layout | `CometChatCalls.exitPIPMode()` |
|
|
46
46
|
|
|
47
47
|
```swift
|
|
48
48
|
import CometChatCallsSDK
|
|
49
49
|
|
|
50
50
|
// When the user taps "minimize" in the call UI
|
|
51
|
-
|
|
51
|
+
CometChatCalls.enterPIPMode()
|
|
52
52
|
|
|
53
53
|
// When they tap to expand back, or before hangup
|
|
54
|
-
|
|
54
|
+
CometChatCalls.exitPIPMode()
|
|
55
55
|
```
|
|
56
56
|
|
|
57
57
|
This is **NOT iOS system-level PiP** (the floating window that survives backgrounding). It's an in-app compact layout. For true OS-level PiP (floating call window across all apps + lock screen), see the CallKit path above.
|
|
@@ -61,29 +61,29 @@ This is **NOT iOS system-level PiP** (the floating window that survives backgrou
|
|
|
61
61
|
Driving iOS system-level PiP via `AVPictureInPictureController` requires feeding video frames to an `AVSampleBufferDisplayLayer`. The Calls SDK does not expose its WebRTC video track for this — the peer-connection handle is internal. Three options:
|
|
62
62
|
|
|
63
63
|
1. **Recommended: use CallKit** (rule 1.7 SKILL.md). CallKit-managed VoIP calls get auto-PiP for free — no `AVPictureInPictureController` plumbing needed.
|
|
64
|
-
2. **Use the SDK's
|
|
64
|
+
2. **Use the SDK's PiP-mode API** (above — `enterPIPMode()`/`exitPIPMode()`) for in-app minimization. Acceptable UX for foreground-only flows.
|
|
65
65
|
3. **Roll your own WebRTC bridge.** Requires forking/patching the SDK to expose the underlying `RTCMediaStream` — not recommended.
|
|
66
66
|
|
|
67
67
|
### Required capability (CallKit path)
|
|
68
68
|
|
|
69
69
|
In Xcode → Signing & Capabilities → Background Modes → ensure **Audio, AirPlay, and Picture in Picture** is checked. CallKit needs this; without it, CallKit's auto-PiP doesn't fire even with a CallKit-managed call.
|
|
70
70
|
|
|
71
|
-
### Toggle button for SDK
|
|
71
|
+
### Toggle button for SDK PiP mode
|
|
72
72
|
|
|
73
73
|
```swift
|
|
74
74
|
@IBAction func toggleCompactLayout(_ sender: UIButton) {
|
|
75
75
|
if isCompact {
|
|
76
|
-
|
|
76
|
+
CometChatCalls.exitPIPMode()
|
|
77
77
|
} else {
|
|
78
|
-
|
|
78
|
+
CometChatCalls.enterPIPMode()
|
|
79
79
|
}
|
|
80
80
|
isCompact.toggle()
|
|
81
81
|
}
|
|
82
82
|
```
|
|
83
83
|
|
|
84
|
-
This switches the SDK's call surface between full and compact layouts. The compact view shows local + remote video tiles in a smaller container; useful when you want to free screen space for other UI but keep the call visible.
|
|
84
|
+
This switches the SDK's call surface between full and compact PiP layouts. The compact view shows local + remote video tiles in a smaller container; useful when you want to free screen space for other UI but keep the call visible.
|
|
85
85
|
|
|
86
|
-
> **Note**: `AVPictureInPictureController` + KVO on `isPictureInPicturePossible` patterns (previously documented here) are not applicable because the SDK does not expose the video frames `AVPictureInPictureController` requires. Use the CallKit path for system-level PiP, or this
|
|
86
|
+
> **Note**: `AVPictureInPictureController` + KVO on `isPictureInPicturePossible` patterns (previously documented here) are not applicable because the SDK does not expose the video frames `AVPictureInPictureController` requires. Use the CallKit path for system-level PiP, or this `enterPIPMode()`/`exitPIPMode()` API for in-app PiP-style minimization.
|
|
87
87
|
|
|
88
88
|
---
|
|
89
89
|
|
|
@@ -185,11 +185,11 @@ When the call ends:
|
|
|
185
185
|
|
|
186
186
|
```swift
|
|
187
187
|
func endCall() {
|
|
188
|
-
//
|
|
189
|
-
//
|
|
190
|
-
|
|
188
|
+
// Exit PiP mode BEFORE ending the session, otherwise a re-init of the SDK
|
|
189
|
+
// can inherit compact-layout state on the next call.
|
|
190
|
+
CometChatCalls.exitPIPMode()
|
|
191
191
|
|
|
192
|
-
|
|
192
|
+
CometChatCalls.endSession() // ends the WebRTC session (EXISTS in v5)
|
|
193
193
|
|
|
194
194
|
do {
|
|
195
195
|
try AVAudioSession.sharedInstance().setActive(false, options: .notifyOthersOnDeactivation)
|
|
@@ -203,7 +203,7 @@ If you ALSO drove a host-app `AVPictureInPictureController` (against an external
|
|
|
203
203
|
|
|
204
204
|
## Anti-patterns
|
|
205
205
|
|
|
206
|
-
1. **Using `CometChatCalls.attachPictureInPictureLayer(layer)` / `detachPictureInPictureLayer()
|
|
206
|
+
1. **Using `CometChatCalls.attachPictureInPictureLayer(layer)` / `detachPictureInPictureLayer()`, or any `CallSession.shared.*PictureInPictureLayout()` call** — none of these symbols exist on `CometChatCallsSDK` v5 (there is no `CallSession` type). Use `CometChatCalls.enterPIPMode()` / `CometChatCalls.exitPIPMode()` instead.
|
|
207
207
|
2. **Manual `AVPictureInPictureController` for VoIP apps without CallKit.** Lock-screen ringing breaks; the SDK does not expose its video pipeline so the PiP window won't render the call. Use CallKit.
|
|
208
208
|
3. **No `audio` background mode.** Audio cuts when the app backgrounds, regardless of PiP path.
|
|
209
209
|
4. **Mixing SDK compact-layout with host-driven `AVPictureInPictureController`.** Two competing PiP surfaces — the SDK's compact layout fights the user's manual PiP, both look broken. Pick one.
|
|
@@ -216,9 +216,9 @@ If you ALSO drove a host-app `AVPictureInPictureController` (against an external
|
|
|
216
216
|
- [ ] `audio` in `UIBackgroundModes` (Info.plist)
|
|
217
217
|
- [ ] Background Modes capability includes "Audio, AirPlay, and Picture in Picture"
|
|
218
218
|
|
|
219
|
-
**SDK
|
|
220
|
-
- [ ] `
|
|
221
|
-
- [ ] `
|
|
219
|
+
**SDK PiP-mode path (in-app PiP, no system-level PiP):**
|
|
220
|
+
- [ ] `CometChatCalls.enterPIPMode()` called to enter compact mode
|
|
221
|
+
- [ ] `CometChatCalls.exitPIPMode()` called BEFORE `endSession()` on hangup
|
|
222
222
|
- [ ] UI button to toggle between full/compact layouts
|
|
223
223
|
- [ ] NOT used together with a host-app `AVPictureInPictureController` (see anti-pattern #4)
|
|
224
224
|
|
|
@@ -1,239 +1,26 @@
|
|
|
1
|
-
# Raise hand on iOS
|
|
1
|
+
# Raise hand on iOS — NOT supported on the iOS Calls SDK v5
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**Raise-hand is not available on the iOS `CometChatCallsSDK` v5.** Do not emit any of these — none of them exist on the SDK:
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
- `CometChatCalls.raiseHand()` / `CometChatCalls.lowerHand()`
|
|
6
|
+
- `onParticipantHandRaised` / `onParticipantHandLowered` (no such `CallsEventsDelegate` callbacks)
|
|
7
|
+
- any `setShowRaiseHandButton` / `enableRaiseHand` builder flag
|
|
7
8
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
## SDK API
|
|
11
|
-
|
|
12
|
-
```swift
|
|
13
|
-
import CometChatCallsSDK
|
|
14
|
-
|
|
15
|
-
// Local user
|
|
16
|
-
CometChatCalls.raiseHand()
|
|
17
|
-
CometChatCalls.lowerHand()
|
|
18
|
-
|
|
19
|
-
// Listener — set via the call event listener attached at session start
|
|
20
|
-
class CallListener: NSObject, CometChatCallsEventsListener {
|
|
21
|
-
func onParticipantHandRaised(_ participant: Participant) {
|
|
22
|
-
// participant.uid, participant.name
|
|
23
|
-
}
|
|
24
|
-
func onParticipantHandLowered(_ participant: Participant) {
|
|
25
|
-
// ...
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
// Settings flag
|
|
30
|
-
let settings = CallSettingsBuilder()
|
|
31
|
-
.setSessionType(.video)
|
|
32
|
-
.hideRaiseHandButton(true)
|
|
33
|
-
.build()
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
---
|
|
37
|
-
|
|
38
|
-
## SwiftUI integration — observable state holder
|
|
39
|
-
|
|
40
|
-
```swift
|
|
41
|
-
import SwiftUI
|
|
42
|
-
import Combine
|
|
43
|
-
import CometChatCallsSDK
|
|
44
|
-
|
|
45
|
-
struct RaisedParticipant: Identifiable {
|
|
46
|
-
let id: String // uid
|
|
47
|
-
let name: String
|
|
48
|
-
let raisedAt: Date
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
final class RaiseHandState: ObservableObject {
|
|
52
|
-
@Published var localRaised: Bool = false
|
|
53
|
-
@Published var raised: [RaisedParticipant] = []
|
|
54
|
-
|
|
55
|
-
func toggle() {
|
|
56
|
-
if localRaised {
|
|
57
|
-
CometChatCalls.lowerHand()
|
|
58
|
-
} else {
|
|
59
|
-
CometChatCalls.raiseHand()
|
|
60
|
-
}
|
|
61
|
-
localRaised.toggle()
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
func handle(participantRaised p: Participant) {
|
|
65
|
-
DispatchQueue.main.async {
|
|
66
|
-
let entry = RaisedParticipant(id: p.uid, name: p.name, raisedAt: Date())
|
|
67
|
-
self.raised.removeAll { $0.id == p.uid }
|
|
68
|
-
self.raised.append(entry)
|
|
69
|
-
self.raised.sort { $0.raisedAt < $1.raisedAt }
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
func handle(participantLowered p: Participant) {
|
|
74
|
-
DispatchQueue.main.async {
|
|
75
|
-
self.raised.removeAll { $0.id == p.uid }
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
`DispatchQueue.main.async` wraps SDK callbacks — same rule as elsewhere in iOS calls integrations (cf. `references/group-calls.md`). Without it, `@Published` updates from a background queue cause UI thread warnings + skipped re-renders.
|
|
82
|
-
|
|
83
|
-
---
|
|
84
|
-
|
|
85
|
-
## Toggle button (SwiftUI)
|
|
86
|
-
|
|
87
|
-
```swift
|
|
88
|
-
struct RaiseHandButton: View {
|
|
89
|
-
@ObservedObject var state: RaiseHandState
|
|
90
|
-
|
|
91
|
-
var body: some View {
|
|
92
|
-
Button(action: state.toggle) {
|
|
93
|
-
Label(state.localRaised ? "Lower" : "Raise hand",
|
|
94
|
-
systemImage: state.localRaised ? "hand.raised.fill" : "hand.raised")
|
|
95
|
-
}
|
|
96
|
-
.buttonStyle(.bordered)
|
|
97
|
-
.tint(state.localRaised ? .yellow : .white)
|
|
98
|
-
.accessibilityLabel(state.localRaised ? "Lower hand" : "Raise hand")
|
|
99
|
-
.accessibilityAddTraits(state.localRaised ? .isSelected : [])
|
|
100
|
-
.onChange(of: state.localRaised) { newValue in
|
|
101
|
-
UIAccessibility.post(notification: .announcement, argument:
|
|
102
|
-
newValue ? "Hand raised" : "Hand lowered")
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
`UIAccessibility.post(.announcement, ...)` is the iOS equivalent of web's `aria-live` and RN's `AccessibilityInfo.announceForAccessibility`. VoiceOver picks it up.
|
|
109
|
-
|
|
110
|
-
---
|
|
111
|
-
|
|
112
|
-
## Raised-hands sheet (SwiftUI)
|
|
9
|
+
The `CallsEventsDelegate` surface in v5 (verified against `CometChatCallsSDK` swiftinterface:29-54) is: `onSessionTimeout()`, `onCallEnded()`, `onCallEndButtonPressed()`, plus the participant/media events in BOTH a current TYPED form and a DEPRECATED `NSDictionary`/`NSArray` form — `onUserJoined(rtcUser:)`, `onUserLeft(rtcUser:)`, `onUserListChanged(rtcUsers:)`, `onAudioModeChanged(mode:)`, `onUserMuted(rtcMutedUser:)`, `onRecordingToggled(recordingInfo:)`, `onCallSwitchedToVideo(callSwitchedInfo:)`. Prefer the typed forms (`RTCUser`, `RTCMutedUser`, `RTCRecordingInfo`, `CallSwitchRequestInfo`, `CallAudioMode`). There is NO hand-raise event of any spelling.
|
|
113
10
|
|
|
114
|
-
|
|
115
|
-
struct RaisedHandsSheet: View {
|
|
116
|
-
@ObservedObject var state: RaiseHandState
|
|
11
|
+
## If a customer asks for raise-hand on iOS
|
|
117
12
|
|
|
118
|
-
|
|
119
|
-
VStack(alignment: .leading, spacing: 12) {
|
|
120
|
-
Text("Raised hands (\(state.raised.count))")
|
|
121
|
-
.font(.headline)
|
|
122
|
-
if state.raised.isEmpty {
|
|
123
|
-
Text("No hands raised").foregroundColor(.secondary)
|
|
124
|
-
} else {
|
|
125
|
-
ForEach(state.raised) { p in
|
|
126
|
-
HStack {
|
|
127
|
-
Text("✋").font(.title2)
|
|
128
|
-
Text(p.name).font(.body)
|
|
129
|
-
Spacer()
|
|
130
|
-
Text(secondsAgo(p.raisedAt))
|
|
131
|
-
.font(.caption)
|
|
132
|
-
.foregroundColor(.secondary)
|
|
133
|
-
}
|
|
134
|
-
.padding(.vertical, 4)
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
.padding()
|
|
139
|
-
.presentationDetents([.fraction(0.3), .medium])
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
func secondsAgo(_ t: Date) -> String {
|
|
143
|
-
"\(Int(Date().timeIntervalSince(t)))s ago"
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
`.presentationDetents([.fraction(0.3), .medium])` is iOS 16+ — gives the user two snap heights, matching the BottomSheet pattern from RN.
|
|
149
|
-
|
|
150
|
-
---
|
|
151
|
-
|
|
152
|
-
## UIKit pattern
|
|
153
|
-
|
|
154
|
-
For UIKit projects (the kit's default surface):
|
|
155
|
-
|
|
156
|
-
```swift
|
|
157
|
-
class CallViewController: UIViewController {
|
|
158
|
-
private let state = RaiseHandState()
|
|
159
|
-
|
|
160
|
-
override func viewDidLoad() {
|
|
161
|
-
super.viewDidLoad()
|
|
162
|
-
// ... attach state to call event listener at session start
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
@objc private func raiseHandTapped() {
|
|
166
|
-
state.toggle()
|
|
167
|
-
// Update the UIBarButtonItem appearance
|
|
168
|
-
raiseHandButton.image = UIImage(systemName: state.localRaised ? "hand.raised.fill" : "hand.raised")
|
|
169
|
-
raiseHandButton.tintColor = state.localRaised ? .systemYellow : .label
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
func presentRaisedHandsSheet() {
|
|
173
|
-
let host = UIHostingController(rootView: RaisedHandsSheet(state: state))
|
|
174
|
-
if #available(iOS 15.0, *) {
|
|
175
|
-
host.sheetPresentationController?.detents = [.medium(), .large()]
|
|
176
|
-
}
|
|
177
|
-
present(host, animated: true)
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
```
|
|
181
|
-
|
|
182
|
-
`UIHostingController(rootView:)` lets you embed a SwiftUI sheet in a UIKit nav stack. `sheetPresentationController.detents` is the iOS 15+ pull-up sheet API.
|
|
183
|
-
|
|
184
|
-
---
|
|
185
|
-
|
|
186
|
-
## Toast announcement for the host
|
|
187
|
-
|
|
188
|
-
iOS has no native toast — use `UNUserNotificationCenter` for an in-call banner-style notification, OR a custom view:
|
|
189
|
-
|
|
190
|
-
```swift
|
|
191
|
-
extension RaiseHandState {
|
|
192
|
-
func showRaisedNotification(for p: Participant) {
|
|
193
|
-
let banner = UIView()
|
|
194
|
-
banner.backgroundColor = .systemYellow.withAlphaComponent(0.95)
|
|
195
|
-
let label = UILabel()
|
|
196
|
-
label.text = "✋ \(p.name) raised their hand"
|
|
197
|
-
label.textColor = .black
|
|
198
|
-
label.font = .systemFont(ofSize: 14, weight: .medium)
|
|
199
|
-
// ...add to view, animate down from top, dismiss after 4s
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
```
|
|
203
|
-
|
|
204
|
-
Or use a third-party lib like `NotificationBannerSwift`. Custom is fine; just don't use `UNUserNotificationCenter` (which is system-level and feels out of place for in-call signals).
|
|
205
|
-
|
|
206
|
-
---
|
|
207
|
-
|
|
208
|
-
## Anti-patterns
|
|
209
|
-
|
|
210
|
-
Web sister reference rules apply, plus iOS-specific:
|
|
211
|
-
|
|
212
|
-
1. **`@Published` updates from non-main queue.** SwiftUI warns "publishing changes from background threads is not allowed." Always wrap SDK callbacks in `DispatchQueue.main.async`.
|
|
213
|
-
2. **Forgetting `accessibilityAddTraits(.isSelected)` on the toggle button.** VoiceOver doesn't announce "selected" state without it.
|
|
214
|
-
3. **Using `UNUserNotificationCenter`** for in-call raise-hand alerts. System-level; feels wrong. Use a custom banner.
|
|
215
|
-
4. **`removeAll { $0.id == p.uid }` then `append` without sort.** When a participant raises again after lowering, position in queue should reset to "now"; current code already does the right thing, but easy to break by reordering operations.
|
|
216
|
-
|
|
217
|
-
---
|
|
13
|
+
There is no SDK affordance to wire. The options are:
|
|
218
14
|
|
|
219
|
-
|
|
15
|
+
1. **Build it out-of-band over the Chat SDK.** Send a custom message / transient message (e.g. `TransientMessage` or a typed `CustomMessage`) from the raising user, and have each client render a hand badge from those messages. This is app-level state the Calls SDK is not involved in.
|
|
16
|
+
2. **Defer to web/Android** if the meeting must have first-class raise-hand and those platforms support it.
|
|
17
|
+
3. **Wait for vendor support** — track the CometChat iOS Calls SDK release notes.
|
|
220
18
|
|
|
221
|
-
|
|
222
|
-
- [ ] All SDK callbacks wrap in `DispatchQueue.main.async`
|
|
223
|
-
- [ ] Toggle button has `accessibilityLabel` + `accessibilityAddTraits(.isSelected)` when raised
|
|
224
|
-
- [ ] `UIAccessibility.post(.announcement, ...)` on toggle
|
|
225
|
-
- [ ] Raised-hands list sorted by `raisedAt` ascending
|
|
226
|
-
- [ ] `hideRaiseHandButton: true` in CallSettings if custom UI
|
|
227
|
-
- [ ] Real-device smoke: 3 iPhones in same call, host sees both raised
|
|
228
|
-
- [ ] VoiceOver smoke: enable VoiceOver, raise hand, hear "Hand raised" announcement
|
|
19
|
+
Do NOT scaffold a `CometChatCalls.raiseHand()` call path; it will not compile.
|
|
229
20
|
|
|
230
21
|
---
|
|
231
22
|
|
|
232
23
|
## Pointers
|
|
233
24
|
|
|
234
|
-
- `cometchat-react-calls/references/raise-hand.md` —
|
|
235
|
-
- `cometchat-ios-calls` SKILL.md —
|
|
236
|
-
- `references/group-calls.md` — group call iOS architecture
|
|
237
|
-
- `references/swiftui-uikit-hosting.md` — embedding SwiftUI sheets in UIKit
|
|
238
|
-
- `cometchat-a11y` — UIAccessibility patterns
|
|
239
|
-
- Canonical docs: https://www.cometchat.com/docs/calls/ios/raise-hand
|
|
25
|
+
- `cometchat-react-calls/references/raise-hand.md` — web raise-hand (the feature shape, where it IS supported)
|
|
26
|
+
- `cometchat-ios-calls` SKILL.md — base hard rules
|
|
@@ -18,40 +18,34 @@ Same as web/RN — enable in **Dashboard → Chat & Messaging → Calls → Reco
|
|
|
18
18
|
import CometChatCallsSDK
|
|
19
19
|
|
|
20
20
|
let settings = CallSettingsBuilder()
|
|
21
|
-
.setSessionType(.video)
|
|
22
21
|
.setIsAudioOnly(false)
|
|
23
|
-
.
|
|
24
|
-
.setShowRecordingButton(true)
|
|
22
|
+
.setStartRecordingOnCallStart(true) // auto-start recording on session start
|
|
23
|
+
.setShowRecordingButton(true) // show the kit's user-toggleable REC button
|
|
25
24
|
.build()
|
|
26
25
|
```
|
|
27
26
|
|
|
27
|
+
There is no `setSessionType` and no `enableRecording` on the iOS v5 builder. Auto-start is `setStartRecordingOnCallStart(_:)`; button visibility is `setShowRecordingButton(_:)`. To toggle recording programmatically mid-call, use the static `CometChatCalls.startRecording()` / `CometChatCalls.stopRecording()`.
|
|
28
|
+
|
|
28
29
|
### Lifecycle events (REC indicator)
|
|
29
30
|
|
|
30
|
-
|
|
31
|
-
class CustomOngoingCallViewController: UIViewController {
|
|
32
|
-
@IBOutlet weak var recBadge: UIView!
|
|
31
|
+
The iOS Calls SDK v5 has a SINGLE recording callback — `onRecordingToggled(info:)` on `CallsEventsDelegate` (swiftinterface label is `info:`, payload is an `NSDictionary`). There is no `onRecordingStarted`/`onRecordingStopped`/`onRecordingFailed` split, and the delegate is a protocol you conform to (not an object with assignable closure properties).
|
|
33
32
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
DispatchQueue.main.async {
|
|
44
|
-
let alert = UIAlertController(title: "Recording failed",
|
|
45
|
-
message: error.message,
|
|
46
|
-
preferredStyle: .alert)
|
|
47
|
-
alert.addAction(UIAlertAction(title: "OK", style: .default))
|
|
48
|
-
self?.present(alert, animated: true)
|
|
49
|
-
}
|
|
33
|
+
```swift
|
|
34
|
+
extension CustomOngoingCallViewController: CallsEventsDelegate {
|
|
35
|
+
// swiftinterface: onRecordingToggled(info: NSDictionary)
|
|
36
|
+
func onRecordingToggled(info: NSDictionary) {
|
|
37
|
+
DispatchQueue.main.async { [weak self] in
|
|
38
|
+
// info carries the current recording state + initiating user.
|
|
39
|
+
// Drive the REC badge from your own isRecording flag toggled here.
|
|
40
|
+
self?.isRecording.toggle()
|
|
41
|
+
self?.recBadge.isHidden = !(self?.isRecording ?? false)
|
|
50
42
|
}
|
|
51
43
|
}
|
|
52
44
|
}
|
|
53
45
|
```
|
|
54
46
|
|
|
47
|
+
Wire the delegate via `CallSettingsBuilder.setDelegate(self)` or `CometChatCalls.addCallEventListener(observerId:delegate:)`. There is no separate recording-failure callback — surface failures from your own start/stop call sites if you toggle programmatically.
|
|
48
|
+
|
|
55
49
|
The badge: a small "REC" pill with a blinking red dot. Must be visible to all participants — compliance requirement (CCPA, GDPR Art. 6/7, two-party-consent US states).
|
|
56
50
|
|
|
57
51
|
```swift
|
|
@@ -100,7 +94,7 @@ CometChat hosts the file. Same as web/RN — accessible via dashboard UI or REST
|
|
|
100
94
|
|
|
101
95
|
## Screen sharing — iOS Calls SDK v5.x does NOT support INITIATING
|
|
102
96
|
|
|
103
|
-
**
|
|
97
|
+
**Confirmed against the v5 `CometChatCallsSDK` Swift interface:** the iOS Calls SDK does not support initiating screen sharing. iOS callees can RECEIVE incoming screen shares from web/Android peers — the SDK renders the incoming screen track into the session view automatically — but `CallsEventsDelegate` exposes NO dedicated screen-share callback (no `onScreenShareStarted`/`onScreenShareEnded`, no `onParticipantStartedScreenShare`, no `OngoingCallListener`). iOS cannot SEND.
|
|
104
98
|
|
|
105
99
|
The symbols previously documented in this file (`CometChatCalls.startScreenShareBroadcast`, `processBroadcastVideoFrame`, `processBroadcastAudioFrame`, `endScreenShareBroadcast`) **do not exist** on `CometChatCallsSDK` v5.x. If you've copied these from an earlier draft of this doc, they will not compile against the actual SDK.
|
|
106
100
|
|
|
@@ -108,8 +102,8 @@ The symbols previously documented in this file (`CometChatCalls.startScreenShare
|
|
|
108
102
|
|
|
109
103
|
| Direction | Status | API |
|
|
110
104
|
|---|---|---|
|
|
111
|
-
| Receive screen share (iOS callee) | ✅ supported |
|
|
112
|
-
| Initiate screen share (iOS caller → others) | ❌ NOT supported by CometChatCallsSDK v5
|
|
105
|
+
| Receive screen share (iOS callee) | ✅ supported (rendered by the SDK into the session view) | no dedicated callback — the screen track renders like any remote video |
|
|
106
|
+
| Initiate screen share (iOS caller → others) | ❌ NOT supported by CometChatCallsSDK v5 | n/a |
|
|
113
107
|
|
|
114
108
|
For applications that need iOS users to share their screen today, the practical options are:
|
|
115
109
|
|
|
@@ -193,93 +187,17 @@ class CustomOngoingCallViewController: UIViewController {
|
|
|
193
187
|
|
|
194
188
|
When the user taps the picker, iOS shows the system broadcast UI listing your extension. They tap it; the extension activates; capture begins.
|
|
195
189
|
|
|
196
|
-
###
|
|
197
|
-
|
|
198
|
-
> **⚠️ Audit 2026-05-14**: the symbols below (`CometChatCalls.startScreenShareBroadcast`, `processBroadcastVideoFrame`, `processBroadcastAudioFrame`, `endScreenShareBroadcast`) **do not exist on CometChatCallsSDK v5.x**. The vendor docs at `https://www.cometchat.com/docs/calls/ios/screen-sharing.md` state explicitly: *"The iOS Calls SDK does not support initiating screen sharing."* This code path will not compile. Kept here only to document what the architecture would look like if a future SDK version added support.
|
|
199
|
-
|
|
200
|
-
The extension entry point. Receives audio + video sample buffers from iOS:
|
|
201
|
-
|
|
202
|
-
```swift
|
|
203
|
-
import ReplayKit
|
|
204
|
-
import CometChatCallsSDK
|
|
205
|
-
|
|
206
|
-
class SampleHandler: RPBroadcastSampleHandler {
|
|
190
|
+
### Steps 5–6 — SDK frame bridge: NOT available
|
|
207
191
|
|
|
208
|
-
|
|
209
|
-
// Read the active session ID + auth token from the App Group
|
|
210
|
-
let groupId = "group.com.yourcompany.yourapp.broadcast"
|
|
211
|
-
let defaults = UserDefaults(suiteName: groupId)
|
|
212
|
-
|
|
213
|
-
guard let sessionId = defaults?.string(forKey: "cometchat.sessionId"),
|
|
214
|
-
let authToken = defaults?.string(forKey: "cometchat.authToken") else {
|
|
215
|
-
finishBroadcastWithError(NSError(domain: "CometChat", code: 1,
|
|
216
|
-
userInfo: [NSLocalizedDescriptionKey: "No active session"]))
|
|
217
|
-
return
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
// Initialize the Calls SDK in screen-share mode for this session
|
|
221
|
-
// (the SDK provides a setup helper; verify the exact symbol against installed CometChatCallsSDK)
|
|
222
|
-
CometChatCalls.startScreenShareBroadcast(sessionID: sessionId, authToken: authToken)
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
override func processSampleBuffer(_ sampleBuffer: CMSampleBuffer, with sampleBufferType: RPSampleBufferType) {
|
|
226
|
-
switch sampleBufferType {
|
|
227
|
-
case .video:
|
|
228
|
-
CometChatCalls.processBroadcastVideoFrame(sampleBuffer)
|
|
229
|
-
case .audioApp:
|
|
230
|
-
CometChatCalls.processBroadcastAudioFrame(sampleBuffer, type: .app)
|
|
231
|
-
case .audioMic:
|
|
232
|
-
CometChatCalls.processBroadcastAudioFrame(sampleBuffer, type: .mic)
|
|
233
|
-
@unknown default:
|
|
234
|
-
break
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
override func broadcastFinished() {
|
|
239
|
-
CometChatCalls.endScreenShareBroadcast()
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
```
|
|
243
|
-
|
|
244
|
-
**Confirmed against the SDK docs 2026-05-14**: these symbols are NOT present in CometChatCallsSDK v5.x. The code above is illustrative only.
|
|
245
|
-
|
|
246
|
-
### Step 6 — Main app: pre-write session state to App Group before starting (FICTIONAL — see audit note above)
|
|
247
|
-
|
|
248
|
-
In the main app's call code, before triggering the broadcast picker:
|
|
249
|
-
|
|
250
|
-
```swift
|
|
251
|
-
func prepareScreenShare(sessionId: String, authToken: String) {
|
|
252
|
-
let groupId = "group.com.yourcompany.yourapp.broadcast"
|
|
253
|
-
let defaults = UserDefaults(suiteName: groupId)
|
|
254
|
-
defaults?.set(sessionId, forKey: "cometchat.sessionId")
|
|
255
|
-
defaults?.set(authToken, forKey: "cometchat.authToken")
|
|
256
|
-
defaults?.synchronize()
|
|
257
|
-
}
|
|
258
|
-
```
|
|
259
|
-
|
|
260
|
-
Now when the user taps the picker, the extension can read this state on launch.
|
|
192
|
+
iOS cannot INITIATE screen share (receive-only). `CometChatCallsSDK` v5.x exposes no frame-bridge API (`startScreenShareBroadcast`/`processBroadcastVideoFrame`/`processBroadcastAudioFrame`/`endScreenShareBroadcast` are all absent), so there is no `SampleHandler` pipeline to write — defer screen-share initiation to web/Android peers.
|
|
261
193
|
|
|
262
194
|
---
|
|
263
195
|
|
|
264
196
|
## Viewer — receiving someone else's screen share
|
|
265
197
|
|
|
266
|
-
|
|
198
|
+
When a web/Android peer starts sharing, the iOS Calls SDK renders the incoming screen track into the session `view` you passed to `startSession` — exactly like any other remote video tile. There is **no** `onScreenShareStarted`/`onScreenShareEnded` callback on `CallsEventsDelegate` to hook (those symbols do not exist on iOS v5).
|
|
267
199
|
|
|
268
|
-
|
|
269
|
-
listener.onScreenShareStarted = { [weak self] presenterUid in
|
|
270
|
-
DispatchQueue.main.async {
|
|
271
|
-
self?.showScreenShareView(presenterUid: presenterUid)
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
listener.onScreenShareEnded = { [weak self] in
|
|
276
|
-
DispatchQueue.main.async {
|
|
277
|
-
self?.hideScreenShareView()
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
```
|
|
281
|
-
|
|
282
|
-
The screen-share track renders in the SDK's container; for custom UI, the SDK exposes the track via `MediaStream` events the same way regular video is delivered.
|
|
200
|
+
If you need to react to participant changes around a screen share (e.g. relayout), use the typed participant callbacks — `onUserJoined(rtcUser:)`, `onUserLeft(rtcUser:)`, `onUserListChanged(rtcUsers:)` (swiftinterface:35,38,41 — `RTCUser` objects). For default-UI integrations no code is required: the SDK handles the screen-track layout for you.
|
|
283
201
|
|
|
284
202
|
---
|
|
285
203
|
|
|
@@ -291,7 +209,7 @@ The screen-share track renders in the SDK's container; for custom UI, the SDK ex
|
|
|
291
209
|
| "No active session" finishBroadcastWithError | App Group identifier mismatch | Both targets must use the same `group.*` identifier |
|
|
292
210
|
| Extension launches but no video on remote side | Missing `RPBroadcastProcessModeSampleBuffer` in extension Info.plist | Add it |
|
|
293
211
|
| Recording flag set but no recording in dashboard | Plan doesn't include recording, or dashboard toggle off | Enable in dashboard |
|
|
294
|
-
| REC badge missing | Custom UI — must render manually | Subscribe to `
|
|
212
|
+
| REC badge missing | Custom UI — must render manually | Subscribe to `onRecordingToggled(info:)` and render badge |
|
|
295
213
|
| Screen share doesn't end on call hangup | `broadcastFinished` not triggering | Manually call `RPBroadcastController.shared.finishBroadcast(...)` from main app on hangup |
|
|
296
214
|
|
|
297
215
|
---
|
|
@@ -311,23 +229,18 @@ The screen-share track renders in the SDK's container; for custom UI, the SDK ex
|
|
|
311
229
|
|
|
312
230
|
**Recording:**
|
|
313
231
|
- [ ] Dashboard plan includes recording feature
|
|
314
|
-
- [ ] `
|
|
315
|
-
- [ ] `
|
|
232
|
+
- [ ] `setStartRecordingOnCallStart(true)` and/or `setShowRecordingButton(true)` on `CallSettingsBuilder` (no `enableRecording`)
|
|
233
|
+
- [ ] `onRecordingToggled(info:)` listener wired (single callback — no Started/Stopped/Failed split)
|
|
316
234
|
- [ ] REC badge visible to all participants when active
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
- [ ] `OngoingCallListener
|
|
321
|
-
- [ ]
|
|
322
|
-
|
|
323
|
-
-
|
|
324
|
-
- [ ]
|
|
325
|
-
|
|
326
|
-
**Real-device smoke:**
|
|
327
|
-
- [ ] Tap broadcast picker → consent dialog → screen share begins
|
|
328
|
-
- [ ] Other participants see the shared screen
|
|
329
|
-
- [ ] End screen share via system overlay → returns to camera view
|
|
330
|
-
- [ ] Hangup ends broadcast even if user didn't manually stop sharing
|
|
235
|
+
|
|
236
|
+
**Screen share — receiver side only (iOS Calls SDK v5 cannot INITIATE):**
|
|
237
|
+
- [ ] No code required for default UI — the SDK renders the incoming screen track into the session view
|
|
238
|
+
- [ ] No `onScreenShareStarted`/`onScreenShareEnded`/`onParticipantStartedScreenShare`/`OngoingCallListener` referenced (none exist on iOS v5)
|
|
239
|
+
- [ ] Sender-side screen-share architecture (Broadcast Extension, SampleHandler) NOT implemented against current SDK — the symbols don't exist
|
|
240
|
+
|
|
241
|
+
**Real-device smoke (receive-only — iOS cannot INITIATE screen share):**
|
|
242
|
+
- [ ] When a participant on another platform (web/Android) shares their screen, it renders in the iOS call view
|
|
243
|
+
- [ ] No sender-side broadcast picker/UI is shown on iOS (there is no initiation API in the v5 SDK)
|
|
331
244
|
|
|
332
245
|
---
|
|
333
246
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Ringing — call signaling with custom UI (iOS)
|
|
2
2
|
|
|
3
|
-
iOS-specific deltas: PushKit + CallKit are mandatory for backgrounded ring delivery; foreground ringing uses
|
|
3
|
+
iOS-specific deltas: PushKit + CallKit are mandatory for backgrounded ring delivery; foreground ringing uses the Chat SDK's `CometChatCallDelegate` (NOT the Calls SDK's `CallsEventsDelegate`); AVAudioSession routing.
|
|
4
4
|
|
|
5
5
|
**Read first:** `cometchat-react-calls/references/ringing-integration.md` — full architecture, hard rules.
|
|
6
6
|
|
|
@@ -12,41 +12,42 @@ iOS-specific deltas: PushKit + CallKit are mandatory for backgrounded ring deliv
|
|
|
12
12
|
import CometChatSDK
|
|
13
13
|
import CometChatCallsSDK
|
|
14
14
|
|
|
15
|
-
let call = Call(
|
|
16
|
-
CometChat.initiateCall(call: call
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
15
|
+
let call = Call(receiverId: receiverUid, callType: .video, receiverType: .user)
|
|
16
|
+
CometChat.initiateCall(call: call, onSuccess: { outgoing in
|
|
17
|
+
self.showOutgoingCallScreen(outgoing)
|
|
18
|
+
}, onError: { err in
|
|
19
|
+
print("Initiate failed:", err)
|
|
20
|
+
})
|
|
22
21
|
```
|
|
23
22
|
|
|
24
23
|
---
|
|
25
24
|
|
|
26
25
|
## Foreground listener
|
|
27
26
|
|
|
28
|
-
|
|
27
|
+
Ringing/signaling events live on the Chat SDK's `CometChatCallDelegate` (its callbacks take TWO params: the call and an error). Implement it and register at app start with the positional `CometChat.addCallListener(_:_:)`:
|
|
29
28
|
|
|
30
29
|
```swift
|
|
31
|
-
class AppCallListener:
|
|
32
|
-
func onIncomingCallReceived(
|
|
30
|
+
class AppCallListener: NSObject, CometChatCallDelegate {
|
|
31
|
+
func onIncomingCallReceived(incomingCall: Call?, error: CometChatException?) {
|
|
32
|
+
guard let call = incomingCall else { return }
|
|
33
33
|
DispatchQueue.main.async { showIncomingCallScreen(call) }
|
|
34
34
|
}
|
|
35
|
-
func onOutgoingCallAccepted(
|
|
35
|
+
func onOutgoingCallAccepted(acceptedCall: Call?, error: CometChatException?) {
|
|
36
|
+
guard let call = acceptedCall else { return }
|
|
36
37
|
DispatchQueue.main.async { startCallSession(sessionId: call.sessionId) }
|
|
37
38
|
}
|
|
38
|
-
func onIncomingCallCancelled(
|
|
39
|
+
func onIncomingCallCancelled(canceledCall: Call?, error: CometChatException?) {
|
|
39
40
|
DispatchQueue.main.async { dismissIncomingCallScreen() }
|
|
40
41
|
}
|
|
41
|
-
func onOutgoingCallRejected(
|
|
42
|
+
func onOutgoingCallRejected(rejectedCall: Call?, error: CometChatException?) {
|
|
42
43
|
DispatchQueue.main.async { dismissOutgoingCallScreen() }
|
|
43
44
|
}
|
|
44
|
-
func onCallEndedMessageReceived(
|
|
45
|
+
func onCallEndedMessageReceived(endedCall: Call?, error: CometChatException?) {
|
|
45
46
|
DispatchQueue.main.async { teardownCallUI() }
|
|
46
47
|
}
|
|
47
48
|
}
|
|
48
49
|
|
|
49
|
-
CometChat.addCallListener(
|
|
50
|
+
CometChat.addCallListener("app", AppCallListener()) // positional labels
|
|
50
51
|
```
|
|
51
52
|
|
|
52
53
|
Add this in `AppDelegate.didFinishLaunchingWithOptions` AFTER `CometChat.init` succeeds.
|