@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.
Files changed (233) hide show
  1. package/LICENSE +21 -0
  2. package/bin/install.js +27 -0
  3. package/package.json +14 -1
  4. package/skills/cometchat/SKILL.md +233 -69
  5. package/skills/cometchat/references/asking-questions.md +48 -0
  6. package/skills/cometchat-a11y/SKILL.md +3 -2
  7. package/skills/cometchat-android-v5/SKILL.md +2 -1
  8. package/skills/cometchat-android-v5-calls/SKILL.md +36 -22
  9. package/skills/cometchat-android-v5-calls/references/README.md +1 -1
  10. package/skills/cometchat-android-v5-calls/references/add-calls-to-existing-chat.md +7 -5
  11. package/skills/cometchat-android-v5-calls/references/audio-controls.md +4 -4
  12. package/skills/cometchat-android-v5-calls/references/call-layouts.md +33 -25
  13. package/skills/cometchat-android-v5-calls/references/call-session.md +2 -2
  14. package/skills/cometchat-android-v5-calls/references/custom-ui.md +5 -5
  15. package/skills/cometchat-android-v5-calls/references/event-listeners.md +2 -2
  16. package/skills/cometchat-android-v5-calls/references/idle-timeout.md +20 -14
  17. package/skills/cometchat-android-v5-calls/references/in-call-chat.md +1 -1
  18. package/skills/cometchat-android-v5-calls/references/migration-v4-to-v5.md +43 -27
  19. package/skills/cometchat-android-v5-calls/references/participant-management.md +3 -3
  20. package/skills/cometchat-android-v5-calls/references/raise-hand.md +25 -19
  21. package/skills/cometchat-android-v5-calls/references/recording.md +2 -2
  22. package/skills/cometchat-android-v5-calls/references/ringing-integration.md +1 -1
  23. package/skills/cometchat-android-v5-calls/references/screen-sharing.md +5 -9
  24. package/skills/cometchat-android-v5-calls/references/session-settings.md +3 -3
  25. package/skills/cometchat-android-v5-calls/references/setup.md +1 -1
  26. package/skills/cometchat-android-v5-calls/references/share-invite.md +9 -4
  27. package/skills/cometchat-android-v5-calls/references/video-controls.md +4 -4
  28. package/skills/cometchat-android-v5-calls/references/voip-calling.md +2 -2
  29. package/skills/cometchat-android-v5-components/SKILL.md +4 -3
  30. package/skills/cometchat-android-v5-core/SKILL.md +5 -3
  31. package/skills/cometchat-android-v5-customization/SKILL.md +171 -7
  32. package/skills/cometchat-android-v5-extensions/SKILL.md +7 -4
  33. package/skills/cometchat-android-v5-features/SKILL.md +5 -4
  34. package/skills/cometchat-android-v5-placement/SKILL.md +2 -1
  35. package/skills/cometchat-android-v5-production/SKILL.md +2 -1
  36. package/skills/cometchat-android-v5-push/SKILL.md +2 -3
  37. package/skills/cometchat-android-v5-testing/SKILL.md +2 -1
  38. package/skills/cometchat-android-v5-theming/SKILL.md +2 -1
  39. package/skills/cometchat-android-v5-troubleshooting/SKILL.md +3 -2
  40. package/skills/cometchat-android-v6/SKILL.md +2 -1
  41. package/skills/cometchat-android-v6-builder-settings/SKILL.md +11 -7
  42. package/skills/cometchat-android-v6-calls/SKILL.md +79 -18
  43. package/skills/cometchat-android-v6-calls/references/advanced-features.md +87 -0
  44. package/skills/cometchat-android-v6-calls/references/call-layouts.md +24 -15
  45. package/skills/cometchat-android-v6-calls/references/call-session.md +2 -2
  46. package/skills/cometchat-android-v6-calls/references/device-management.md +17 -16
  47. package/skills/cometchat-android-v6-calls/references/idle-timeout.md +7 -4
  48. package/skills/cometchat-android-v6-calls/references/in-call-chat.md +13 -8
  49. package/skills/cometchat-android-v6-calls/references/raise-hand.md +6 -4
  50. package/skills/cometchat-android-v6-compose-components/SKILL.md +52 -29
  51. package/skills/cometchat-android-v6-compose-customization/SKILL.md +156 -1
  52. package/skills/cometchat-android-v6-compose-placement/SKILL.md +129 -40
  53. package/skills/cometchat-android-v6-compose-theming/SKILL.md +27 -1
  54. package/skills/cometchat-android-v6-core/SKILL.md +208 -28
  55. package/skills/cometchat-android-v6-events/SKILL.md +4 -1
  56. package/skills/cometchat-android-v6-extensions/SKILL.md +2 -1
  57. package/skills/cometchat-android-v6-features/SKILL.md +26 -2
  58. package/skills/cometchat-android-v6-kotlin-components/SKILL.md +31 -1
  59. package/skills/cometchat-android-v6-kotlin-customization/SKILL.md +172 -1
  60. package/skills/cometchat-android-v6-kotlin-placement/SKILL.md +20 -5
  61. package/skills/cometchat-android-v6-kotlin-theming/SKILL.md +36 -5
  62. package/skills/cometchat-android-v6-migration/SKILL.md +44 -42
  63. package/skills/cometchat-android-v6-production/SKILL.md +6 -3
  64. package/skills/cometchat-android-v6-push/SKILL.md +43 -2
  65. package/skills/cometchat-android-v6-testing/SKILL.md +11 -8
  66. package/skills/cometchat-android-v6-troubleshooting/SKILL.md +26 -5
  67. package/skills/cometchat-angular-calls/SKILL.md +256 -389
  68. package/skills/cometchat-angular-calls/references/add-calls-to-existing-chat.md +3 -2
  69. package/skills/cometchat-angular-calls/references/call-layouts.md +29 -12
  70. package/skills/cometchat-angular-calls/references/call-session.md +2 -2
  71. package/skills/cometchat-angular-calls/references/custom-ui.md +18 -10
  72. package/skills/cometchat-angular-calls/references/device-management.md +53 -34
  73. package/skills/cometchat-angular-calls/references/group-calls.md +45 -24
  74. package/skills/cometchat-angular-calls/references/idle-timeout.md +31 -15
  75. package/skills/cometchat-angular-calls/references/ngzone-and-async-callbacks.md +7 -6
  76. package/skills/cometchat-angular-calls/references/raise-hand.md +9 -4
  77. package/skills/cometchat-angular-calls/references/recording-screen-share.md +32 -39
  78. package/skills/cometchat-angular-calls/references/ringing-integration.md +3 -1
  79. package/skills/cometchat-angular-calls/references/share-invite.md +11 -5
  80. package/skills/cometchat-angular-calls/references/virtual-background.md +29 -0
  81. package/skills/cometchat-angular-components/SKILL.md +149 -620
  82. package/skills/cometchat-angular-core/SKILL.md +232 -312
  83. package/skills/cometchat-angular-customization/SKILL.md +415 -223
  84. package/skills/cometchat-angular-features/SKILL.md +216 -334
  85. package/skills/cometchat-angular-patterns/SKILL.md +168 -359
  86. package/skills/cometchat-angular-placement/SKILL.md +189 -560
  87. package/skills/cometchat-angular-production/SKILL.md +241 -92
  88. package/skills/cometchat-angular-push/SKILL.md +280 -294
  89. package/skills/cometchat-angular-testing/SKILL.md +430 -158
  90. package/skills/cometchat-angular-theming/SKILL.md +190 -265
  91. package/skills/cometchat-angular-troubleshooting/SKILL.md +192 -157
  92. package/skills/cometchat-astro-patterns/SKILL.md +3 -2
  93. package/skills/cometchat-calls/SKILL.md +25 -19
  94. package/skills/cometchat-calls/references/use-case-broadcast.md +15 -10
  95. package/skills/cometchat-calls/references/use-case-marketplace.md +2 -3
  96. package/skills/cometchat-calls/references/use-case-support.md +3 -4
  97. package/skills/cometchat-calls/references/use-case-team.md +23 -12
  98. package/skills/cometchat-calls/references/use-case-telehealth.md +3 -4
  99. package/skills/cometchat-components/SKILL.md +163 -25
  100. package/skills/cometchat-core/SKILL.md +258 -20
  101. package/skills/cometchat-customization/SKILL.md +50 -25
  102. package/skills/cometchat-features/SKILL.md +314 -35
  103. package/skills/cometchat-flutter-v5/SKILL.md +10 -4
  104. package/skills/cometchat-flutter-v5-calls/SKILL.md +188 -158
  105. package/skills/cometchat-flutter-v5-calls/references/add-calls-to-existing-chat.md +48 -24
  106. package/skills/cometchat-flutter-v5-calls/references/call-layouts.md +20 -15
  107. package/skills/cometchat-flutter-v5-calls/references/call-session.md +100 -145
  108. package/skills/cometchat-flutter-v5-calls/references/device-management.md +12 -8
  109. package/skills/cometchat-flutter-v5-calls/references/group-calls.md +30 -36
  110. package/skills/cometchat-flutter-v5-calls/references/idle-timeout.md +15 -13
  111. package/skills/cometchat-flutter-v5-calls/references/in-call-chat.md +12 -9
  112. package/skills/cometchat-flutter-v5-calls/references/migration-v4-to-v5.md +115 -65
  113. package/skills/cometchat-flutter-v5-calls/references/raise-hand.md +41 -30
  114. package/skills/cometchat-flutter-v5-calls/references/ringing-integration.md +17 -14
  115. package/skills/cometchat-flutter-v5-calls/references/share-invite.md +8 -2
  116. package/skills/cometchat-flutter-v5-conversations/SKILL.md +2 -1
  117. package/skills/cometchat-flutter-v5-core/SKILL.md +5 -4
  118. package/skills/cometchat-flutter-v5-customization/SKILL.md +136 -5
  119. package/skills/cometchat-flutter-v5-events/SKILL.md +2 -1
  120. package/skills/cometchat-flutter-v5-messages/SKILL.md +2 -1
  121. package/skills/cometchat-flutter-v5-production/SKILL.md +15 -6
  122. package/skills/cometchat-flutter-v5-push/SKILL.md +2 -1
  123. package/skills/cometchat-flutter-v5-testing/SKILL.md +17 -6
  124. package/skills/cometchat-flutter-v5-theming/SKILL.md +2 -1
  125. package/skills/cometchat-flutter-v5-troubleshooting/SKILL.md +7 -6
  126. package/skills/cometchat-flutter-v5-users-groups/SKILL.md +3 -2
  127. package/skills/cometchat-flutter-v6/SKILL.md +17 -16
  128. package/skills/cometchat-flutter-v6-calls/SKILL.md +72 -57
  129. package/skills/cometchat-flutter-v6-calls/references/add-calls-to-existing-chat.md +5 -3
  130. package/skills/cometchat-flutter-v6-calls/references/advanced-features.md +89 -0
  131. package/skills/cometchat-flutter-v6-calls/references/call-layouts.md +15 -12
  132. package/skills/cometchat-flutter-v6-calls/references/call-session.md +2 -2
  133. package/skills/cometchat-flutter-v6-calls/references/device-management.md +9 -3
  134. package/skills/cometchat-flutter-v6-calls/references/group-calls.md +10 -10
  135. package/skills/cometchat-flutter-v6-calls/references/idle-timeout.md +15 -7
  136. package/skills/cometchat-flutter-v6-calls/references/in-call-chat.md +6 -3
  137. package/skills/cometchat-flutter-v6-calls/references/raise-hand.md +23 -16
  138. package/skills/cometchat-flutter-v6-components/SKILL.md +32 -11
  139. package/skills/cometchat-flutter-v6-conversations/SKILL.md +39 -11
  140. package/skills/cometchat-flutter-v6-core/SKILL.md +182 -21
  141. package/skills/cometchat-flutter-v6-customization/SKILL.md +97 -25
  142. package/skills/cometchat-flutter-v6-events/SKILL.md +3 -2
  143. package/skills/cometchat-flutter-v6-features/SKILL.md +15 -6
  144. package/skills/cometchat-flutter-v6-messages/SKILL.md +111 -60
  145. package/skills/cometchat-flutter-v6-migration/SKILL.md +18 -25
  146. package/skills/cometchat-flutter-v6-placement/SKILL.md +79 -50
  147. package/skills/cometchat-flutter-v6-production/SKILL.md +13 -12
  148. package/skills/cometchat-flutter-v6-push/SKILL.md +41 -19
  149. package/skills/cometchat-flutter-v6-testing/SKILL.md +4 -4
  150. package/skills/cometchat-flutter-v6-theming/SKILL.md +38 -5
  151. package/skills/cometchat-flutter-v6-troubleshooting/SKILL.md +182 -17
  152. package/skills/cometchat-flutter-v6-users-groups/SKILL.md +12 -4
  153. package/skills/cometchat-i18n/SKILL.md +140 -79
  154. package/skills/cometchat-ios/SKILL.md +4 -2
  155. package/skills/cometchat-ios-calls/SKILL.md +225 -95
  156. package/skills/cometchat-ios-calls/references/add-calls-to-existing-chat.md +11 -9
  157. package/skills/cometchat-ios-calls/references/audio-modes-and-controls.md +45 -0
  158. package/skills/cometchat-ios-calls/references/avaudiosession-routing.md +6 -7
  159. package/skills/cometchat-ios-calls/references/call-layouts.md +31 -91
  160. package/skills/cometchat-ios-calls/references/call-session.md +51 -54
  161. package/skills/cometchat-ios-calls/references/callkit-and-pushkit.md +33 -29
  162. package/skills/cometchat-ios-calls/references/custom-ui.md +38 -38
  163. package/skills/cometchat-ios-calls/references/group-calls.md +33 -70
  164. package/skills/cometchat-ios-calls/references/idle-timeout.md +24 -25
  165. package/skills/cometchat-ios-calls/references/in-call-chat.md +19 -23
  166. package/skills/cometchat-ios-calls/references/migration-v4-to-v5.md +128 -70
  167. package/skills/cometchat-ios-calls/references/picture-in-picture.md +20 -20
  168. package/skills/cometchat-ios-calls/references/raise-hand.md +14 -227
  169. package/skills/cometchat-ios-calls/references/recording-screen-share.md +35 -122
  170. package/skills/cometchat-ios-calls/references/ringing-integration.md +17 -16
  171. package/skills/cometchat-ios-calls/references/share-invite.md +8 -12
  172. package/skills/cometchat-ios-calls/references/swiftui-uikit-hosting.md +4 -4
  173. package/skills/cometchat-ios-components/SKILL.md +200 -12
  174. package/skills/cometchat-ios-core/SKILL.md +173 -45
  175. package/skills/cometchat-ios-customization/SKILL.md +276 -110
  176. package/skills/cometchat-ios-features/SKILL.md +64 -36
  177. package/skills/cometchat-ios-placement/SKILL.md +15 -12
  178. package/skills/cometchat-ios-production/SKILL.md +12 -4
  179. package/skills/cometchat-ios-push/SKILL.md +53 -19
  180. package/skills/cometchat-ios-testing/SKILL.md +14 -9
  181. package/skills/cometchat-ios-theming/SKILL.md +39 -3
  182. package/skills/cometchat-ios-troubleshooting/SKILL.md +41 -21
  183. package/skills/cometchat-native-bare-patterns/SKILL.md +36 -19
  184. package/skills/cometchat-native-calls/SKILL.md +29 -17
  185. package/skills/cometchat-native-calls/references/add-calls-to-existing-chat.md +2 -2
  186. package/skills/cometchat-native-calls/references/call-layouts.md +15 -14
  187. package/skills/cometchat-native-calls/references/call-session.md +2 -2
  188. package/skills/cometchat-native-calls/references/custom-ui.md +12 -8
  189. package/skills/cometchat-native-calls/references/device-management.md +53 -30
  190. package/skills/cometchat-native-calls/references/group-calls.md +35 -30
  191. package/skills/cometchat-native-calls/references/idle-timeout.md +6 -6
  192. package/skills/cometchat-native-calls/references/in-call-chat.md +10 -8
  193. package/skills/cometchat-native-calls/references/migration-v4-to-v5.md +2 -2
  194. package/skills/cometchat-native-calls/references/raise-hand.md +15 -13
  195. package/skills/cometchat-native-calls/references/recording-screen-share.md +49 -170
  196. package/skills/cometchat-native-calls/references/share-invite.md +7 -5
  197. package/skills/cometchat-native-calls/references/voip-push-end-to-end.md +4 -2
  198. package/skills/cometchat-native-components/SKILL.md +84 -52
  199. package/skills/cometchat-native-core/SKILL.md +102 -33
  200. package/skills/cometchat-native-customization/SKILL.md +150 -28
  201. package/skills/cometchat-native-expo-patterns/SKILL.md +60 -29
  202. package/skills/cometchat-native-features/SKILL.md +24 -17
  203. package/skills/cometchat-native-placement/SKILL.md +19 -10
  204. package/skills/cometchat-native-production/SKILL.md +9 -3
  205. package/skills/cometchat-native-push/SKILL.md +2 -1
  206. package/skills/cometchat-native-testing/SKILL.md +1 -2
  207. package/skills/cometchat-native-theming/SKILL.md +54 -29
  208. package/skills/cometchat-native-troubleshooting/SKILL.md +11 -5
  209. package/skills/cometchat-nextjs-patterns/SKILL.md +22 -8
  210. package/skills/cometchat-placement/SKILL.md +42 -3
  211. package/skills/cometchat-production/SKILL.md +12 -5
  212. package/skills/cometchat-react-calls/SKILL.md +220 -10
  213. package/skills/cometchat-react-calls/references/add-calls-to-existing-chat.md +4 -3
  214. package/skills/cometchat-react-calls/references/call-layouts.md +5 -6
  215. package/skills/cometchat-react-calls/references/call-session.md +1 -1
  216. package/skills/cometchat-react-calls/references/custom-ui.md +61 -15
  217. package/skills/cometchat-react-calls/references/device-management.md +55 -51
  218. package/skills/cometchat-react-calls/references/group-calls.md +18 -23
  219. package/skills/cometchat-react-calls/references/idle-timeout.md +25 -12
  220. package/skills/cometchat-react-calls/references/in-call-chat.md +7 -7
  221. package/skills/cometchat-react-calls/references/migration-v4-to-v5.md +9 -11
  222. package/skills/cometchat-react-calls/references/raise-hand.md +14 -14
  223. package/skills/cometchat-react-calls/references/recording-screen-share.md +39 -38
  224. package/skills/cometchat-react-calls/references/ringing-integration.md +2 -2
  225. package/skills/cometchat-react-calls/references/share-invite.md +4 -5
  226. package/skills/cometchat-react-calls/references/testing-calls-on-web.md +20 -2
  227. package/skills/cometchat-react-calls/references/virtual-background.md +32 -0
  228. package/skills/cometchat-react-patterns/SKILL.md +45 -5
  229. package/skills/cometchat-react-push/SKILL.md +258 -72
  230. package/skills/cometchat-react-router-patterns/SKILL.md +12 -6
  231. package/skills/cometchat-react-testing/SKILL.md +14 -5
  232. package/skills/cometchat-theming/SKILL.md +181 -18
  233. 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
- const settings = new CometChatCalls.CallSettingsBuilder()
19
- .setSessionID(sessionId)
20
- .setIsAudioOnly(false)
21
- .enableRecording(true) // server starts recording when session begins
22
- .setShowRecordingButton(true) // user can toggle mid-call (with kit's default UI)
23
- .build();
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
- const listener = new CometChatCalls.OngoingCallListener({
30
- onRecordingStarted: () => {
31
- // Update UI — show a "REC" indicator (compliance requirement in some jurisdictions)
32
- setRecording(true);
33
- },
34
- onRecordingStopped: () => {
35
- setRecording(false);
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
- Screen capture on RN is platform-specific. iOS uses an iOS Broadcast Extension (separate target); Android uses MediaProjection. Both are exposed by `react-native-webrtc` 119, which is a peer of the Calls SDK.
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
- The picker renders as a small system-styled button. iOS doesn't allow custom UI for screen-share initiation — must use this picker.
82
+ ### Viewer receive / view a screen share
139
83
 
140
- ### Android MediaProjection setup
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
- Android is simpler. Add the permission to `AndroidManifest.xml`:
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
- const listener = new CometChatCalls.OngoingCallListener({
166
- onScreenShareStarted: (presenterUid: string) => {
167
- // The kit's default UI auto-renders the screen-share tile.
168
- // Custom UI: query the SDK for the screen-share track and pipe into <RTCView />
169
- setScreenSharePresenter(presenterUid);
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
- ## Combining recording + screen-share
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
- In the Broadcast Extension (`SampleHandler.swift`):
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
- Without the App Group, the extension can't see the main app's CometChat state screen capture starts but can't deliver to the call session.
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. **iOS without Broadcast Extension** target. Compiles and runs, but `startScreenShare()` returns a "no broadcast extension found" error. Manual Xcode step is required.
249
- 2. **Mismatched App Group identifiers** between targets. Extension can't read the session ID; screen share fails silently.
250
- 3. **Android without `FOREGROUND_SERVICE_MEDIA_PROJECTION` permission** on Android 14+. Service starts silent crash screen share dies.
251
- 4. **No "REC" indicator in custom UI.** Compliance violation in two-party-consent jurisdictions.
252
- 5. **Trying to download recordings from the device.** They live on CometChat's servers. Use the dashboard or REST API.
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
- - [ ] `enableRecording(true)` on `CallSettingsBuilder`
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
- - [ ] iOS: Broadcast Extension target created in Xcode
269
- - [ ] iOS: App Group capability on BOTH main + extension targets, matching identifiers
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
- - [ ] iOS: tap broadcast picker consentscreen share visible to other participants
278
- - [ ] Android: tap "Share screen"MediaProjection prompt screen share begins
279
- - [ ] Both: end screen share returns to camera view smoothly
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 sharingRN 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
- const callSettings = new CallSettingsBuilder()
43
- .setHideShareInviteButton(false)
44
- .build();
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
- CometChatCalls.addEventListener("onShareInviteButtonClicked", handler);
49
- return () => CometChatCalls.removeEventListener("onShareInviteButtonClicked", handler);
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
- await CometChatCalls.acceptCall(callUUID);
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