@cometchat/skills 4.0.0 → 4.2.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.
Files changed (258) hide show
  1. package/README.md +42 -2
  2. package/bin/install.js +448 -57
  3. package/package.json +1 -1
  4. package/skills/cometchat/SKILL.md +337 -80
  5. package/skills/cometchat-a11y/SKILL.md +476 -0
  6. package/skills/cometchat-android-v5/SKILL.md +1 -1
  7. package/skills/cometchat-android-v5-calls/SKILL.md +413 -0
  8. package/skills/cometchat-android-v5-calls/references/README.md +53 -0
  9. package/skills/cometchat-android-v5-calls/references/add-calls-to-existing-chat.md +195 -0
  10. package/skills/cometchat-android-v5-calls/references/audio-controls.md +91 -0
  11. package/skills/cometchat-android-v5-calls/references/background-handling.md +168 -0
  12. package/skills/cometchat-android-v5-calls/references/call-layouts.md +123 -0
  13. package/skills/cometchat-android-v5-calls/references/call-logs.md +113 -0
  14. package/skills/cometchat-android-v5-calls/references/call-session.md +274 -0
  15. package/skills/cometchat-android-v5-calls/references/custom-ui.md +150 -0
  16. package/skills/cometchat-android-v5-calls/references/event-listeners.md +123 -0
  17. package/skills/cometchat-android-v5-calls/references/group-calls.md +205 -0
  18. package/skills/cometchat-android-v5-calls/references/idle-timeout.md +111 -0
  19. package/skills/cometchat-android-v5-calls/references/in-call-chat.md +134 -0
  20. package/skills/cometchat-android-v5-calls/references/join-session.md +120 -0
  21. package/skills/cometchat-android-v5-calls/references/migration-v4-to-v5.md +206 -0
  22. package/skills/cometchat-android-v5-calls/references/participant-management.md +110 -0
  23. package/skills/cometchat-android-v5-calls/references/picture-in-picture.md +106 -0
  24. package/skills/cometchat-android-v5-calls/references/raise-hand.md +242 -0
  25. package/skills/cometchat-android-v5-calls/references/recording.md +101 -0
  26. package/skills/cometchat-android-v5-calls/references/ringing-integration.md +152 -0
  27. package/skills/cometchat-android-v5-calls/references/screen-sharing.md +82 -0
  28. package/skills/cometchat-android-v5-calls/references/server-fcm-voip.md +215 -0
  29. package/skills/cometchat-android-v5-calls/references/session-settings.md +121 -0
  30. package/skills/cometchat-android-v5-calls/references/setup.md +137 -0
  31. package/skills/cometchat-android-v5-calls/references/share-invite.md +151 -0
  32. package/skills/cometchat-android-v5-calls/references/video-controls.md +87 -0
  33. package/skills/cometchat-android-v5-calls/references/voip-calling.md +526 -0
  34. package/skills/cometchat-android-v5-components/SKILL.md +1 -1
  35. package/skills/cometchat-android-v5-core/SKILL.md +1 -1
  36. package/skills/cometchat-android-v5-customization/SKILL.md +1 -1
  37. package/skills/cometchat-android-v5-extensions/SKILL.md +1 -1
  38. package/skills/cometchat-android-v5-features/SKILL.md +1 -1
  39. package/skills/cometchat-android-v5-placement/SKILL.md +1 -1
  40. package/skills/cometchat-android-v5-production/SKILL.md +1 -1
  41. package/skills/cometchat-android-v5-push/SKILL.md +1 -1
  42. package/skills/cometchat-android-v5-testing/SKILL.md +1 -1
  43. package/skills/cometchat-android-v5-theming/SKILL.md +1 -1
  44. package/skills/cometchat-android-v5-troubleshooting/SKILL.md +1 -1
  45. package/skills/cometchat-android-v6/SKILL.md +1 -1
  46. package/skills/cometchat-android-v6-builder-settings/SKILL.md +1 -1
  47. package/skills/cometchat-android-v6-calls/SKILL.md +375 -0
  48. package/skills/cometchat-android-v6-calls/references/add-calls-to-existing-chat.md +97 -0
  49. package/skills/cometchat-android-v6-calls/references/call-layouts.md +91 -0
  50. package/skills/cometchat-android-v6-calls/references/call-session.md +163 -0
  51. package/skills/cometchat-android-v6-calls/references/device-management.md +171 -0
  52. package/skills/cometchat-android-v6-calls/references/group-calls.md +191 -0
  53. package/skills/cometchat-android-v6-calls/references/idle-timeout.md +107 -0
  54. package/skills/cometchat-android-v6-calls/references/in-call-chat.md +136 -0
  55. package/skills/cometchat-android-v6-calls/references/raise-hand.md +186 -0
  56. package/skills/cometchat-android-v6-calls/references/ringing-integration.md +176 -0
  57. package/skills/cometchat-android-v6-calls/references/server-fcm-voip.md +127 -0
  58. package/skills/cometchat-android-v6-calls/references/share-invite.md +105 -0
  59. package/skills/cometchat-android-v6-compose-components/SKILL.md +2 -2
  60. package/skills/cometchat-android-v6-compose-customization/SKILL.md +1 -1
  61. package/skills/cometchat-android-v6-compose-placement/SKILL.md +1 -1
  62. package/skills/cometchat-android-v6-compose-theming/SKILL.md +1 -1
  63. package/skills/cometchat-android-v6-core/SKILL.md +1 -1
  64. package/skills/cometchat-android-v6-events/SKILL.md +1 -1
  65. package/skills/cometchat-android-v6-extensions/SKILL.md +1 -1
  66. package/skills/cometchat-android-v6-features/SKILL.md +1 -1
  67. package/skills/cometchat-android-v6-kotlin-components/SKILL.md +1 -1
  68. package/skills/cometchat-android-v6-kotlin-customization/SKILL.md +1 -1
  69. package/skills/cometchat-android-v6-kotlin-placement/SKILL.md +1 -1
  70. package/skills/cometchat-android-v6-kotlin-theming/SKILL.md +1 -1
  71. package/skills/cometchat-android-v6-migration/SKILL.md +398 -0
  72. package/skills/cometchat-android-v6-production/SKILL.md +1 -1
  73. package/skills/cometchat-android-v6-push/SKILL.md +1 -1
  74. package/skills/cometchat-android-v6-testing/SKILL.md +1 -1
  75. package/skills/cometchat-android-v6-troubleshooting/SKILL.md +1 -1
  76. package/skills/cometchat-angular-calls/SKILL.md +511 -0
  77. package/skills/cometchat-angular-calls/references/add-calls-to-existing-chat.md +95 -0
  78. package/skills/cometchat-angular-calls/references/call-layouts.md +106 -0
  79. package/skills/cometchat-angular-calls/references/call-session.md +167 -0
  80. package/skills/cometchat-angular-calls/references/custom-ui.md +231 -0
  81. package/skills/cometchat-angular-calls/references/device-management.md +135 -0
  82. package/skills/cometchat-angular-calls/references/group-calls.md +412 -0
  83. package/skills/cometchat-angular-calls/references/idle-timeout.md +145 -0
  84. package/skills/cometchat-angular-calls/references/in-call-chat.md +148 -0
  85. package/skills/cometchat-angular-calls/references/lazy-loading-pitfalls.md +205 -0
  86. package/skills/cometchat-angular-calls/references/migration-v4-to-v5.md +53 -0
  87. package/skills/cometchat-angular-calls/references/ngzone-and-async-callbacks.md +183 -0
  88. package/skills/cometchat-angular-calls/references/picture-in-picture.md +285 -0
  89. package/skills/cometchat-angular-calls/references/raise-hand.md +167 -0
  90. package/skills/cometchat-angular-calls/references/recording-screen-share.md +267 -0
  91. package/skills/cometchat-angular-calls/references/ringing-integration.md +131 -0
  92. package/skills/cometchat-angular-calls/references/server-web-push-vapid.md +100 -0
  93. package/skills/cometchat-angular-calls/references/share-invite.md +116 -0
  94. package/skills/cometchat-angular-components/SKILL.md +1 -1
  95. package/skills/cometchat-angular-core/SKILL.md +1 -1
  96. package/skills/cometchat-angular-customization/SKILL.md +1 -1
  97. package/skills/cometchat-angular-features/SKILL.md +1 -1
  98. package/skills/cometchat-angular-patterns/SKILL.md +1 -1
  99. package/skills/cometchat-angular-placement/SKILL.md +1 -1
  100. package/skills/cometchat-angular-production/SKILL.md +1 -1
  101. package/skills/cometchat-angular-push/SKILL.md +403 -0
  102. package/skills/cometchat-angular-testing/SKILL.md +333 -0
  103. package/skills/cometchat-angular-theming/SKILL.md +1 -1
  104. package/skills/cometchat-angular-troubleshooting/SKILL.md +1 -1
  105. package/skills/cometchat-astro-patterns/SKILL.md +1 -1
  106. package/skills/cometchat-calls/SKILL.md +358 -0
  107. package/skills/cometchat-calls/references/use-case-broadcast.md +194 -0
  108. package/skills/cometchat-calls/references/use-case-marketplace.md +158 -0
  109. package/skills/cometchat-calls/references/use-case-support.md +190 -0
  110. package/skills/cometchat-calls/references/use-case-team.md +169 -0
  111. package/skills/cometchat-calls/references/use-case-telehealth.md +154 -0
  112. package/skills/cometchat-components/SKILL.md +1 -1
  113. package/skills/cometchat-core/SKILL.md +1 -1
  114. package/skills/cometchat-customization/SKILL.md +2 -2
  115. package/skills/cometchat-features/SKILL.md +2 -2
  116. package/skills/cometchat-flutter-v5/SKILL.md +1 -1
  117. package/skills/cometchat-flutter-v5-calls/SKILL.md +325 -94
  118. package/skills/cometchat-flutter-v5-calls/references/add-calls-to-existing-chat.md +169 -0
  119. package/skills/cometchat-flutter-v5-calls/references/call-layouts.md +98 -0
  120. package/skills/cometchat-flutter-v5-calls/references/call-session.md +330 -0
  121. package/skills/cometchat-flutter-v5-calls/references/device-management.md +120 -0
  122. package/skills/cometchat-flutter-v5-calls/references/group-calls.md +187 -0
  123. package/skills/cometchat-flutter-v5-calls/references/idle-timeout.md +97 -0
  124. package/skills/cometchat-flutter-v5-calls/references/in-call-chat.md +132 -0
  125. package/skills/cometchat-flutter-v5-calls/references/migration-v4-to-v5.md +160 -0
  126. package/skills/cometchat-flutter-v5-calls/references/raise-hand.md +244 -0
  127. package/skills/cometchat-flutter-v5-calls/references/ringing-integration.md +193 -0
  128. package/skills/cometchat-flutter-v5-calls/references/server-push-bridge.md +101 -0
  129. package/skills/cometchat-flutter-v5-calls/references/share-invite.md +142 -0
  130. package/skills/cometchat-flutter-v5-conversations/SKILL.md +1 -1
  131. package/skills/cometchat-flutter-v5-core/SKILL.md +1 -1
  132. package/skills/cometchat-flutter-v5-customization/SKILL.md +1 -1
  133. package/skills/cometchat-flutter-v5-events/SKILL.md +1 -1
  134. package/skills/cometchat-flutter-v5-messages/SKILL.md +1 -1
  135. package/skills/cometchat-flutter-v5-production/SKILL.md +1 -1
  136. package/skills/cometchat-flutter-v5-push/SKILL.md +1 -1
  137. package/skills/cometchat-flutter-v5-testing/SKILL.md +390 -0
  138. package/skills/cometchat-flutter-v5-theming/SKILL.md +1 -1
  139. package/skills/cometchat-flutter-v5-troubleshooting/SKILL.md +1 -1
  140. package/skills/cometchat-flutter-v5-users-groups/SKILL.md +1 -1
  141. package/skills/cometchat-flutter-v6/SKILL.md +1 -1
  142. package/skills/cometchat-flutter-v6-calls/SKILL.md +308 -243
  143. package/skills/cometchat-flutter-v6-calls/references/add-calls-to-existing-chat.md +134 -0
  144. package/skills/cometchat-flutter-v6-calls/references/call-layouts.md +102 -0
  145. package/skills/cometchat-flutter-v6-calls/references/call-session.md +229 -0
  146. package/skills/cometchat-flutter-v6-calls/references/device-management.md +99 -0
  147. package/skills/cometchat-flutter-v6-calls/references/group-calls.md +190 -0
  148. package/skills/cometchat-flutter-v6-calls/references/idle-timeout.md +80 -0
  149. package/skills/cometchat-flutter-v6-calls/references/in-call-chat.md +122 -0
  150. package/skills/cometchat-flutter-v6-calls/references/raise-hand.md +268 -0
  151. package/skills/cometchat-flutter-v6-calls/references/ringing-integration.md +171 -0
  152. package/skills/cometchat-flutter-v6-calls/references/server-push-bridge.md +93 -0
  153. package/skills/cometchat-flutter-v6-calls/references/share-invite.md +102 -0
  154. package/skills/cometchat-flutter-v6-components/SKILL.md +1 -1
  155. package/skills/cometchat-flutter-v6-conversations/SKILL.md +1 -1
  156. package/skills/cometchat-flutter-v6-core/SKILL.md +1 -1
  157. package/skills/cometchat-flutter-v6-customization/SKILL.md +1 -1
  158. package/skills/cometchat-flutter-v6-events/SKILL.md +1 -1
  159. package/skills/cometchat-flutter-v6-features/SKILL.md +1 -1
  160. package/skills/cometchat-flutter-v6-messages/SKILL.md +1 -1
  161. package/skills/cometchat-flutter-v6-migration/SKILL.md +1 -1
  162. package/skills/cometchat-flutter-v6-placement/SKILL.md +1 -1
  163. package/skills/cometchat-flutter-v6-production/SKILL.md +1 -1
  164. package/skills/cometchat-flutter-v6-push/SKILL.md +452 -0
  165. package/skills/cometchat-flutter-v6-testing/SKILL.md +319 -0
  166. package/skills/cometchat-flutter-v6-theming/SKILL.md +1 -1
  167. package/skills/cometchat-flutter-v6-troubleshooting/SKILL.md +1 -1
  168. package/skills/cometchat-flutter-v6-users-groups/SKILL.md +1 -1
  169. package/skills/cometchat-i18n/SKILL.md +358 -0
  170. package/skills/cometchat-ios/SKILL.md +5 -5
  171. package/skills/cometchat-ios-calls/SKILL.md +409 -0
  172. package/skills/cometchat-ios-calls/references/add-calls-to-existing-chat.md +172 -0
  173. package/skills/cometchat-ios-calls/references/avaudiosession-routing.md +189 -0
  174. package/skills/cometchat-ios-calls/references/call-layouts.md +136 -0
  175. package/skills/cometchat-ios-calls/references/call-session.md +221 -0
  176. package/skills/cometchat-ios-calls/references/callkit-and-pushkit.md +353 -0
  177. package/skills/cometchat-ios-calls/references/custom-ui.md +322 -0
  178. package/skills/cometchat-ios-calls/references/device-management.md +171 -0
  179. package/skills/cometchat-ios-calls/references/group-calls.md +396 -0
  180. package/skills/cometchat-ios-calls/references/idle-timeout.md +185 -0
  181. package/skills/cometchat-ios-calls/references/in-call-chat.md +183 -0
  182. package/skills/cometchat-ios-calls/references/migration-v4-to-v5.md +138 -0
  183. package/skills/cometchat-ios-calls/references/picture-in-picture.md +246 -0
  184. package/skills/cometchat-ios-calls/references/raise-hand.md +239 -0
  185. package/skills/cometchat-ios-calls/references/recording-screen-share.md +339 -0
  186. package/skills/cometchat-ios-calls/references/ringing-integration.md +142 -0
  187. package/skills/cometchat-ios-calls/references/server-apns-pushkit.md +267 -0
  188. package/skills/cometchat-ios-calls/references/share-invite.md +152 -0
  189. package/skills/cometchat-ios-calls/references/swiftui-uikit-hosting.md +246 -0
  190. package/skills/cometchat-ios-calls/references/voip-cert-setup.md +166 -0
  191. package/skills/cometchat-ios-components/SKILL.md +1 -1
  192. package/skills/cometchat-ios-core/SKILL.md +1 -1
  193. package/skills/cometchat-ios-customization/SKILL.md +1 -1
  194. package/skills/cometchat-ios-features/SKILL.md +1 -1
  195. package/skills/cometchat-ios-placement/SKILL.md +1 -1
  196. package/skills/cometchat-ios-production/SKILL.md +1 -1
  197. package/skills/cometchat-ios-push/SKILL.md +1 -1
  198. package/skills/cometchat-ios-testing/SKILL.md +371 -0
  199. package/skills/cometchat-ios-theming/SKILL.md +1 -1
  200. package/skills/cometchat-ios-troubleshooting/SKILL.md +1 -1
  201. package/skills/cometchat-native-bare-patterns/SKILL.md +45 -3
  202. package/skills/cometchat-native-calls/SKILL.md +599 -0
  203. package/skills/cometchat-native-calls/references/add-calls-to-existing-chat.md +203 -0
  204. package/skills/cometchat-native-calls/references/call-layouts.md +124 -0
  205. package/skills/cometchat-native-calls/references/call-session.md +182 -0
  206. package/skills/cometchat-native-calls/references/custom-ui.md +250 -0
  207. package/skills/cometchat-native-calls/references/device-management.md +135 -0
  208. package/skills/cometchat-native-calls/references/expo-vs-bare.md +179 -0
  209. package/skills/cometchat-native-calls/references/group-calls.md +291 -0
  210. package/skills/cometchat-native-calls/references/idle-timeout.md +128 -0
  211. package/skills/cometchat-native-calls/references/in-call-chat.md +143 -0
  212. package/skills/cometchat-native-calls/references/migration-v4-to-v5.md +72 -0
  213. package/skills/cometchat-native-calls/references/picture-in-picture.md +276 -0
  214. package/skills/cometchat-native-calls/references/raise-hand.md +203 -0
  215. package/skills/cometchat-native-calls/references/recording-screen-share.md +290 -0
  216. package/skills/cometchat-native-calls/references/ringing-integration.md +118 -0
  217. package/skills/cometchat-native-calls/references/server-push-bridge.md +135 -0
  218. package/skills/cometchat-native-calls/references/server-push-payloads.md +193 -0
  219. package/skills/cometchat-native-calls/references/share-invite.md +144 -0
  220. package/skills/cometchat-native-calls/references/voip-push-end-to-end.md +317 -0
  221. package/skills/cometchat-native-components/SKILL.md +1 -1
  222. package/skills/cometchat-native-core/SKILL.md +1 -1
  223. package/skills/cometchat-native-customization/SKILL.md +1 -1
  224. package/skills/cometchat-native-expo-patterns/SKILL.md +18 -1
  225. package/skills/cometchat-native-features/SKILL.md +1 -1
  226. package/skills/cometchat-native-placement/SKILL.md +1 -1
  227. package/skills/cometchat-native-production/SKILL.md +1 -1
  228. package/skills/cometchat-native-push/SKILL.md +1 -1
  229. package/skills/cometchat-native-testing/SKILL.md +1 -1
  230. package/skills/cometchat-native-theming/SKILL.md +1 -1
  231. package/skills/cometchat-native-troubleshooting/SKILL.md +1 -1
  232. package/skills/cometchat-nextjs-patterns/SKILL.md +1 -1
  233. package/skills/cometchat-placement/SKILL.md +29 -1
  234. package/skills/cometchat-production/SKILL.md +1 -1
  235. package/skills/cometchat-react-calls/SKILL.md +539 -0
  236. package/skills/cometchat-react-calls/references/add-calls-to-existing-chat.md +145 -0
  237. package/skills/cometchat-react-calls/references/call-layouts.md +161 -0
  238. package/skills/cometchat-react-calls/references/call-session.md +235 -0
  239. package/skills/cometchat-react-calls/references/custom-ui.md +201 -0
  240. package/skills/cometchat-react-calls/references/device-management.md +206 -0
  241. package/skills/cometchat-react-calls/references/group-calls.md +262 -0
  242. package/skills/cometchat-react-calls/references/idle-timeout.md +175 -0
  243. package/skills/cometchat-react-calls/references/in-call-chat.md +212 -0
  244. package/skills/cometchat-react-calls/references/migration-v4-to-v5.md +172 -0
  245. package/skills/cometchat-react-calls/references/picture-in-picture.md +245 -0
  246. package/skills/cometchat-react-calls/references/raise-hand.md +238 -0
  247. package/skills/cometchat-react-calls/references/recording-screen-share.md +143 -0
  248. package/skills/cometchat-react-calls/references/ringing-integration.md +255 -0
  249. package/skills/cometchat-react-calls/references/server-web-push-vapid.md +241 -0
  250. package/skills/cometchat-react-calls/references/share-invite.md +176 -0
  251. package/skills/cometchat-react-calls/references/testing-calls-on-web.md +198 -0
  252. package/skills/cometchat-react-calls/references/voip-and-web-push.md +165 -0
  253. package/skills/cometchat-react-patterns/SKILL.md +56 -8
  254. package/skills/cometchat-react-push/SKILL.md +448 -0
  255. package/skills/cometchat-react-router-patterns/SKILL.md +1 -1
  256. package/skills/cometchat-react-testing/SKILL.md +404 -0
  257. package/skills/cometchat-theming/SKILL.md +3 -3
  258. package/skills/cometchat-troubleshooting/SKILL.md +2 -2
@@ -0,0 +1,290 @@
1
+ # Recording + screen-share on React Native
2
+
3
+ Both features live in the Calls SDK; both have RN-specific gotchas the kit's defaults don't handle. Sister of `cometchat-react-calls/references/recording-screen-share.md` — same SDK semantics, different platform plumbing for screen capture.
4
+
5
+ ---
6
+
7
+ ## Recording
8
+
9
+ ### Server-side: dashboard gate
10
+
11
+ Recording is a paid feature on most CometChat plans. Enable in **Dashboard → Chat & Messaging → Calls → Recording**. The client-side flag below is a no-op without it.
12
+
13
+ ### Client-side: opt-in per session
14
+
15
+ ```ts
16
+ import { CometChatCalls } from "@cometchat/calls-sdk-react-native";
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();
24
+ ```
25
+
26
+ ### Recording lifecycle events
27
+
28
+ ```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
+ },
41
+ });
42
+ ```
43
+
44
+ ### REC indicator (compliance)
45
+
46
+ In some regions, you must visually notify all participants when recording is active. The kit's default `CometChatOngoingCall` shows a small "Recording" badge. Custom UI must render this:
47
+
48
+ ```tsx
49
+ {recording && (
50
+ <View style={styles.recBadge}>
51
+ <Text style={styles.recDot}>●</Text>
52
+ <Text style={styles.recLabel}>REC</Text>
53
+ </View>
54
+ )}
55
+ ```
56
+
57
+ Don't omit this — the legal exposure is real (CCPA, GDPR, two-party-consent US states).
58
+
59
+ ### Where the recordings go
60
+
61
+ CometChat hosts the file. It appears in **Dashboard → Calls → Recordings** with a download link. There is no client-side download API — the file isn't exposed to the device for security/compliance reasons.
62
+
63
+ For programmatic access:
64
+
65
+ ```ts
66
+ // Server-side — your backend with the dashboard bearer token
67
+ const res = await fetch(
68
+ `https://${region}.api-management.cometchat.io/v3/apps/${appId}/recordings`,
69
+ { headers: { Authorization: `Bearer ${dashboardToken}` } },
70
+ );
71
+ const recordings = await res.json();
72
+ ```
73
+
74
+ The skill points users at this REST endpoint; it doesn't generate client code (recordings shouldn't be downloadable from the device).
75
+
76
+ ---
77
+
78
+ ## Screen sharing
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
+ ```
137
+
138
+ The picker renders as a small system-styled button. iOS doesn't allow custom UI for screen-share initiation — must use this picker.
139
+
140
+ ### Android — MediaProjection setup
141
+
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
163
+
164
+ ```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
+ },
174
+ });
175
+ ```
176
+
177
+ Custom-UI viewer composition:
178
+
179
+ ```tsx
180
+ function CustomCallView() {
181
+ const [screenSharePresenter, setScreenSharePresenter] = useState<string | null>(null);
182
+ const [participants, setParticipants] = useState<Participant[]>([]);
183
+
184
+ return (
185
+ <View style={styles.container}>
186
+ {screenSharePresenter ? (
187
+ <ScreenShareView presenterUid={screenSharePresenter} />
188
+ ) : (
189
+ <ParticipantTilesGrid participants={participants} />
190
+ )}
191
+ </View>
192
+ );
193
+ }
194
+ ```
195
+
196
+ When someone shares their screen, switch the layout to "screen share + participant strip"; switch back when they stop.
197
+
198
+ ---
199
+
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
+ ```
226
+
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
+ ```
241
+
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.
243
+
244
+ ---
245
+
246
+ ## Anti-patterns
247
+
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.
255
+
256
+ ---
257
+
258
+ ## Verification checklist
259
+
260
+ **Recording:**
261
+ - [ ] Dashboard gate enabled (Recording feature on the plan)
262
+ - [ ] `enableRecording(true)` on `CallSettingsBuilder`
263
+ - [ ] `onRecordingStarted` / `onRecordingStopped` listeners wired
264
+ - [ ] "REC" indicator visible to all participants when active
265
+ - [ ] `onRecordingFailed` surfaces to UI
266
+
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`
275
+
276
+ **Real-device smoke:**
277
+ - [ ] iOS: tap broadcast picker → consent → screen 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
281
+
282
+ ---
283
+
284
+ ## Pointers
285
+
286
+ - `references/custom-ui.md` — building custom call surfaces with screen-share viewer
287
+ - `references/group-calls.md` — group calls + screen share interplay (one share at a time)
288
+ - `references/voip-push-end-to-end.md` — push payloads
289
+ - `cometchat-native-calls` SKILL.md — base hard rules
290
+ - `cometchat-react-calls/references/recording-screen-share.md` — sister web reference (same SDK semantics)
@@ -0,0 +1,118 @@
1
+ # Ringing — call signaling with custom UI (React Native)
2
+
3
+ Same SDK shape as web; RN-specific deltas: navigation-aware listener mount, CallKeep + VoIP push for backgrounded ring delivery, audio file paths via require.
4
+
5
+ **Read first:** `cometchat-react-calls/references/ringing-integration.md` — full architecture, hard rules, web reference.
6
+
7
+ ---
8
+
9
+ ## SDK API
10
+
11
+ ```ts
12
+ import { CometChat } from "@cometchat/chat-sdk-react-native";
13
+ import { CometChatCalls } from "@cometchat/calls-sdk-react-native";
14
+
15
+ const call = new CometChat.Call(
16
+ receiverUid,
17
+ CometChat.CALL_TYPE.VIDEO,
18
+ CometChat.RECEIVER_TYPE.USER,
19
+ );
20
+ const outgoingCall = await CometChat.initiateCall(call, 60);
21
+ ```
22
+
23
+ ---
24
+
25
+ ## Listener mount: at NavigationContainer root, NOT inside a screen
26
+
27
+ ```tsx
28
+ // App.tsx — sibling of NavigationContainer's content
29
+ import { useEffect } from "react";
30
+ import { NavigationContainer } from "@react-navigation/native";
31
+
32
+ export default function App() {
33
+ useCometChatCallListener();
34
+ return (
35
+ <NavigationContainer>
36
+ <RootNavigator />
37
+ </NavigationContainer>
38
+ );
39
+ }
40
+
41
+ function useCometChatCallListener() {
42
+ useEffect(() => {
43
+ CometChat.addCallListener("app", new CometChat.CallListener({
44
+ onIncomingCallReceived: (call) => navigationRef.current?.navigate("IncomingCall", { call }),
45
+ onOutgoingCallAccepted: (call) => navigationRef.current?.navigate("ActiveCall", { sessionId: call.getSessionId() }),
46
+ onIncomingCallCancelled: () => navigationRef.current?.goBack(),
47
+ onOutgoingCallRejected: () => navigationRef.current?.goBack(),
48
+ onCallEndedMessageReceived: () => navigationRef.current?.popToTop(),
49
+ }));
50
+ return () => CometChat.removeCallListener("app");
51
+ }, []);
52
+ }
53
+ ```
54
+
55
+ Use a `navigationRef` (per `@react-navigation/native` docs) so listener callbacks can navigate without prop-drilling.
56
+
57
+ ---
58
+
59
+ ## Backgrounded ring delivery — VoIP push is the bridge
60
+
61
+ When the app is backgrounded or killed, `addCallListener` doesn't fire — the JS bundle isn't running. **VoIP push** wakes the app + surfaces the ring via CallKit (iOS) / ConnectionService (Android). On accept, route the user to the same screen the foreground listener would.
62
+
63
+ Wire VoIP push per `cometchat-native-calls/references/server-push-bridge.md`. Server fires push → CallKeep shows OS-level UI → user taps Accept → app launches/foregrounds → call session starts.
64
+
65
+ ---
66
+
67
+ ## Ringtone via expo-av or react-native-sound
68
+
69
+ ```tsx
70
+ import { Audio } from "expo-av"; // Expo
71
+ // OR: import Sound from "react-native-sound";
72
+
73
+ let ringtoneSound: Audio.Sound | null = null;
74
+
75
+ async function playRingtone() {
76
+ ringtoneSound = new Audio.Sound();
77
+ await ringtoneSound.loadAsync(require("../assets/ringtone.mp3"));
78
+ await ringtoneSound.setIsLoopingAsync(true);
79
+ await ringtoneSound.playAsync();
80
+ }
81
+
82
+ async function stopRingtone() {
83
+ await ringtoneSound?.stopAsync();
84
+ await ringtoneSound?.unloadAsync();
85
+ ringtoneSound = null;
86
+ }
87
+ ```
88
+
89
+ For backgrounded ring, **don't** play ringtone from JS — CallKit/ConnectionService plays the system ringtone. JS-side ringtone is for in-foreground ringing only.
90
+
91
+ ---
92
+
93
+ ## Anti-patterns
94
+
95
+ Web sister rules apply, plus RN-specific:
96
+
97
+ 1. **`addCallListener` inside a screen component.** Listener tears down on screen unmount → backgrounded calls miss.
98
+ 2. **Expecting `addCallListener` to fire when app is killed.** It doesn't — VoIP push is the only way. If you skipped VoIP push, your "background ring" doesn't work.
99
+ 3. **Playing JS ringtone during a CallKit/ConnectionService ring.** Two ringtones at once. Suppress JS-side when OS UI is active.
100
+
101
+ ---
102
+
103
+ ## Verification checklist
104
+
105
+ - [ ] Listener registered at NavigationContainer level
106
+ - [ ] navigationRef wired (forwards refs from listener callbacks)
107
+ - [ ] VoIP push registered for backgrounded ring delivery
108
+ - [ ] Ringtone plays in foreground only (suppressed when CallKit/ConnectionService active)
109
+ - [ ] Real-device smoke: 2 phones, foreground ring, backgrounded ring, killed-app ring all work
110
+
111
+ ---
112
+
113
+ ## Pointers
114
+
115
+ - `cometchat-react-calls/references/ringing-integration.md` — canonical (architecture + hard rules)
116
+ - `cometchat-native-calls/SKILL.md` — RN seven hard rules
117
+ - `cometchat-native-calls/references/server-push-bridge.md` — VoIP push for backgrounded ring
118
+ - Canonical docs: https://www.cometchat.com/docs/calls/react-native/ringing
@@ -0,0 +1,135 @@
1
+ # Server-side push routing for React Native (iOS PushKit + Android FCM)
2
+
3
+ React Native projects target iOS and Android — your server needs to dispatch the right kind of push to each platform. Use the iOS canonical (APNs PushKit + .p8) for iPhone tokens and the Android canonical (FCM HTTP v1 + service account) for Android tokens.
4
+
5
+ **Canonical docs:**
6
+ - iOS: `cometchat-ios-calls/references/server-apns-pushkit.md`
7
+ - Android: `cometchat-android-v5-calls/references/server-fcm-voip.md`
8
+
9
+ ---
10
+
11
+ ## Token registration (RN client)
12
+
13
+ ```tsx
14
+ // On app start, after CometChat login completes
15
+ import VoipPushNotification from "react-native-voip-push-notification";
16
+ import messaging from "@react-native-firebase/messaging";
17
+ import { Platform } from "react-native";
18
+
19
+ async function registerCallPushTokens(userUid: string) {
20
+ if (Platform.OS === "ios") {
21
+ VoipPushNotification.addEventListener("register", async (token) => {
22
+ await api.registerCallToken({
23
+ uid: userUid,
24
+ platform: "ios-voip",
25
+ token,
26
+ });
27
+ });
28
+ VoipPushNotification.addEventListener("notification", (payload) => {
29
+ // CallKeep takes over from here — see cometchat-native-calls/SKILL.md rule 4
30
+ });
31
+ VoipPushNotification.registerVoipToken();
32
+ } else if (Platform.OS === "android") {
33
+ await messaging().requestPermission();
34
+ const fcmToken = await messaging().getToken();
35
+ await api.registerCallToken({
36
+ uid: userUid,
37
+ platform: "android-fcm",
38
+ token: fcmToken,
39
+ });
40
+
41
+ messaging().onTokenRefresh(async (newToken) => {
42
+ await api.registerCallToken({
43
+ uid: userUid,
44
+ platform: "android-fcm",
45
+ token: newToken,
46
+ });
47
+ });
48
+ }
49
+ }
50
+ ```
51
+
52
+ ---
53
+
54
+ ## Server-side dispatcher
55
+
56
+ Single webhook handler routes by platform:
57
+
58
+ ```js
59
+ import { sendVoipPush as sendApns } from "./apns-pushkit.js"; // iOS canonical template
60
+ import { sendAndroidVoipPush } from "./fcm-voip.js"; // Android canonical template
61
+
62
+ app.post("/webhooks/call", verifyCometChatWebhook, async (req, res) => {
63
+ if (req.body.trigger !== "call_initiated") return res.status(200).end();
64
+
65
+ const { sessionId, type, initiator, receiver } = req.body.data;
66
+ const tokens = await db.getActiveCallTokens(receiver.uid); // returns [{platform, token}, ...]
67
+
68
+ // Fan out to all the user's devices in parallel
69
+ const sends = tokens.map((t) => {
70
+ const payload = {
71
+ recipientUid: receiver.uid,
72
+ sessionId,
73
+ callerName: initiator.name,
74
+ callerUid: initiator.uid,
75
+ callType: type,
76
+ };
77
+ if (t.platform === "ios-voip") return sendApns({ ...payload, pushKitToken: t.token });
78
+ if (t.platform === "android-fcm") return sendAndroidVoipPush({ ...payload, fcmToken: t.token });
79
+ return Promise.resolve();
80
+ });
81
+
82
+ await Promise.allSettled(sends);
83
+ res.status(200).end();
84
+ });
85
+ ```
86
+
87
+ ---
88
+
89
+ ## Schema for tokens
90
+
91
+ ```sql
92
+ CREATE TABLE call_push_tokens (
93
+ uid text NOT NULL,
94
+ platform text NOT NULL CHECK (platform IN ('ios-voip', 'android-fcm')),
95
+ token text NOT NULL,
96
+ device_id text,
97
+ registered_at timestamptz NOT NULL DEFAULT now(),
98
+ PRIMARY KEY (uid, platform, token)
99
+ );
100
+
101
+ CREATE INDEX idx_call_push_tokens_uid ON call_push_tokens(uid);
102
+ ```
103
+
104
+ Why include `device_id`: a user may have iPhone + iPad + Android tablet. Allow multiple tokens per (uid, platform).
105
+
106
+ ---
107
+
108
+ ## Anti-patterns
109
+
110
+ iOS + Android sister rules apply, plus RN-specific:
111
+
112
+ 1. **Single token table without `platform` column.** Can't tell which dispatcher to use → wrong push API → silent failure.
113
+ 2. **Registering FCM token before login.** No user UID, can't store correctly. Register tokens AFTER `CometChat.login` resolves.
114
+ 3. **Forgetting `messaging().onTokenRefresh`.** FCM tokens rotate every few months. Without refresh, push silently breaks.
115
+ 4. **Returning the Promise.allSettled to the webhook caller.** CometChat retries on slow/failed webhooks; awaiting all pushes can block 5+ seconds. Use a queue (BullMQ/SQS): enqueue job, return 200 immediately.
116
+
117
+ ---
118
+
119
+ ## Verification checklist
120
+
121
+ - [ ] iOS: VoipPushNotification configured + token registered post-login
122
+ - [ ] Android: messaging() permission requested + token registered + onTokenRefresh handler
123
+ - [ ] Server has both apns-pushkit + fcm-voip dispatchers wired
124
+ - [ ] Webhook returns 200 within 1s (push enqueued)
125
+ - [ ] Token table supports multiple devices per user
126
+ - [ ] Real-device smoke: iPhone + Android both ring when caller dials
127
+
128
+ ---
129
+
130
+ ## Pointers
131
+
132
+ - `cometchat-ios-calls/references/server-apns-pushkit.md` — iOS canonical
133
+ - `cometchat-android-v5-calls/references/server-fcm-voip.md` — Android canonical
134
+ - `cometchat-native-calls` SKILL.md — RN seven hard rules (CallKeep + VoipPush wiring)
135
+ - `cometchat-native-push/SKILL.md` — chat push (sister, different payload)