@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,339 @@
1
+ # Recording + screen-share on iOS
2
+
3
+ Recording is server-side (same as every family). Screen-share on iOS requires a **separate Xcode target** — the iOS Broadcast Upload Extension — because Apple sandboxes screen capture in a separate process. This is the most involved screen-share integration of any family.
4
+
5
+ For SDK semantics + browser-side details, read `cometchat-react-calls/references/recording-screen-share.md` first. This reference is the iOS-specific manual setup and bridge code.
6
+
7
+ ---
8
+
9
+ ## Recording
10
+
11
+ ### Server-side: dashboard gate
12
+
13
+ Same as web/RN — enable in **Dashboard → Chat & Messaging → Calls → Recording**. Client flag is no-op without it.
14
+
15
+ ### Client-side flag
16
+
17
+ ```swift
18
+ import CometChatCallsSDK
19
+
20
+ let settings = CallSettingsBuilder()
21
+ .setSessionType(.video)
22
+ .setIsAudioOnly(false)
23
+ .enableRecording(true) // server starts recording on session start
24
+ .setShowRecordingButton(true) // user-toggleable mid-call
25
+ .build()
26
+ ```
27
+
28
+ ### Lifecycle events (REC indicator)
29
+
30
+ ```swift
31
+ class CustomOngoingCallViewController: UIViewController {
32
+ @IBOutlet weak var recBadge: UIView!
33
+
34
+ func setupCallListener() {
35
+ let listener = CometChatCallsEventsListener()
36
+ listener.onRecordingStarted = { [weak self] in
37
+ DispatchQueue.main.async { self?.recBadge.isHidden = false }
38
+ }
39
+ listener.onRecordingStopped = { [weak self] in
40
+ DispatchQueue.main.async { self?.recBadge.isHidden = true }
41
+ }
42
+ listener.onRecordingFailed = { [weak self] error in
43
+ DispatchQueue.main.async {
44
+ let alert = UIAlertController(title: "Recording failed",
45
+ message: error.message,
46
+ preferredStyle: .alert)
47
+ alert.addAction(UIAlertAction(title: "OK", style: .default))
48
+ self?.present(alert, animated: true)
49
+ }
50
+ }
51
+ }
52
+ }
53
+ ```
54
+
55
+ The badge: a small "REC" pill with a blinking red dot. Must be visible to all participants — compliance requirement (CCPA, GDPR Art. 6/7, two-party-consent US states).
56
+
57
+ ```swift
58
+ final class RecBadgeView: UIView {
59
+ override init(frame: CGRect) {
60
+ super.init(frame: frame)
61
+ backgroundColor = UIColor(white: 0, alpha: 0.6)
62
+ layer.cornerRadius = 4
63
+
64
+ let dot = UILabel()
65
+ dot.text = "●"
66
+ dot.textColor = .systemRed
67
+ dot.font = .systemFont(ofSize: 12)
68
+ dot.translatesAutoresizingMaskIntoConstraints = false
69
+
70
+ let label = UILabel()
71
+ label.text = "REC"
72
+ label.textColor = .white
73
+ label.font = .systemFont(ofSize: 12, weight: .semibold)
74
+ label.translatesAutoresizingMaskIntoConstraints = false
75
+
76
+ addSubview(dot)
77
+ addSubview(label)
78
+ NSLayoutConstraint.activate([
79
+ dot.leadingAnchor.constraint(equalTo: leadingAnchor, constant: 6),
80
+ dot.centerYAnchor.constraint(equalTo: centerYAnchor),
81
+ label.leadingAnchor.constraint(equalTo: dot.trailingAnchor, constant: 4),
82
+ label.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -6),
83
+ label.centerYAnchor.constraint(equalTo: centerYAnchor),
84
+ ])
85
+
86
+ // Blink animation
87
+ UIView.animate(withDuration: 0.8, delay: 0, options: [.repeat, .autoreverse], animations: {
88
+ dot.alpha = 0.3
89
+ })
90
+ }
91
+ required init?(coder: NSCoder) { fatalError() }
92
+ }
93
+ ```
94
+
95
+ ### Recording retrieval
96
+
97
+ CometChat hosts the file. Same as web/RN — accessible via dashboard UI or REST API from your server. Never expose recording URLs to the iOS client.
98
+
99
+ ---
100
+
101
+ ## Screen sharing — iOS Calls SDK v5.x does NOT support INITIATING
102
+
103
+ **Audit finding 2026-05-14, confirmed against `https://www.cometchat.com/docs/calls/ios/screen-sharing.md`:** the iOS Calls SDK explicitly does not support initiating screen sharing. iOS callers can RECEIVE incoming screen shares from web/Android peers (via the `onParticipantStartedScreenShare` listener + `Call.isPresenting` property — see "Viewer" section below) but cannot SEND.
104
+
105
+ The symbols previously documented in this file (`CometChatCalls.startScreenShareBroadcast`, `processBroadcastVideoFrame`, `processBroadcastAudioFrame`, `endScreenShareBroadcast`) **do not exist** on `CometChatCallsSDK` v5.x. If you've copied these from an earlier draft of this doc, they will not compile against the actual SDK.
106
+
107
+ ### What works today
108
+
109
+ | Direction | Status | API |
110
+ |---|---|---|
111
+ | Receive screen share (iOS callee) | ✅ supported | `OngoingCallListener.onParticipantStartedScreenShare` + `Call.isPresenting` |
112
+ | Initiate screen share (iOS caller → others) | ❌ NOT supported by CometChatCallsSDK v5.x | n/a |
113
+
114
+ For applications that need iOS users to share their screen today, the practical options are:
115
+
116
+ 1. **Defer screen-share initiation to web/Android peers.** Document that iOS callers are receive-only for screen content.
117
+ 2. **Wait for vendor support.** Track the CometChat iOS Calls SDK release notes; this is a known gap.
118
+ 3. **Build your own WebRTC bridge** in a Broadcast Upload Extension and attach a manual video track to the underlying peer connection. The CometChat session is a WebRTC peer connection internally, but the SDK does not expose the peer-connection handle, so this requires forking/patching the SDK — not recommended.
119
+
120
+ ### Architecture pieces that remain valid (for future SDK support)
121
+
122
+ Steps 1–4 below (Broadcast Upload Extension target, App Groups capability, `RPBroadcastProcessModeSampleBuffer` Info.plist, `RPSystemBroadcastPickerView`) are all valid iOS-level setup that any future SDK adding sender-side screen-share would also require. Kept here for reference. **Skip Steps 5–6 (SampleHandler.swift + App-Group state pre-write) — they reference SDK symbols that do not exist.**
123
+
124
+ iOS sandboxes screen capture inside a separate process. To share (IF the SDK supported it), you would need:
125
+
126
+ 1. **A Broadcast Upload Extension target** in your Xcode project
127
+ 2. **An App Group capability** shared between the main app and the extension
128
+ 3. **An RPSystemBroadcastPickerView** (provided by ReplayKit) that lets the user start sharing
129
+ 4. **A WebRTC bridge in the extension** that pipes captured frames into the Calls SDK session
130
+
131
+ Apple doesn't allow main-app screen capture for privacy reasons; this Extension architecture is unavoidable.
132
+
133
+ ### Step 1 — Create the Broadcast Upload Extension
134
+
135
+ Xcode → File → New → Target → **Broadcast Upload Extension**.
136
+
137
+ - Product Name: `YourAppBroadcastExtension`
138
+ - Bundle Identifier: `com.yourcompany.YourApp.BroadcastExtension`
139
+ - Embed in Application: YourApp
140
+
141
+ Xcode generates a `SampleHandler.swift` with stub methods.
142
+
143
+ ### Step 2 — App Group
144
+
145
+ Both the main target AND the extension target need this capability.
146
+
147
+ Main app target → Signing & Capabilities → + Capability → **App Groups** → enable `group.com.yourcompany.yourapp.broadcast`.
148
+
149
+ Extension target → same capability, same group identifier.
150
+
151
+ ### Step 3 — Info.plist for the extension
152
+
153
+ The extension's `Info.plist` (auto-generated by Xcode) must have:
154
+
155
+ ```xml
156
+ <key>NSExtension</key>
157
+ <dict>
158
+ <key>NSExtensionPointIdentifier</key>
159
+ <string>com.apple.broadcast-services-upload</string>
160
+ <key>NSExtensionPrincipalClass</key>
161
+ <string>$(PRODUCT_MODULE_NAME).SampleHandler</string>
162
+ <key>RPBroadcastProcessMode</key>
163
+ <string>RPBroadcastProcessModeSampleBuffer</string>
164
+ </dict>
165
+ ```
166
+
167
+ `RPBroadcastProcessModeSampleBuffer` is critical — without it, the extension receives audio/video data in a different format that doesn't fit the Calls SDK's bridge.
168
+
169
+ ### Step 4 — RPSystemBroadcastPickerView in the call screen
170
+
171
+ ```swift
172
+ import ReplayKit
173
+
174
+ class CustomOngoingCallViewController: UIViewController {
175
+ private lazy var broadcastPicker: RPSystemBroadcastPickerView = {
176
+ let picker = RPSystemBroadcastPickerView(frame: CGRect(x: 0, y: 0, width: 50, height: 50))
177
+ picker.preferredExtension = "com.yourcompany.YourApp.BroadcastExtension"
178
+ picker.showsMicrophoneButton = false // SDK handles mic
179
+ return picker
180
+ }()
181
+
182
+ override func viewDidLoad() {
183
+ super.viewDidLoad()
184
+ // Find and customize the actual button inside the picker (Apple's API restriction)
185
+ if let button = broadcastPicker.subviews.compactMap({ $0 as? UIButton }).first {
186
+ button.setImage(UIImage(systemName: "rectangle.on.rectangle.angled"), for: .normal)
187
+ }
188
+ view.addSubview(broadcastPicker)
189
+ // Layout broadcastPicker as part of your control panel
190
+ }
191
+ }
192
+ ```
193
+
194
+ When the user taps the picker, iOS shows the system broadcast UI listing your extension. They tap it; the extension activates; capture begins.
195
+
196
+ ### Step 5 — SampleHandler.swift implementation (FICTIONAL — SDK doesn't support this)
197
+
198
+ > **⚠️ Audit 2026-05-14**: the symbols below (`CometChatCalls.startScreenShareBroadcast`, `processBroadcastVideoFrame`, `processBroadcastAudioFrame`, `endScreenShareBroadcast`) **do not exist on CometChatCallsSDK v5.x**. The vendor docs at `https://www.cometchat.com/docs/calls/ios/screen-sharing.md` state explicitly: *"The iOS Calls SDK does not support initiating screen sharing."* This code path will not compile. Kept here only to document what the architecture would look like if a future SDK version added support.
199
+
200
+ The extension entry point. Receives audio + video sample buffers from iOS:
201
+
202
+ ```swift
203
+ import ReplayKit
204
+ import CometChatCallsSDK
205
+
206
+ class SampleHandler: RPBroadcastSampleHandler {
207
+
208
+ override func broadcastStarted(withSetupInfo setupInfo: [String : NSObject]?) {
209
+ // Read the active session ID + auth token from the App Group
210
+ let groupId = "group.com.yourcompany.yourapp.broadcast"
211
+ let defaults = UserDefaults(suiteName: groupId)
212
+
213
+ guard let sessionId = defaults?.string(forKey: "cometchat.sessionId"),
214
+ let authToken = defaults?.string(forKey: "cometchat.authToken") else {
215
+ finishBroadcastWithError(NSError(domain: "CometChat", code: 1,
216
+ userInfo: [NSLocalizedDescriptionKey: "No active session"]))
217
+ return
218
+ }
219
+
220
+ // Initialize the Calls SDK in screen-share mode for this session
221
+ // (the SDK provides a setup helper; verify the exact symbol against installed CometChatCallsSDK)
222
+ CometChatCalls.startScreenShareBroadcast(sessionID: sessionId, authToken: authToken)
223
+ }
224
+
225
+ override func processSampleBuffer(_ sampleBuffer: CMSampleBuffer, with sampleBufferType: RPSampleBufferType) {
226
+ switch sampleBufferType {
227
+ case .video:
228
+ CometChatCalls.processBroadcastVideoFrame(sampleBuffer)
229
+ case .audioApp:
230
+ CometChatCalls.processBroadcastAudioFrame(sampleBuffer, type: .app)
231
+ case .audioMic:
232
+ CometChatCalls.processBroadcastAudioFrame(sampleBuffer, type: .mic)
233
+ @unknown default:
234
+ break
235
+ }
236
+ }
237
+
238
+ override func broadcastFinished() {
239
+ CometChatCalls.endScreenShareBroadcast()
240
+ }
241
+ }
242
+ ```
243
+
244
+ **Confirmed against the SDK docs 2026-05-14**: these symbols are NOT present in CometChatCallsSDK v5.x. The code above is illustrative only.
245
+
246
+ ### Step 6 — Main app: pre-write session state to App Group before starting (FICTIONAL — see audit note above)
247
+
248
+ In the main app's call code, before triggering the broadcast picker:
249
+
250
+ ```swift
251
+ func prepareScreenShare(sessionId: String, authToken: String) {
252
+ let groupId = "group.com.yourcompany.yourapp.broadcast"
253
+ let defaults = UserDefaults(suiteName: groupId)
254
+ defaults?.set(sessionId, forKey: "cometchat.sessionId")
255
+ defaults?.set(authToken, forKey: "cometchat.authToken")
256
+ defaults?.synchronize()
257
+ }
258
+ ```
259
+
260
+ Now when the user taps the picker, the extension can read this state on launch.
261
+
262
+ ---
263
+
264
+ ## Viewer — receiving someone else's screen share
265
+
266
+ Same pattern as RN/web. Listen for `onScreenShareStarted` and render the screen track in a dedicated view:
267
+
268
+ ```swift
269
+ listener.onScreenShareStarted = { [weak self] presenterUid in
270
+ DispatchQueue.main.async {
271
+ self?.showScreenShareView(presenterUid: presenterUid)
272
+ }
273
+ }
274
+
275
+ listener.onScreenShareEnded = { [weak self] in
276
+ DispatchQueue.main.async {
277
+ self?.hideScreenShareView()
278
+ }
279
+ }
280
+ ```
281
+
282
+ The screen-share track renders in the SDK's container; for custom UI, the SDK exposes the track via `MediaStream` events the same way regular video is delivered.
283
+
284
+ ---
285
+
286
+ ## Common failure modes
287
+
288
+ | Symptom | Cause | Fix |
289
+ |---|---|---|
290
+ | Picker doesn't show your extension | Bundle ID mismatch in `preferredExtension` | Match the extension target's Bundle ID exactly |
291
+ | "No active session" finishBroadcastWithError | App Group identifier mismatch | Both targets must use the same `group.*` identifier |
292
+ | Extension launches but no video on remote side | Missing `RPBroadcastProcessModeSampleBuffer` in extension Info.plist | Add it |
293
+ | Recording flag set but no recording in dashboard | Plan doesn't include recording, or dashboard toggle off | Enable in dashboard |
294
+ | REC badge missing | Custom UI — must render manually | Subscribe to `onRecordingStarted/Stopped` and render badge |
295
+ | Screen share doesn't end on call hangup | `broadcastFinished` not triggering | Manually call `RPBroadcastController.shared.finishBroadcast(...)` from main app on hangup |
296
+
297
+ ---
298
+
299
+ ## Anti-patterns
300
+
301
+ 1. **Embedding screen-share logic in the main app target.** iOS doesn't allow it — must be a separate extension.
302
+ 2. **App Groups with mismatched identifiers.** Extension can't see main app state; broadcast finishes immediately.
303
+ 3. **`RPSystemBroadcastPickerView` with hidden button via removeFromSuperview.** Apple may reject the build for App Store. Customize via subview iteration only.
304
+ 4. **No REC indicator.** Compliance violation in two-party-consent jurisdictions.
305
+ 5. **Trying to access recording files from the device.** They're not local — server-only access via REST API.
306
+ 6. **Implementing the SampleHandler.broadcastStarted/processSampleBuffer/broadcastFinished pipeline against CometChatCallsSDK v5.x.** Per the audit above, the SDK does not expose `startScreenShareBroadcast`, `processBroadcastVideoFrame`, `processBroadcastAudioFrame`, or `endScreenShareBroadcast`. Steps 5–6 of this doc are kept for reference but will not compile against the actual SDK today.
307
+
308
+ ---
309
+
310
+ ## Verification checklist
311
+
312
+ **Recording:**
313
+ - [ ] Dashboard plan includes recording feature
314
+ - [ ] `enableRecording(true)` on `CallSettingsBuilder`
315
+ - [ ] `onRecordingStarted` / `onRecordingStopped` listeners wired
316
+ - [ ] REC badge visible to all participants when active
317
+ - [ ] `onRecordingFailed` surfaces user-facing alert
318
+
319
+ **Screen share — receiver side only (iOS Calls SDK v5.x cannot INITIATE):**
320
+ - [ ] `OngoingCallListener.onParticipantStartedScreenShare` wired
321
+ - [ ] `OngoingCallListener.onParticipantEndedScreenShare` wired
322
+ - [ ] UI surfaces incoming-share state to the user (e.g. tile resize, presenter badge)
323
+ - [ ] `Call.isPresenting` read where needed to gate UI affordances
324
+ - [ ] Sender-side screen-share architecture (Broadcast Extension, SampleHandler) NOT implemented against current SDK — the symbols don't exist (per audit 2026-05-14)
325
+
326
+ **Real-device smoke:**
327
+ - [ ] Tap broadcast picker → consent dialog → screen share begins
328
+ - [ ] Other participants see the shared screen
329
+ - [ ] End screen share via system overlay → returns to camera view
330
+ - [ ] Hangup ends broadcast even if user didn't manually stop sharing
331
+
332
+ ---
333
+
334
+ ## Pointers
335
+
336
+ - `cometchat-react-calls/references/recording-screen-share.md` — sister reference (SDK semantics, browser semantics, server-side recording retrieval)
337
+ - `cometchat-native-calls/references/recording-screen-share.md` — RN reference (same Broadcast Upload Extension pattern; this iOS version is more detailed)
338
+ - `references/group-calls.md` — recording group calls (server composition handles layout)
339
+ - `cometchat-ios-calls` SKILL.md — base hard rules
@@ -0,0 +1,142 @@
1
+ # Ringing — call signaling with custom UI (iOS)
2
+
3
+ iOS-specific deltas: PushKit + CallKit are mandatory for backgrounded ring delivery; foreground ringing uses CometChatCallsEventsListener; AVAudioSession routing.
4
+
5
+ **Read first:** `cometchat-react-calls/references/ringing-integration.md` — full architecture, hard rules.
6
+
7
+ ---
8
+
9
+ ## SDK API
10
+
11
+ ```swift
12
+ import CometChatSDK
13
+ import CometChatCallsSDK
14
+
15
+ let call = Call(receiverUid: receiverUid, callType: .video, receiverType: .user)
16
+ CometChat.initiateCall(call: call) { result in
17
+ switch result {
18
+ case .success(let outgoing): self.showOutgoingCallScreen(outgoing)
19
+ case .onError(let err): print("Initiate failed:", err)
20
+ }
21
+ }
22
+ ```
23
+
24
+ ---
25
+
26
+ ## Foreground listener
27
+
28
+ Implement `CometChatCallsEventsListener` and register at app start:
29
+
30
+ ```swift
31
+ class AppCallListener: CometChatCallsEventsListener {
32
+ func onIncomingCallReceived(call: Call) {
33
+ DispatchQueue.main.async { showIncomingCallScreen(call) }
34
+ }
35
+ func onOutgoingCallAccepted(call: Call) {
36
+ DispatchQueue.main.async { startCallSession(sessionId: call.sessionId) }
37
+ }
38
+ func onIncomingCallCancelled(call: Call) {
39
+ DispatchQueue.main.async { dismissIncomingCallScreen() }
40
+ }
41
+ func onOutgoingCallRejected(call: Call) {
42
+ DispatchQueue.main.async { dismissOutgoingCallScreen() }
43
+ }
44
+ func onCallEndedMessageReceived(call: Call) {
45
+ DispatchQueue.main.async { teardownCallUI() }
46
+ }
47
+ }
48
+
49
+ CometChat.addCallListener(id: "app", listener: AppCallListener())
50
+ ```
51
+
52
+ Add this in `AppDelegate.didFinishLaunchingWithOptions` AFTER `CometChat.init` succeeds.
53
+
54
+ ---
55
+
56
+ ## Backgrounded ring — PushKit + CallKit (mandatory)
57
+
58
+ iOS requires PushKit + CallKit for ring delivery when the app is backgrounded or killed. The foreground listener does NOT fire in those states. See `cometchat-ios-calls/references/server-apns-pushkit.md` for the server template.
59
+
60
+ PushKit delegate flow:
61
+ 1. `pushRegistry(_:didReceiveIncomingPushWith:for:completion:)` fires
62
+ 2. Within ~5s, call `CXProvider.reportNewIncomingCall(with:update:)` — Apple revokes VoIP entitlement after 3 missed reports
63
+ 3. CallKit shows the system incoming-call UI
64
+ 4. User taps Accept → `provider(_:perform:CXAnswerCallAction)` fires → start CometChat session
65
+
66
+ ---
67
+
68
+ ## SwiftUI incoming-call screen
69
+
70
+ ```swift
71
+ struct IncomingCallScreen: View {
72
+ let call: Call
73
+ let onAccept: () -> Void
74
+ let onReject: () -> Void
75
+
76
+ var body: some View {
77
+ ZStack {
78
+ Color.black.opacity(0.85).ignoresSafeArea()
79
+ VStack(spacing: 24) {
80
+ AsyncImage(url: URL(string: call.callInitiator?.avatar ?? ""))
81
+ .frame(width: 120, height: 120)
82
+ .clipShape(Circle())
83
+ Text(call.callInitiator?.name ?? "Unknown")
84
+ .font(.title)
85
+ Text("Incoming \(call.type.rawValue) call")
86
+ .foregroundStyle(.secondary)
87
+ HStack(spacing: 32) {
88
+ Button(action: onReject) {
89
+ Image(systemName: "phone.down.fill")
90
+ .padding(20)
91
+ .background(Color.red, in: Circle())
92
+ .foregroundStyle(.white)
93
+ }
94
+ .accessibilityLabel("Decline call")
95
+ Button(action: onAccept) {
96
+ Image(systemName: "phone.fill")
97
+ .padding(20)
98
+ .background(Color.green, in: Circle())
99
+ .foregroundStyle(.white)
100
+ }
101
+ .accessibilityLabel("Accept call")
102
+ }
103
+ }
104
+ .foregroundStyle(.white)
105
+ }
106
+ }
107
+ }
108
+ ```
109
+
110
+ For backgrounded ring, CallKit's UI takes over — your SwiftUI screen only fires for foreground rings.
111
+
112
+ ---
113
+
114
+ ## Anti-patterns
115
+
116
+ Web sister rules apply, plus iOS-specific:
117
+
118
+ 1. **Listener registered before `CometChat.init`.** Crash. Always register after init's success block.
119
+ 2. **Skipping PushKit + CallKit.** Backgrounded calls don't ring. Apple may also revoke VoIP entitlement if you ship with `pushType: .voIP` registered but no CallKit reporting.
120
+ 3. **Updating UI from listener callback's thread.** SDK fires off main; always `DispatchQueue.main.async` for UI updates.
121
+ 4. **Playing AVAudioPlayer ringtone during CallKit ring.** CallKit plays system ringtone; double-up is jarring.
122
+
123
+ ---
124
+
125
+ ## Verification checklist
126
+
127
+ - [ ] Foreground listener registered after `CometChat.init` resolves
128
+ - [ ] PushKit registry initialized + .p8 key configured
129
+ - [ ] CallKit `CXProvider.reportNewIncomingCall` fires within 5s of push
130
+ - [ ] All listener callbacks dispatch to main queue
131
+ - [ ] `removeCallListener` in app teardown
132
+ - [ ] Real-device smoke: foreground ring, backgrounded ring (push), killed-app ring (push) all surface UI
133
+
134
+ ---
135
+
136
+ ## Pointers
137
+
138
+ - `cometchat-react-calls/references/ringing-integration.md` — canonical
139
+ - `cometchat-ios-calls/SKILL.md` — seven hard rules
140
+ - `cometchat-ios-calls/references/server-apns-pushkit.md` — PushKit server-side
141
+ - `cometchat-ios-calls/references/callkit-and-pushkit.md` — CallKit details
142
+ - Canonical docs: https://www.cometchat.com/docs/calls/ios/ringing