@cometchat/skills 4.2.1 → 4.4.0
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/README.md +33 -12
- package/bin/install.js +59 -4
- package/package.json +14 -1
- package/skills/cometchat/SKILL.md +460 -77
- 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 +20 -2
- 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 +389 -9
- 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 +235 -293
- 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 +22 -1
- 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 +412 -13
- package/skills/cometchat-customization/SKILL.md +50 -25
- package/skills/cometchat-features/SKILL.md +313 -34
- 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 +20 -2
- 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 +78 -63
- package/skills/cometchat-flutter-v6-calls/references/add-calls-to-existing-chat.md +8 -6
- 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 +348 -10
- 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 +43 -21
- package/skills/cometchat-flutter-v6-testing/SKILL.md +6 -6
- 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 +139 -78
- 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 +281 -11
- 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 +56 -18
- package/skills/cometchat-native-calls/SKILL.md +89 -19
- 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 +91 -57
- package/skills/cometchat-native-core/SKILL.md +281 -9
- package/skills/cometchat-native-customization/SKILL.md +150 -28
- package/skills/cometchat-native-expo-patterns/SKILL.md +77 -27
- package/skills/cometchat-native-features/SKILL.md +79 -49
- 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 +71 -3
- package/skills/cometchat-nextjs-patterns/SKILL.md +48 -6
- 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 +57 -4
- package/skills/cometchat-react-push/SKILL.md +258 -72
- package/skills/cometchat-react-router-patterns/SKILL.md +43 -4
- 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
|
@@ -15,30 +15,30 @@ Recording is a paid feature on most CometChat plans. Enable in **Dashboard → C
|
|
|
15
15
|
```ts
|
|
16
16
|
import { CometChatCalls } from "@cometchat/calls-sdk-react-native";
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
// Audio vs video + recording are SessionSettings OBJECT fields (v5), not builder methods.
|
|
19
|
+
// enableRecording()/setShowRecordingButton() do not exist on the v5 RN SDK.
|
|
20
|
+
const sessionSettings = {
|
|
21
|
+
sessionType: "VIDEO", // "VIDEO" | "AUDIO" — replaces the v4 setIsAudioOnlyCall builder
|
|
22
|
+
autoStartRecording: true, // server starts recording when the session begins
|
|
23
|
+
hideRecordingButton: false, // show the in-call recording toggle (kit's default UI)
|
|
24
|
+
};
|
|
24
25
|
```
|
|
25
26
|
|
|
26
27
|
### Recording lifecycle events
|
|
27
28
|
|
|
29
|
+
`CometChatCalls.OngoingCallListener` is still re-exported but is the v4-era path — **@deprecated, prefer `CometChatCalls.addEventListener(...)`** (which returns an unsubscribe fn). Only `onRecordingStarted` / `onRecordingStopped` exist; there is no `onRecordingFailed`.
|
|
30
|
+
|
|
28
31
|
```ts
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
},
|
|
37
|
-
onRecordingFailed: (error) => {
|
|
38
|
-
// Surface to UI — usually plan limits or storage quota
|
|
39
|
-
Alert.alert("Recording failed", error.message);
|
|
40
|
-
},
|
|
32
|
+
// Preferred (v5): addEventListener returns the unsubscribe fn.
|
|
33
|
+
const offStarted = CometChatCalls.addEventListener("onRecordingStarted", () => {
|
|
34
|
+
// Update UI — show a "REC" indicator (compliance requirement in some jurisdictions)
|
|
35
|
+
setRecording(true);
|
|
36
|
+
});
|
|
37
|
+
const offStopped = CometChatCalls.addEventListener("onRecordingStopped", () => {
|
|
38
|
+
setRecording(false);
|
|
41
39
|
});
|
|
40
|
+
// cleanup: offStarted(); offStopped();
|
|
41
|
+
// NOTE: there is no onRecordingFailed event in the v5 RN SDK — do not listen for it.
|
|
42
42
|
```
|
|
43
43
|
|
|
44
44
|
### REC indicator (compliance)
|
|
@@ -77,101 +77,27 @@ The skill points users at this REST endpoint; it doesn't generate client code (r
|
|
|
77
77
|
|
|
78
78
|
## Screen sharing
|
|
79
79
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
### Presenter — start sharing
|
|
83
|
-
|
|
84
|
-
```ts
|
|
85
|
-
import { CometChatCalls } from "@cometchat/calls-sdk-react-native";
|
|
86
|
-
|
|
87
|
-
async function startScreenShare() {
|
|
88
|
-
try {
|
|
89
|
-
await CometChatCalls.startScreenShare();
|
|
90
|
-
} catch (err) {
|
|
91
|
-
if ((err as Error).message.includes("permission")) {
|
|
92
|
-
Alert.alert("Screen recording permission denied");
|
|
93
|
-
return;
|
|
94
|
-
}
|
|
95
|
-
Alert.alert("Couldn't start screen share");
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
async function endScreenShare() {
|
|
100
|
-
await CometChatCalls.endScreenShare();
|
|
101
|
-
}
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
### iOS — Broadcast Extension target setup
|
|
105
|
-
|
|
106
|
-
iOS screen capture requires a separate target in Xcode (a "Broadcast Upload Extension"). The skill walks the user through this manual setup:
|
|
107
|
-
|
|
108
|
-
1. Xcode → File → New → Target → **Broadcast Upload Extension**
|
|
109
|
-
2. Name: `YourAppBroadcastExtension`
|
|
110
|
-
3. Bundle ID: `com.yourapp.YourAppBroadcastExtension`
|
|
111
|
-
4. Group: `group.com.yourapp.broadcast` (App Group — both targets must opt into this)
|
|
112
|
-
5. Add the App Group capability to BOTH the main target AND the extension
|
|
113
|
-
6. Replace the extension's `SampleHandler.swift` with the WebRTC bridge stub `react-native-webrtc` provides
|
|
114
|
-
7. Add `RPSystemBroadcastPickerView` to your call screen so the user can start/stop sharing via the system UI
|
|
115
|
-
|
|
116
|
-
The Broadcast Extension picker UI:
|
|
117
|
-
|
|
118
|
-
```tsx
|
|
119
|
-
// CallScreen.tsx
|
|
120
|
-
import { Platform, requireNativeComponent } from "react-native";
|
|
121
|
-
|
|
122
|
-
const BroadcastPickerView = Platform.OS === "ios"
|
|
123
|
-
? requireNativeComponent<{ preferredExtension: string }>("RPSystemBroadcastPickerView")
|
|
124
|
-
: null;
|
|
125
|
-
|
|
126
|
-
export function CallScreen() {
|
|
127
|
-
return (
|
|
128
|
-
<View>
|
|
129
|
-
{/* ... call UI ... */}
|
|
130
|
-
{Platform.OS === "ios" && BroadcastPickerView && (
|
|
131
|
-
<BroadcastPickerView preferredExtension="com.yourapp.YourAppBroadcastExtension" />
|
|
132
|
-
)}
|
|
133
|
-
</View>
|
|
134
|
-
);
|
|
135
|
-
}
|
|
136
|
-
```
|
|
80
|
+
**Initiating a screen share from React Native is NOT supported.** Per the docs (`docs/calls/react-native/screen-sharing.mdx`): RN devices can only **view** screen shares started by participants on other platforms (web/desktop). There is no `startScreenSharing()` / `stopScreenSharing()` / `CometChatCalls.startScreenShare()` API on RN, no iOS Broadcast Extension flow, and no Android MediaProjection flow exposed by this SDK. Do not write screen-share-initiation code for RN.
|
|
137
81
|
|
|
138
|
-
|
|
82
|
+
### Viewer — receive / view a screen share
|
|
139
83
|
|
|
140
|
-
|
|
84
|
+
When a participant shares their screen from another platform, the kit's default `CometChatOngoingCall` UI auto-renders the screen-share tile (it switches to Sidebar layout automatically). Listen for screen-share events only to drive custom UI.
|
|
141
85
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
```xml
|
|
145
|
-
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
|
146
|
-
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PROJECTION" /> <!-- Android 14+ -->
|
|
147
|
-
```
|
|
148
|
-
|
|
149
|
-
The screen-share service needs `foregroundServiceType="mediaProjection"`:
|
|
150
|
-
|
|
151
|
-
```xml
|
|
152
|
-
<service
|
|
153
|
-
android:name="com.cometchat.calls.ScreenShareService"
|
|
154
|
-
android:foregroundServiceType="mediaProjection"
|
|
155
|
-
android:exported="false" />
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
`react-native-webrtc` registers this internally; verify it's in the merged manifest.
|
|
159
|
-
|
|
160
|
-
The MediaProjection consent prompt is system-rendered — when `startScreenShare()` is called, Android shows "Start recording or casting with YourApp?". User accepts → screen share begins.
|
|
161
|
-
|
|
162
|
-
### Viewer — receive screen share
|
|
86
|
+
Two receive-path event channels exist (verified against the calls-sdk-react-native clone `skills/event-listeners/SKILL.md`):
|
|
163
87
|
|
|
164
88
|
```ts
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
onScreenShareEnded: () => {
|
|
172
|
-
setScreenSharePresenter(null);
|
|
173
|
-
},
|
|
89
|
+
// Participant events — fire with the remote participant who shared:
|
|
90
|
+
const offStart = CometChatCalls.addEventListener("onParticipantStartedScreenShare", (participant) => {
|
|
91
|
+
setScreenSharePresenter(participant.name);
|
|
92
|
+
});
|
|
93
|
+
const offStop = CometChatCalls.addEventListener("onParticipantStoppedScreenShare", () => {
|
|
94
|
+
setScreenSharePresenter(null);
|
|
174
95
|
});
|
|
96
|
+
// cleanup: offStart(); offStop();
|
|
97
|
+
|
|
98
|
+
// Media-event channel (received from a web participant), no payload:
|
|
99
|
+
CometChatCalls.addEventListener("onScreenShareStarted", () => { /* show screen-share tile */ });
|
|
100
|
+
CometChatCalls.addEventListener("onScreenShareStopped", () => { /* restore prior layout */ });
|
|
175
101
|
```
|
|
176
102
|
|
|
177
103
|
Custom-UI viewer composition:
|
|
@@ -197,61 +123,21 @@ When someone shares their screen, switch the layout to "screen share + participa
|
|
|
197
123
|
|
|
198
124
|
---
|
|
199
125
|
|
|
200
|
-
##
|
|
201
|
-
|
|
202
|
-
Server-side recording captures whatever video composition the SFU is forwarding. When a participant is screen-sharing, the recording shows their screen. When they stop, it switches back to the camera composition.
|
|
203
|
-
|
|
204
|
-
You don't compose this client-side — the server handles it. Custom UI just needs to render the screen-share track when present.
|
|
205
|
-
|
|
206
|
-
---
|
|
207
|
-
|
|
208
|
-
## iOS App Group setup (Broadcast Extension data passing)
|
|
209
|
-
|
|
210
|
-
The iOS Broadcast Extension runs in a separate process from your main app. To share state (the call's session ID, auth context, etc.):
|
|
211
|
-
|
|
212
|
-
```
|
|
213
|
-
Both targets in Xcode:
|
|
214
|
-
Signing & Capabilities → + Capability → App Groups
|
|
215
|
-
Add: group.com.yourapp.broadcast
|
|
216
|
-
```
|
|
217
|
-
|
|
218
|
-
In the main app, write to the shared group container:
|
|
219
|
-
|
|
220
|
-
```swift
|
|
221
|
-
// AppDelegate or CometChat init code (RN bridges this)
|
|
222
|
-
let userDefaults = UserDefaults(suiteName: "group.com.yourapp.broadcast")
|
|
223
|
-
userDefaults?.set(currentSessionID, forKey: "cometchat.sessionID")
|
|
224
|
-
userDefaults?.set(currentAuthToken, forKey: "cometchat.authToken")
|
|
225
|
-
```
|
|
126
|
+
## Recording + screen-share together
|
|
226
127
|
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
```swift
|
|
230
|
-
override func broadcastStarted(withSetupInfo setupInfo: [String : NSObject]?) {
|
|
231
|
-
let userDefaults = UserDefaults(suiteName: "group.com.yourapp.broadcast")
|
|
232
|
-
guard let sessionID = userDefaults?.string(forKey: "cometchat.sessionID"),
|
|
233
|
-
let authToken = userDefaults?.string(forKey: "cometchat.authToken") else {
|
|
234
|
-
finishBroadcastWithError(NSError(domain: "CometChat", code: 1, userInfo: nil))
|
|
235
|
-
return
|
|
236
|
-
}
|
|
237
|
-
// Initialize the WebRTC bridge with these credentials
|
|
238
|
-
// (react-native-webrtc handles the heavy lifting)
|
|
239
|
-
}
|
|
240
|
-
```
|
|
128
|
+
Server-side recording captures whatever video composition the SFU is forwarding. When a (web/desktop) participant is screen-sharing, the recording shows their screen. When they stop, it switches back to the camera composition.
|
|
241
129
|
|
|
242
|
-
|
|
130
|
+
You don't compose this client-side — the server handles it. Custom UI just needs to render the screen-share track when present (receive path).
|
|
243
131
|
|
|
244
132
|
---
|
|
245
133
|
|
|
246
134
|
## Anti-patterns
|
|
247
135
|
|
|
248
|
-
1. **
|
|
249
|
-
2. **
|
|
250
|
-
3. **
|
|
251
|
-
4.
|
|
252
|
-
5. **
|
|
253
|
-
6. **`enableRecording(true)` without dashboard gate.** Client flag silently no-ops; user thinks recording is active when it isn't.
|
|
254
|
-
7. **Not handling `onScreenShareEnded` in custom UI.** Layout doesn't switch back; viewer sees the last screen-share frame frozen.
|
|
136
|
+
1. **Trying to INITIATE a screen share from RN.** Not supported — there is no `startScreenSharing()`, iOS Broadcast Extension flow, or Android MediaProjection flow on this SDK. RN can only view shares from other platforms.
|
|
137
|
+
2. **No "REC" indicator in custom UI.** Compliance violation in two-party-consent jurisdictions.
|
|
138
|
+
3. **Trying to download recordings from the device.** They live on CometChat's servers. Use the dashboard or REST API.
|
|
139
|
+
4. **`autoStartRecording: true` without dashboard gate.** SessionSettings flag silently no-ops; user thinks recording is active when it isn't.
|
|
140
|
+
5. **Not handling the screen-share-stopped event in custom UI.** Layout doesn't switch back; viewer sees the last screen-share frame frozen.
|
|
255
141
|
|
|
256
142
|
---
|
|
257
143
|
|
|
@@ -259,25 +145,18 @@ Without the App Group, the extension can't see the main app's CometChat state
|
|
|
259
145
|
|
|
260
146
|
**Recording:**
|
|
261
147
|
- [ ] Dashboard gate enabled (Recording feature on the plan)
|
|
262
|
-
- [ ] `
|
|
263
|
-
- [ ] `onRecordingStarted` / `onRecordingStopped` listeners wired
|
|
148
|
+
- [ ] `autoStartRecording: true` in the SessionSettings object (NOT a builder method)
|
|
149
|
+
- [ ] `onRecordingStarted` / `onRecordingStopped` listeners wired via `addEventListener`
|
|
264
150
|
- [ ] "REC" indicator visible to all participants when active
|
|
265
|
-
- [ ] `onRecordingFailed` surfaces to UI
|
|
266
151
|
|
|
267
|
-
**Screen share:**
|
|
268
|
-
- [ ]
|
|
269
|
-
- [ ]
|
|
270
|
-
- [ ] iOS: `RPSystemBroadcastPickerView` rendered in call screen
|
|
271
|
-
- [ ] Android: `FOREGROUND_SERVICE_MEDIA_PROJECTION` permission in manifest
|
|
272
|
-
- [ ] Android: ScreenShareService registered with `foregroundServiceType="mediaProjection"`
|
|
273
|
-
- [ ] Custom UI: layout switches to screen-share view on `onScreenShareStarted`
|
|
274
|
-
- [ ] Custom UI: layout switches back on `onScreenShareEnded`
|
|
152
|
+
**Screen share (RN = VIEW-only; initiation not supported):**
|
|
153
|
+
- [ ] Custom UI: layout switches to screen-share view on `onParticipantStartedScreenShare` / `onScreenShareStarted`
|
|
154
|
+
- [ ] Custom UI: layout switches back on `onParticipantStoppedScreenShare` / `onScreenShareStopped`
|
|
275
155
|
|
|
276
156
|
**Real-device smoke:**
|
|
277
|
-
- [ ]
|
|
278
|
-
- [ ]
|
|
279
|
-
- [ ]
|
|
280
|
-
- [ ] Both: recording starts, "REC" shows, recording appears in dashboard within ~30 seconds
|
|
157
|
+
- [ ] A web/desktop participant starts a screen share → it renders on the RN device
|
|
158
|
+
- [ ] That participant stops sharing → RN view returns to camera composition smoothly
|
|
159
|
+
- [ ] Recording starts, "REC" shows, recording appears in dashboard within ~30 seconds
|
|
281
160
|
|
|
282
161
|
---
|
|
283
162
|
|
|
@@ -39,14 +39,16 @@ Without these, share-invite URLs land in browser, not the app.
|
|
|
39
39
|
```ts
|
|
40
40
|
import { CometChatCalls } from "@cometchat/calls-sdk-react-native";
|
|
41
41
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
// SessionSettings OBJECT field — there is NO setHideShareInviteButton builder method:
|
|
43
|
+
const callSettings = {
|
|
44
|
+
hideShareInviteButton: false,
|
|
45
|
+
};
|
|
45
46
|
|
|
46
47
|
useEffect(() => {
|
|
47
48
|
const handler = () => shareCallInvite(sessionId);
|
|
48
|
-
|
|
49
|
-
|
|
49
|
+
// addEventListener returns the unsubscribe fn — call it on cleanup.
|
|
50
|
+
const off = CometChatCalls.addEventListener("onShareInviteButtonClicked", handler);
|
|
51
|
+
return () => off();
|
|
50
52
|
}, [sessionId]);
|
|
51
53
|
```
|
|
52
54
|
|
|
@@ -114,8 +114,10 @@ export function App() {
|
|
|
114
114
|
// CallKit answer/end events — wire them to CometChat Calls SDK
|
|
115
115
|
useEffect(() => {
|
|
116
116
|
RNCallKeep.addEventListener("answerCall", async ({ callUUID }) => {
|
|
117
|
-
// sessionId === callUUID we passed to displayIncomingCall
|
|
118
|
-
|
|
117
|
+
// sessionId === callUUID we passed to displayIncomingCall.
|
|
118
|
+
// Accept lives on the CHAT SDK (CometChat.acceptCall), NOT CometChatCalls —
|
|
119
|
+
// the Calls SDK has no acceptCall; calling it crashes at answer time.
|
|
120
|
+
await CometChat.acceptCall(callUUID);
|
|
119
121
|
navigate("OngoingCall", { sessionId: callUUID });
|
|
120
122
|
});
|
|
121
123
|
|