@cometchat/skills 4.4.2 → 5.0.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 (490) hide show
  1. package/.claude-plugin/marketplace.json +55 -0
  2. package/.claude-plugin/plugin.json +14 -0
  3. package/CHANGELOG.md +36 -0
  4. package/LICENSE +21 -0
  5. package/README.md +41 -163
  6. package/RULES.md +114 -0
  7. package/bin/cometchat-skills.mjs +1180 -0
  8. package/bin/legacy-skills.json +95 -0
  9. package/catalogs/android-v6.json +1646 -0
  10. package/catalogs/flutter-v6.json +651 -0
  11. package/catalogs/ios-v5.json +1383 -0
  12. package/catalogs/rn-calls-v5.json +134 -0
  13. package/catalogs/rn-calls-v5.symbols.txt +58 -0
  14. package/catalogs/rn-sdk-v4.json +672 -0
  15. package/catalogs/rn-v5.json +449 -0
  16. package/catalogs/rn-v5.symbols.txt +216 -0
  17. package/catalogs/sdk-android-v5.json +514 -0
  18. package/contracts.android-calls-v5.json +122 -0
  19. package/contracts.android-v6.json +135 -0
  20. package/contracts.angular-v5.json +694 -0
  21. package/contracts.flutter-calls-v5.json +77 -0
  22. package/contracts.flutter-v6.json +126 -0
  23. package/contracts.ios-calls-v5.json +67 -0
  24. package/contracts.ios-v5.json +436 -0
  25. package/contracts.json +82 -0
  26. package/contracts.rn-calls-v5.json +77 -0
  27. package/contracts.rn-v5.json +727 -0
  28. package/contracts.sdk-android-v5.json +15 -0
  29. package/contracts.web-calls-v5.json +45 -0
  30. package/features.android-calls-v5.json +246 -0
  31. package/features.android-v6.json +65 -0
  32. package/features.angular-v5.json +521 -0
  33. package/features.flutter-calls-v5.json +286 -0
  34. package/features.flutter-v6.json +484 -0
  35. package/features.ios-calls-v5.json +236 -0
  36. package/features.ios-v5.json +573 -0
  37. package/features.json +61 -0
  38. package/features.rn-calls-v5.json +187 -0
  39. package/features.rn-v5.json +614 -0
  40. package/features.sdk-android-v5.json +40 -0
  41. package/features.sdk-jsv4.json +24 -0
  42. package/features.web-calls-v5.json +108 -0
  43. package/package.json +151 -74
  44. package/peers.yaml +312 -0
  45. package/registry/README.md +31 -0
  46. package/registry/android-calls-v5.json +54 -0
  47. package/registry/android-v6.json +137 -0
  48. package/registry/angular-v5.json +114 -0
  49. package/registry/flutter-calls-v5.json +54 -0
  50. package/registry/flutter-v6.json +119 -0
  51. package/registry/ios-calls-v5.json +59 -0
  52. package/registry/ios-v5.json +97 -0
  53. package/registry/rn-calls-v5.json +59 -0
  54. package/registry/rn-v5.json +129 -0
  55. package/registry/sdk-android-v5.json +53 -0
  56. package/registry/sdk-jsv4.json +53 -0
  57. package/registry/web-calls-v5.json +54 -0
  58. package/registry/web-v7.json +99 -0
  59. package/skills/cometchat/SKILL.md +42 -2096
  60. package/skills/cometchat-android-v5-calls-sdk/SKILL.md +206 -0
  61. package/skills/cometchat-android-v5-calls-sdk/references/build-truth.md +63 -0
  62. package/skills/cometchat-android-v5-calls-sdk/references/docs-map.md +119 -0
  63. package/skills/cometchat-android-v5-calls-sdk/references/method-map.md +53 -0
  64. package/skills/cometchat-android-v5-calls-sdk/references/pitfalls.md +72 -0
  65. package/skills/cometchat-android-v5-calls-sdk/references/ringing.md +92 -0
  66. package/skills/cometchat-android-v5-calls-sdk/references/user-switch.md +90 -0
  67. package/skills/cometchat-android-v5-sdk/SKILL.md +127 -0
  68. package/skills/cometchat-android-v5-sdk/references/app-surface.md +88 -0
  69. package/skills/cometchat-android-v5-sdk/references/docs-map.md +91 -0
  70. package/skills/cometchat-android-v6-builder-settings/SKILL.md +51 -137
  71. package/skills/cometchat-android-v6-calls/SKILL.md +128 -413
  72. package/skills/cometchat-android-v6-compose-components/SKILL.md +84 -194
  73. package/skills/cometchat-android-v6-compose-customization/SKILL.md +66 -411
  74. package/skills/cometchat-android-v6-compose-placement/SKILL.md +154 -237
  75. package/skills/cometchat-android-v6-core/SKILL.md +236 -672
  76. package/skills/cometchat-android-v6-core/references/anti-patterns.md +31 -0
  77. package/skills/cometchat-android-v6-core/references/component-props.md +168 -0
  78. package/skills/cometchat-android-v6-core/references/docs-map.md +153 -0
  79. package/skills/cometchat-android-v6-core/references/layout.md +112 -0
  80. package/skills/cometchat-android-v6-core/references/lifecycle.md +75 -0
  81. package/skills/cometchat-android-v6-core/references/setup-credentials.md +105 -0
  82. package/skills/cometchat-android-v6-core/references/troubleshooting.md +36 -0
  83. package/skills/cometchat-android-v6-events/SKILL.md +46 -184
  84. package/skills/cometchat-android-v6-extensions/SKILL.md +39 -179
  85. package/skills/cometchat-android-v6-features/SKILL.md +74 -143
  86. package/skills/cometchat-android-v6-kotlin-components/SKILL.md +75 -193
  87. package/skills/cometchat-android-v6-kotlin-customization/SKILL.md +67 -419
  88. package/skills/cometchat-android-v6-kotlin-placement/SKILL.md +77 -223
  89. package/skills/cometchat-android-v6-migration/SKILL.md +67 -378
  90. package/skills/cometchat-android-v6-production/SKILL.md +40 -179
  91. package/skills/cometchat-android-v6-push/SKILL.md +39 -289
  92. package/skills/cometchat-android-v6-testing/SKILL.md +50 -265
  93. package/skills/cometchat-android-v6-troubleshooting/SKILL.md +70 -254
  94. package/skills/cometchat-angular-v5-calls/SKILL.md +193 -0
  95. package/skills/cometchat-angular-v5-components/SKILL.md +131 -0
  96. package/skills/cometchat-angular-v5-components/references/catalog.md +111 -0
  97. package/skills/cometchat-angular-v5-components/references/host-composed.md +46 -0
  98. package/skills/cometchat-angular-v5-core/SKILL.md +300 -0
  99. package/skills/cometchat-angular-v5-core/references/anti-patterns.md +49 -0
  100. package/skills/cometchat-angular-v5-core/references/component-props.md +55 -0
  101. package/skills/cometchat-angular-v5-core/references/dependencies.md +66 -0
  102. package/skills/cometchat-angular-v5-core/references/docs-map.md +132 -0
  103. package/skills/cometchat-angular-v5-core/references/layout.md +64 -0
  104. package/skills/cometchat-angular-v5-core/references/lifecycle.md +202 -0
  105. package/skills/cometchat-angular-v5-core/references/setup-credentials.md +137 -0
  106. package/skills/cometchat-angular-v5-core/references/theming.md +70 -0
  107. package/skills/cometchat-angular-v5-core/references/troubleshooting.md +27 -0
  108. package/skills/cometchat-angular-v5-customization/SKILL.md +94 -0
  109. package/skills/cometchat-angular-v5-features/SKILL.md +107 -0
  110. package/skills/cometchat-angular-v5-features/references/custom-messages.md +133 -0
  111. package/skills/cometchat-angular-v5-features/references/formatters.md +28 -0
  112. package/skills/cometchat-angular-v5-features/references/host-composed-extensions.md +85 -0
  113. package/skills/cometchat-angular-v5-migration/SKILL.md +40 -0
  114. package/skills/cometchat-angular-v5-migration/references/migration-guide.md +165 -0
  115. package/skills/cometchat-angular-v5-patterns/SKILL.md +107 -0
  116. package/skills/cometchat-angular-v5-placement/SKILL.md +133 -0
  117. package/skills/cometchat-angular-v5-placement/references/combined-app.md +174 -0
  118. package/skills/cometchat-angular-v5-placement/references/core-surface.md +199 -0
  119. package/skills/cometchat-angular-v5-production/SKILL.md +101 -0
  120. package/skills/cometchat-angular-v5-push/SKILL.md +61 -0
  121. package/skills/cometchat-angular-v5-testing/SKILL.md +112 -0
  122. package/skills/cometchat-angular-v5-troubleshooting/SKILL.md +96 -0
  123. package/skills/cometchat-flutter-v5-sdk/SKILL.md +188 -0
  124. package/skills/cometchat-flutter-v5-sdk/references/doc-corrections.md +55 -0
  125. package/skills/cometchat-flutter-v5-sdk/references/docs-map.md +211 -0
  126. package/skills/cometchat-flutter-v5-sdk/references/platform-notes.md +48 -0
  127. package/skills/cometchat-flutter-v5-sdk/references/transcription.md +87 -0
  128. package/skills/cometchat-flutter-v6-calls/SKILL.md +75 -389
  129. package/skills/cometchat-flutter-v6-components/SKILL.md +88 -361
  130. package/skills/cometchat-flutter-v6-core/SKILL.md +154 -593
  131. package/skills/cometchat-flutter-v6-core/references/anti-patterns.md +55 -0
  132. package/skills/cometchat-flutter-v6-core/references/docs-map.md +143 -0
  133. package/skills/cometchat-flutter-v6-core/references/layout.md +45 -0
  134. package/skills/cometchat-flutter-v6-core/references/lifecycle.md +87 -0
  135. package/skills/cometchat-flutter-v6-core/references/setup-credentials.md +84 -0
  136. package/skills/cometchat-flutter-v6-core/references/troubleshooting.md +26 -0
  137. package/skills/cometchat-flutter-v6-customization/SKILL.md +70 -712
  138. package/skills/cometchat-flutter-v6-events/SKILL.md +79 -174
  139. package/skills/cometchat-flutter-v6-features/SKILL.md +55 -394
  140. package/skills/cometchat-flutter-v6-migration/SKILL.md +68 -367
  141. package/skills/cometchat-flutter-v6-migration/references/migration-guide.md +131 -0
  142. package/skills/cometchat-flutter-v6-patterns/SKILL.md +61 -0
  143. package/skills/cometchat-flutter-v6-placement/SKILL.md +94 -381
  144. package/skills/cometchat-flutter-v6-production/SKILL.md +58 -615
  145. package/skills/cometchat-flutter-v6-push/SKILL.md +46 -455
  146. package/skills/cometchat-flutter-v6-testing/SKILL.md +68 -299
  147. package/skills/cometchat-flutter-v6-troubleshooting/SKILL.md +54 -878
  148. package/skills/cometchat-ios-calls/SKILL.md +112 -563
  149. package/skills/cometchat-ios-components/SKILL.md +44 -834
  150. package/skills/cometchat-ios-core/SKILL.md +181 -1068
  151. package/skills/cometchat-ios-core/references/anti-patterns.md +80 -0
  152. package/skills/cometchat-ios-core/references/docs-map.md +123 -0
  153. package/skills/cometchat-ios-core/references/install.md +23 -0
  154. package/skills/cometchat-ios-core/references/layout.md +186 -0
  155. package/skills/cometchat-ios-core/references/setup-credentials.md +197 -0
  156. package/skills/cometchat-ios-core/references/swiftui.md +91 -0
  157. package/skills/cometchat-ios-core/references/troubleshooting.md +100 -0
  158. package/skills/cometchat-ios-customization/SKILL.md +33 -968
  159. package/skills/cometchat-ios-features/SKILL.md +29 -738
  160. package/skills/cometchat-ios-migration/SKILL.md +39 -0
  161. package/skills/cometchat-ios-placement/SKILL.md +51 -729
  162. package/skills/cometchat-ios-push/SKILL.md +24 -602
  163. package/skills/cometchat-ios-v5-sdk/SKILL.md +161 -0
  164. package/skills/cometchat-ios-v5-sdk/references/docs-map.md +326 -0
  165. package/skills/cometchat-js-v5-sdk/SKILL.md +95 -0
  166. package/skills/cometchat-js-v5-sdk/references/docs-map.md +114 -0
  167. package/skills/cometchat-onboarding/SKILL.md +89 -0
  168. package/skills/cometchat-onboarding/references/archetypes.md +51 -0
  169. package/skills/cometchat-onboarding/references/calling-first.md +77 -0
  170. package/skills/cometchat-onboarding/references/not-in-this-pack.md +8 -0
  171. package/skills/cometchat-onboarding/references/plan-artifact.md +133 -0
  172. package/skills/cometchat-onboarding/references/platforms.md +90 -0
  173. package/skills/cometchat-react-native-bare-patterns/SKILL.md +120 -0
  174. package/skills/cometchat-react-native-calls/SKILL.md +200 -0
  175. package/skills/cometchat-react-native-components/SKILL.md +142 -0
  176. package/skills/cometchat-react-native-core/SKILL.md +313 -0
  177. package/skills/cometchat-react-native-core/references/anti-patterns.md +79 -0
  178. package/skills/cometchat-react-native-core/references/component-props.md +105 -0
  179. package/skills/cometchat-react-native-core/references/dependencies.md +62 -0
  180. package/skills/cometchat-react-native-core/references/docs-map.md +126 -0
  181. package/skills/cometchat-react-native-core/references/layout.md +61 -0
  182. package/skills/cometchat-react-native-core/references/lifecycle.md +64 -0
  183. package/skills/cometchat-react-native-core/references/setup-credentials.md +39 -0
  184. package/skills/cometchat-react-native-customization/SKILL.md +198 -0
  185. package/skills/cometchat-react-native-expo-patterns/SKILL.md +116 -0
  186. package/skills/cometchat-react-native-features/SKILL.md +122 -0
  187. package/skills/cometchat-react-native-migration/SKILL.md +103 -0
  188. package/skills/cometchat-react-native-placement/SKILL.md +158 -0
  189. package/skills/cometchat-react-native-production/SKILL.md +78 -0
  190. package/skills/cometchat-react-native-push/SKILL.md +88 -0
  191. package/skills/cometchat-react-native-sdk/SKILL.md +126 -0
  192. package/skills/cometchat-react-native-sdk/references/method-map.md +239 -0
  193. package/skills/cometchat-react-native-sdk/references/page-map.md +96 -0
  194. package/skills/cometchat-react-native-testing/SKILL.md +94 -0
  195. package/skills/cometchat-react-native-troubleshooting/SKILL.md +116 -0
  196. package/skills/cometchat-react-native-v5-sdk/SKILL.md +150 -0
  197. package/skills/cometchat-react-native-v5-sdk/references/docs-map.md +127 -0
  198. package/skills/cometchat-react-native-v5-sdk/references/ringing-voip.md +369 -0
  199. package/skills/cometchat-react-v7-calls/SKILL.md +75 -0
  200. package/skills/cometchat-react-v7-components/SKILL.md +72 -0
  201. package/skills/cometchat-react-v7-core/SKILL.md +101 -0
  202. package/skills/cometchat-react-v7-core/references/anti-patterns.md +19 -0
  203. package/skills/cometchat-react-v7-core/references/component-props.md +82 -0
  204. package/skills/cometchat-react-v7-core/references/dependencies.md +23 -0
  205. package/skills/cometchat-react-v7-core/references/docs-map.md +117 -0
  206. package/skills/cometchat-react-v7-core/references/i18n-rtl-a11y.md +22 -0
  207. package/skills/cometchat-react-v7-core/references/layout.md +158 -0
  208. package/skills/cometchat-react-v7-core/references/lifecycle.md +74 -0
  209. package/skills/cometchat-react-v7-core/references/setup-credentials.md +58 -0
  210. package/skills/cometchat-react-v7-core/references/ssr.md +11 -0
  211. package/skills/cometchat-react-v7-core/references/theming.md +52 -0
  212. package/skills/cometchat-react-v7-core/references/troubleshooting.md +28 -0
  213. package/skills/cometchat-react-v7-customization/SKILL.md +84 -0
  214. package/skills/cometchat-react-v7-features/SKILL.md +92 -0
  215. package/skills/cometchat-react-v7-migration/SKILL.md +39 -0
  216. package/skills/cometchat-react-v7-migration/references/migration-guide.md +119 -0
  217. package/skills/cometchat-react-v7-patterns/SKILL.md +43 -0
  218. package/skills/cometchat-react-v7-placement/SKILL.md +106 -0
  219. package/skills/cometchat-react-v7-placement/references/recipes.md +354 -0
  220. package/skills/cometchat-react-v7-push/SKILL.md +53 -0
  221. package/test-suite/README.md +70 -0
  222. package/test-suite/catalogs/android-calls-v5.json +830 -0
  223. package/test-suite/catalogs/android-calls-v5.symbols.txt +499 -0
  224. package/test-suite/catalogs/android-v6.json +1646 -0
  225. package/test-suite/catalogs/android-v6.symbols.txt +298 -0
  226. package/test-suite/catalogs/angular-v5.json +7587 -0
  227. package/test-suite/catalogs/flutter-calls-v5.json +196 -0
  228. package/test-suite/catalogs/flutter-calls-v5.symbols.txt +59 -0
  229. package/test-suite/catalogs/flutter-v6.json +651 -0
  230. package/test-suite/catalogs/ios-calls-v5.json +158 -0
  231. package/test-suite/catalogs/ios-calls-v5.symbols.txt +70 -0
  232. package/test-suite/catalogs/ios-v5.json +1383 -0
  233. package/test-suite/catalogs/ios-v5.symbols.txt +699 -0
  234. package/test-suite/catalogs/rn-calls-v5.json +134 -0
  235. package/test-suite/catalogs/rn-sdk-v4.json +672 -0
  236. package/test-suite/catalogs/rn-v5.json +449 -0
  237. package/test-suite/catalogs/sdk-android-v5.json +514 -0
  238. package/test-suite/catalogs/sdk-android-v5.symbols.txt +254 -0
  239. package/test-suite/catalogs/sdk-jsv4.json +800 -0
  240. package/test-suite/catalogs/web-calls-v5.json +195 -0
  241. package/test-suite/catalogs/web-v7.json +1243 -0
  242. package/test-suite/scripts/build-registry.mjs +113 -0
  243. package/test-suite/scripts/catalog-refresh-dart.mjs +151 -0
  244. package/test-suite/scripts/catalog-refresh.mjs +100 -0
  245. package/test-suite/scripts/lint-skills.mjs +909 -0
  246. package/test-suite/scripts/measure-tokens.mjs +169 -0
  247. package/test-suite/scripts/typecheck-fences-dart.mjs +437 -0
  248. package/test-suite/scripts/typecheck-fences-kotlin.mjs +269 -0
  249. package/test-suite/scripts/typecheck-fences.mjs +206 -0
  250. package/test-suite/scripts/verify-catalog.mjs +242 -0
  251. package/test-suite/scripts/verify-contract-fences.mjs +94 -0
  252. package/test-suite/scripts/verify-detection.mjs +178 -0
  253. package/test-suite/scripts/verify-docs-base.mjs +91 -0
  254. package/test-suite/scripts/verify-family-agnostic.mjs +130 -0
  255. package/test-suite/scripts/verify-golden-path.mjs +138 -0
  256. package/test-suite/scripts/verify-oracle-components.mjs +133 -0
  257. package/test-suite/scripts/verify-template-bindings.mjs +148 -0
  258. package/test-suite/typecheck/angular-v5/package.json +21 -0
  259. package/test-suite/typecheck/angular-v5/tsconfig.json +21 -0
  260. package/test-suite/typecheck/flutter-v6/analysis_options.yaml +25 -0
  261. package/test-suite/typecheck/flutter-v6/pubspec.yaml +21 -0
  262. package/test-suite/typecheck/web-v7/package.json +18 -0
  263. package/test-suite/typecheck/web-v7/tsconfig.json +19 -0
  264. package/bin/install.js +0 -1003
  265. package/skills/.claude-plugin/marketplace.json +0 -86
  266. package/skills/cometchat/references/asking-questions.md +0 -48
  267. package/skills/cometchat-a11y/SKILL.md +0 -477
  268. package/skills/cometchat-android-v5/SKILL.md +0 -121
  269. package/skills/cometchat-android-v5-calls/SKILL.md +0 -429
  270. package/skills/cometchat-android-v5-calls/references/README.md +0 -53
  271. package/skills/cometchat-android-v5-calls/references/add-calls-to-existing-chat.md +0 -197
  272. package/skills/cometchat-android-v5-calls/references/audio-controls.md +0 -91
  273. package/skills/cometchat-android-v5-calls/references/background-handling.md +0 -168
  274. package/skills/cometchat-android-v5-calls/references/call-layouts.md +0 -131
  275. package/skills/cometchat-android-v5-calls/references/call-logs.md +0 -113
  276. package/skills/cometchat-android-v5-calls/references/call-session.md +0 -274
  277. package/skills/cometchat-android-v5-calls/references/custom-ui.md +0 -150
  278. package/skills/cometchat-android-v5-calls/references/event-listeners.md +0 -123
  279. package/skills/cometchat-android-v5-calls/references/group-calls.md +0 -205
  280. package/skills/cometchat-android-v5-calls/references/idle-timeout.md +0 -117
  281. package/skills/cometchat-android-v5-calls/references/in-call-chat.md +0 -134
  282. package/skills/cometchat-android-v5-calls/references/join-session.md +0 -120
  283. package/skills/cometchat-android-v5-calls/references/migration-v4-to-v5.md +0 -222
  284. package/skills/cometchat-android-v5-calls/references/participant-management.md +0 -110
  285. package/skills/cometchat-android-v5-calls/references/picture-in-picture.md +0 -106
  286. package/skills/cometchat-android-v5-calls/references/raise-hand.md +0 -248
  287. package/skills/cometchat-android-v5-calls/references/recording.md +0 -101
  288. package/skills/cometchat-android-v5-calls/references/ringing-integration.md +0 -152
  289. package/skills/cometchat-android-v5-calls/references/screen-sharing.md +0 -78
  290. package/skills/cometchat-android-v5-calls/references/server-fcm-voip.md +0 -215
  291. package/skills/cometchat-android-v5-calls/references/session-settings.md +0 -121
  292. package/skills/cometchat-android-v5-calls/references/setup.md +0 -137
  293. package/skills/cometchat-android-v5-calls/references/share-invite.md +0 -156
  294. package/skills/cometchat-android-v5-calls/references/video-controls.md +0 -87
  295. package/skills/cometchat-android-v5-calls/references/voip-calling.md +0 -526
  296. package/skills/cometchat-android-v5-components/SKILL.md +0 -431
  297. package/skills/cometchat-android-v5-core/SKILL.md +0 -486
  298. package/skills/cometchat-android-v5-customization/SKILL.md +0 -469
  299. package/skills/cometchat-android-v5-extensions/SKILL.md +0 -127
  300. package/skills/cometchat-android-v5-features/SKILL.md +0 -131
  301. package/skills/cometchat-android-v5-placement/SKILL.md +0 -277
  302. package/skills/cometchat-android-v5-production/SKILL.md +0 -95
  303. package/skills/cometchat-android-v5-push/SKILL.md +0 -619
  304. package/skills/cometchat-android-v5-testing/SKILL.md +0 -188
  305. package/skills/cometchat-android-v5-theming/SKILL.md +0 -167
  306. package/skills/cometchat-android-v5-troubleshooting/SKILL.md +0 -74
  307. package/skills/cometchat-android-v6/SKILL.md +0 -108
  308. package/skills/cometchat-android-v6-calls/references/add-calls-to-existing-chat.md +0 -97
  309. package/skills/cometchat-android-v6-calls/references/advanced-features.md +0 -87
  310. package/skills/cometchat-android-v6-calls/references/call-layouts.md +0 -100
  311. package/skills/cometchat-android-v6-calls/references/call-session.md +0 -163
  312. package/skills/cometchat-android-v6-calls/references/device-management.md +0 -172
  313. package/skills/cometchat-android-v6-calls/references/group-calls.md +0 -191
  314. package/skills/cometchat-android-v6-calls/references/idle-timeout.md +0 -110
  315. package/skills/cometchat-android-v6-calls/references/in-call-chat.md +0 -141
  316. package/skills/cometchat-android-v6-calls/references/raise-hand.md +0 -188
  317. package/skills/cometchat-android-v6-calls/references/ringing-integration.md +0 -176
  318. package/skills/cometchat-android-v6-calls/references/server-fcm-voip.md +0 -127
  319. package/skills/cometchat-android-v6-calls/references/share-invite.md +0 -105
  320. package/skills/cometchat-android-v6-compose-theming/SKILL.md +0 -250
  321. package/skills/cometchat-android-v6-kotlin-theming/SKILL.md +0 -233
  322. package/skills/cometchat-angular-calls/SKILL.md +0 -380
  323. package/skills/cometchat-angular-calls/references/add-calls-to-existing-chat.md +0 -96
  324. package/skills/cometchat-angular-calls/references/call-layouts.md +0 -123
  325. package/skills/cometchat-angular-calls/references/call-session.md +0 -167
  326. package/skills/cometchat-angular-calls/references/custom-ui.md +0 -239
  327. package/skills/cometchat-angular-calls/references/device-management.md +0 -154
  328. package/skills/cometchat-angular-calls/references/group-calls.md +0 -433
  329. package/skills/cometchat-angular-calls/references/idle-timeout.md +0 -161
  330. package/skills/cometchat-angular-calls/references/in-call-chat.md +0 -148
  331. package/skills/cometchat-angular-calls/references/lazy-loading-pitfalls.md +0 -205
  332. package/skills/cometchat-angular-calls/references/migration-v4-to-v5.md +0 -53
  333. package/skills/cometchat-angular-calls/references/ngzone-and-async-callbacks.md +0 -184
  334. package/skills/cometchat-angular-calls/references/picture-in-picture.md +0 -285
  335. package/skills/cometchat-angular-calls/references/raise-hand.md +0 -172
  336. package/skills/cometchat-angular-calls/references/recording-screen-share.md +0 -260
  337. package/skills/cometchat-angular-calls/references/ringing-integration.md +0 -133
  338. package/skills/cometchat-angular-calls/references/server-web-push-vapid.md +0 -100
  339. package/skills/cometchat-angular-calls/references/share-invite.md +0 -122
  340. package/skills/cometchat-angular-calls/references/virtual-background.md +0 -29
  341. package/skills/cometchat-angular-components/SKILL.md +0 -235
  342. package/skills/cometchat-angular-core/SKILL.md +0 -386
  343. package/skills/cometchat-angular-customization/SKILL.md +0 -616
  344. package/skills/cometchat-angular-features/SKILL.md +0 -329
  345. package/skills/cometchat-angular-patterns/SKILL.md +0 -256
  346. package/skills/cometchat-angular-placement/SKILL.md +0 -314
  347. package/skills/cometchat-angular-production/SKILL.md +0 -564
  348. package/skills/cometchat-angular-push/SKILL.md +0 -389
  349. package/skills/cometchat-angular-testing/SKILL.md +0 -605
  350. package/skills/cometchat-angular-theming/SKILL.md +0 -290
  351. package/skills/cometchat-angular-troubleshooting/SKILL.md +0 -364
  352. package/skills/cometchat-astro-patterns/SKILL.md +0 -708
  353. package/skills/cometchat-calls/SKILL.md +0 -364
  354. package/skills/cometchat-calls/references/use-case-broadcast.md +0 -199
  355. package/skills/cometchat-calls/references/use-case-marketplace.md +0 -157
  356. package/skills/cometchat-calls/references/use-case-support.md +0 -189
  357. package/skills/cometchat-calls/references/use-case-team.md +0 -180
  358. package/skills/cometchat-calls/references/use-case-telehealth.md +0 -153
  359. package/skills/cometchat-components/SKILL.md +0 -1142
  360. package/skills/cometchat-core/SKILL.md +0 -1048
  361. package/skills/cometchat-customization/SKILL.md +0 -580
  362. package/skills/cometchat-customization/references/component-catalog.md +0 -236
  363. package/skills/cometchat-features/SKILL.md +0 -861
  364. package/skills/cometchat-flutter-v5/SKILL.md +0 -173
  365. package/skills/cometchat-flutter-v5-calls/SKILL.md +0 -455
  366. package/skills/cometchat-flutter-v5-calls/references/add-calls-to-existing-chat.md +0 -193
  367. package/skills/cometchat-flutter-v5-calls/references/call-layouts.md +0 -103
  368. package/skills/cometchat-flutter-v5-calls/references/call-session.md +0 -285
  369. package/skills/cometchat-flutter-v5-calls/references/device-management.md +0 -124
  370. package/skills/cometchat-flutter-v5-calls/references/group-calls.md +0 -181
  371. package/skills/cometchat-flutter-v5-calls/references/idle-timeout.md +0 -99
  372. package/skills/cometchat-flutter-v5-calls/references/in-call-chat.md +0 -135
  373. package/skills/cometchat-flutter-v5-calls/references/migration-v4-to-v5.md +0 -210
  374. package/skills/cometchat-flutter-v5-calls/references/raise-hand.md +0 -255
  375. package/skills/cometchat-flutter-v5-calls/references/ringing-integration.md +0 -196
  376. package/skills/cometchat-flutter-v5-calls/references/server-push-bridge.md +0 -101
  377. package/skills/cometchat-flutter-v5-calls/references/share-invite.md +0 -148
  378. package/skills/cometchat-flutter-v5-conversations/SKILL.md +0 -118
  379. package/skills/cometchat-flutter-v5-core/SKILL.md +0 -239
  380. package/skills/cometchat-flutter-v5-customization/SKILL.md +0 -358
  381. package/skills/cometchat-flutter-v5-events/SKILL.md +0 -156
  382. package/skills/cometchat-flutter-v5-messages/SKILL.md +0 -259
  383. package/skills/cometchat-flutter-v5-production/SKILL.md +0 -216
  384. package/skills/cometchat-flutter-v5-push/SKILL.md +0 -285
  385. package/skills/cometchat-flutter-v5-testing/SKILL.md +0 -401
  386. package/skills/cometchat-flutter-v5-theming/SKILL.md +0 -161
  387. package/skills/cometchat-flutter-v5-troubleshooting/SKILL.md +0 -130
  388. package/skills/cometchat-flutter-v5-users-groups/SKILL.md +0 -152
  389. package/skills/cometchat-flutter-v6/SKILL.md +0 -446
  390. package/skills/cometchat-flutter-v6-calls/references/add-calls-to-existing-chat.md +0 -136
  391. package/skills/cometchat-flutter-v6-calls/references/advanced-features.md +0 -89
  392. package/skills/cometchat-flutter-v6-calls/references/call-layouts.md +0 -105
  393. package/skills/cometchat-flutter-v6-calls/references/call-session.md +0 -229
  394. package/skills/cometchat-flutter-v6-calls/references/device-management.md +0 -105
  395. package/skills/cometchat-flutter-v6-calls/references/group-calls.md +0 -190
  396. package/skills/cometchat-flutter-v6-calls/references/idle-timeout.md +0 -88
  397. package/skills/cometchat-flutter-v6-calls/references/in-call-chat.md +0 -125
  398. package/skills/cometchat-flutter-v6-calls/references/raise-hand.md +0 -275
  399. package/skills/cometchat-flutter-v6-calls/references/ringing-integration.md +0 -171
  400. package/skills/cometchat-flutter-v6-calls/references/server-push-bridge.md +0 -93
  401. package/skills/cometchat-flutter-v6-calls/references/share-invite.md +0 -102
  402. package/skills/cometchat-flutter-v6-conversations/SKILL.md +0 -238
  403. package/skills/cometchat-flutter-v6-messages/SKILL.md +0 -384
  404. package/skills/cometchat-flutter-v6-theming/SKILL.md +0 -293
  405. package/skills/cometchat-flutter-v6-users-groups/SKILL.md +0 -224
  406. package/skills/cometchat-i18n/SKILL.md +0 -419
  407. package/skills/cometchat-ios/SKILL.md +0 -325
  408. package/skills/cometchat-ios-calls/references/add-calls-to-existing-chat.md +0 -181
  409. package/skills/cometchat-ios-calls/references/audio-modes-and-controls.md +0 -45
  410. package/skills/cometchat-ios-calls/references/avaudiosession-routing.md +0 -188
  411. package/skills/cometchat-ios-calls/references/call-layouts.md +0 -76
  412. package/skills/cometchat-ios-calls/references/call-session.md +0 -218
  413. package/skills/cometchat-ios-calls/references/callkit-and-pushkit.md +0 -357
  414. package/skills/cometchat-ios-calls/references/custom-ui.md +0 -322
  415. package/skills/cometchat-ios-calls/references/device-management.md +0 -171
  416. package/skills/cometchat-ios-calls/references/group-calls.md +0 -359
  417. package/skills/cometchat-ios-calls/references/idle-timeout.md +0 -184
  418. package/skills/cometchat-ios-calls/references/in-call-chat.md +0 -179
  419. package/skills/cometchat-ios-calls/references/migration-v4-to-v5.md +0 -196
  420. package/skills/cometchat-ios-calls/references/picture-in-picture.md +0 -246
  421. package/skills/cometchat-ios-calls/references/raise-hand.md +0 -26
  422. package/skills/cometchat-ios-calls/references/recording-screen-share.md +0 -252
  423. package/skills/cometchat-ios-calls/references/ringing-integration.md +0 -143
  424. package/skills/cometchat-ios-calls/references/server-apns-pushkit.md +0 -267
  425. package/skills/cometchat-ios-calls/references/share-invite.md +0 -148
  426. package/skills/cometchat-ios-calls/references/swiftui-uikit-hosting.md +0 -246
  427. package/skills/cometchat-ios-calls/references/voip-cert-setup.md +0 -166
  428. package/skills/cometchat-ios-production/SKILL.md +0 -738
  429. package/skills/cometchat-ios-testing/SKILL.md +0 -376
  430. package/skills/cometchat-ios-theming/SKILL.md +0 -667
  431. package/skills/cometchat-ios-troubleshooting/SKILL.md +0 -1003
  432. package/skills/cometchat-native-bare-patterns/SKILL.md +0 -550
  433. package/skills/cometchat-native-calls/SKILL.md +0 -671
  434. package/skills/cometchat-native-calls/references/add-calls-to-existing-chat.md +0 -203
  435. package/skills/cometchat-native-calls/references/call-layouts.md +0 -125
  436. package/skills/cometchat-native-calls/references/call-session.md +0 -182
  437. package/skills/cometchat-native-calls/references/custom-ui.md +0 -254
  438. package/skills/cometchat-native-calls/references/device-management.md +0 -158
  439. package/skills/cometchat-native-calls/references/expo-vs-bare.md +0 -179
  440. package/skills/cometchat-native-calls/references/group-calls.md +0 -296
  441. package/skills/cometchat-native-calls/references/idle-timeout.md +0 -128
  442. package/skills/cometchat-native-calls/references/in-call-chat.md +0 -145
  443. package/skills/cometchat-native-calls/references/migration-v4-to-v5.md +0 -72
  444. package/skills/cometchat-native-calls/references/picture-in-picture.md +0 -276
  445. package/skills/cometchat-native-calls/references/raise-hand.md +0 -205
  446. package/skills/cometchat-native-calls/references/recording-screen-share.md +0 -169
  447. package/skills/cometchat-native-calls/references/ringing-integration.md +0 -118
  448. package/skills/cometchat-native-calls/references/server-push-bridge.md +0 -135
  449. package/skills/cometchat-native-calls/references/server-push-payloads.md +0 -193
  450. package/skills/cometchat-native-calls/references/share-invite.md +0 -146
  451. package/skills/cometchat-native-calls/references/voip-push-end-to-end.md +0 -319
  452. package/skills/cometchat-native-components/SKILL.md +0 -628
  453. package/skills/cometchat-native-core/SKILL.md +0 -679
  454. package/skills/cometchat-native-customization/SKILL.md +0 -716
  455. package/skills/cometchat-native-expo-patterns/SKILL.md +0 -552
  456. package/skills/cometchat-native-features/SKILL.md +0 -638
  457. package/skills/cometchat-native-placement/SKILL.md +0 -509
  458. package/skills/cometchat-native-production/SKILL.md +0 -700
  459. package/skills/cometchat-native-push/SKILL.md +0 -594
  460. package/skills/cometchat-native-testing/SKILL.md +0 -582
  461. package/skills/cometchat-native-theming/SKILL.md +0 -681
  462. package/skills/cometchat-native-troubleshooting/SKILL.md +0 -501
  463. package/skills/cometchat-nextjs-patterns/SKILL.md +0 -899
  464. package/skills/cometchat-placement/SKILL.md +0 -1360
  465. package/skills/cometchat-production/SKILL.md +0 -1027
  466. package/skills/cometchat-react-calls/SKILL.md +0 -752
  467. package/skills/cometchat-react-calls/references/add-calls-to-existing-chat.md +0 -146
  468. package/skills/cometchat-react-calls/references/call-layouts.md +0 -160
  469. package/skills/cometchat-react-calls/references/call-session.md +0 -235
  470. package/skills/cometchat-react-calls/references/custom-ui.md +0 -247
  471. package/skills/cometchat-react-calls/references/device-management.md +0 -210
  472. package/skills/cometchat-react-calls/references/group-calls.md +0 -257
  473. package/skills/cometchat-react-calls/references/idle-timeout.md +0 -188
  474. package/skills/cometchat-react-calls/references/in-call-chat.md +0 -212
  475. package/skills/cometchat-react-calls/references/migration-v4-to-v5.md +0 -170
  476. package/skills/cometchat-react-calls/references/picture-in-picture.md +0 -245
  477. package/skills/cometchat-react-calls/references/raise-hand.md +0 -238
  478. package/skills/cometchat-react-calls/references/recording-screen-share.md +0 -144
  479. package/skills/cometchat-react-calls/references/ringing-integration.md +0 -255
  480. package/skills/cometchat-react-calls/references/server-web-push-vapid.md +0 -241
  481. package/skills/cometchat-react-calls/references/share-invite.md +0 -175
  482. package/skills/cometchat-react-calls/references/testing-calls-on-web.md +0 -216
  483. package/skills/cometchat-react-calls/references/virtual-background.md +0 -32
  484. package/skills/cometchat-react-calls/references/voip-and-web-push.md +0 -165
  485. package/skills/cometchat-react-patterns/SKILL.md +0 -628
  486. package/skills/cometchat-react-push/SKILL.md +0 -634
  487. package/skills/cometchat-react-router-patterns/SKILL.md +0 -758
  488. package/skills/cometchat-react-testing/SKILL.md +0 -413
  489. package/skills/cometchat-theming/SKILL.md +0 -498
  490. package/skills/cometchat-troubleshooting/SKILL.md +0 -294
@@ -1,584 +1,133 @@
1
1
  ---
2
2
  name: cometchat-ios-calls
3
- description: CometChat Calls SDK v5 integration for native iOS (Swift; SwiftUI + UIKit hosting). Covers SDK install (SPM + CocoaPods), file-based init via cometchat-settings.json (CometChatCalls.initFromSettings, ai-agent telemetry) with builder fallback, dual-SDK ringing (Chat SDK initiateCall + Calls SDK generateToken/startSession), CallKit + PushKit VoIP push, AVAudioSession routing, mixed-stack hosting (UIViewControllerRepresentable for SwiftUI), Info.plist permissions + Background Modes, and additive-vs-standalone modes.
3
+ description: "Add voice and video calling to an iOS CometChat app call buttons, incoming/ongoing call screens, call logs, and CallKit ringing. Triggers: 'add video calling ios', 'cometchat voice call swift', 'incoming call screen ios', 'call logs cometchat ios'."
4
4
  license: "MIT"
5
- compatibility: "Xcode 15+, Swift 5.9+, iOS 15.1+ deployment target (CometChatCallsSDK 5.0.2+; 13.0 only for <= 5.0.1); CometChatSDK 4.x; CometChatUIKitSwift 5.x (additive mode)"
5
+ compatibility: "CometChatUIKitSwift 5.1.22 · CometChatCallsSDK 5.0.3 · iOS 15.1+"
6
6
  metadata:
7
7
  author: "CometChat"
8
- version: "4.1.0"
9
- tags: "cometchat ios calls voice video webrtc swift swiftui uikit callkit pushkit avaudiosession spm cocoapods voip background-modes"
8
+ version: "1.0.0"
9
+ tags: "cometchat ios calls voice video callkit swift v5"
10
10
  ---
11
11
 
12
- ## Purpose
12
+ ## Companion skills (read first)
13
+ - `cometchat-ios-core` owns setup and the chat surface. This skill ADDS calling. Note core ALREADY links `CometChatCallsSDK` at exactly 5.0.3 — on 5.1.22 (as since 5.1.19) the kit's interface imports it, so it is required even for chat-only builds. Do not add it twice or at a different version.
13
14
 
14
- Production-grade voice + video calling for native iOS. Loaded by `cometchat-calls` when `framework === "ios"`. Operates in two modes:
15
+ ## Use this skill when
16
+ "add voice/video calling", "show an incoming call screen", "add call history".
15
17
 
16
- - **Standalone** calls is the product. `CometChatSDK` (signaling) + `CometChatCallsSDK` (WebRTC) + your own SwiftUI views or UIKit view controllers. **CallKit + PushKit are mandatory.**
17
- - **Additive** — calls layered onto an existing CometChat iOS UI Kit integration. The kit's `CometChatMessageHeader` already exposes call buttons; this skill wires them and mounts the global call listener.
18
+ ## Calls has its OWN login the UI Kit's login is not enough
18
19
 
19
- **Read these other skills first:**
20
- - `cometchat-calls` — dispatcher (modes, hard rules, anti-patterns)
21
- - `cometchat-ios-core` Chat SDK init, login, `Secrets.swift` / `.xcconfig` credential conventions, SwiftUI vs UIKit entry-point detection
22
-
23
- **Ground truth:**
24
- - SDK source — `calls-sdk-ios-5/sdk/`
25
- - Sample app — `calls-sdk-ios-5/sample-apps/cometchat-calls-sample-app-ios/`
26
- - `Package.swift` — `https://github.com/cometchat/calls-sdk-ios.git` (SPM)
27
- - Public docs — https://www.cometchat.com/docs/calls/ios/overview
28
-
29
- ---
30
-
31
- ## iOS Calls SDK v5 resolution — verified working (re-checked 2026-06-04)
32
-
33
- > An earlier draft of this skill warned that "the iOS Calls SDK v5 binary is broken / missing from Cloudsmith — stay on v4.2.x." **That warning was wrong and has been removed.** It was based on a hand-constructed URL (`…/raw/versions/124.0.4/CometChatWebRTC-124.0.4.xcframework.zip`) that 404s — but that is NOT the path the podspec/`Package.swift` actually fetches, so its 404 never proved anything. Verified 2026-06-04:
34
- > - **Additive (UI Kit) path:** `CometChatCallsSDK` v5 ships **vendored inside `CometChatUIKitSwift`** — a clean `pod install` resolves `CometChatUIKitSwift (5.1.13)` (which bundles the v5 CallsSDK framework) with **no 404**. The audited `CometChatCallsSDK.swiftinterface` (v5 shape: `generateToken`/`startSession`, no `login`) came straight out of that resolved framework.
35
- > - **Standalone path:** `CometChatCallsSDK` v5.0.0 is consumable via CocoaPods (e.g. the internal VoIP+APNs sample under Linear ENG-35167 builds against it).
36
- >
37
- > If you ever DO hit a missing-WebRTC binary on a direct standalone `pod 'CometChatCallsSDK'` install, treat it as an environment/registry hiccup and check the current podspec URL — it is not a known blanket failure, and there is no open vendor ticket for it.
38
-
39
- ---
40
-
41
- ## 1. The seven hard rules — iOS specialization
42
-
43
- > ⚠️ **TOP PRIORITY (ENG-35710): Auth-token passing is the most-broken step on iOS Calls integrations.** Unlike Android / Flutter / JS, the **iOS Calls SDK 5.x has NO separate login step** — there is no `CometChatCalls.login(...)` and no `CometChatCalls.getLoggedInUser()` (those are phantom; verified absent from `CometChatCallsSDK` — **in 5.0.1 and earlier; 5.0.2 restores them — see the §1.0 correction**). Auth is supplied **per session** as the `authToken:` argument to `CometChatCalls.generateToken(authToken:sessionID:)`. Every tester who hit "calls don't work" on iOS traced back to that token: (a) the token was empty/nil → `generateToken` fails with **"auth token cannot be null"**; (b) a server-minted token expired between mint and `generateToken` (default ~30-minute TTL); (c) the client-side `apiKey` was passed instead of the user's auth token. Before scaffolding ANY iOS calls code, confirm the auth path (dev: read `CometChat.getUserAuthToken()`; production: fetch a fresh server-minted token) and feed it to `generateToken`. Mixing them is the canonical "ringing but never joins" iOS failure mode.
44
-
45
- ### 1.0 The iOS Calls SDK has NO separate login (v5) — CORRECTED for 5.0.2 (2026-07-21)
46
-
47
- > **Correction (ENG-37137, verified against the published 5.0.2 binary + live end-to-end test 2026-07-21):** the "no login" claim below is TRUE for the UI Kit-vendored calls framework and for standalone **5.0.1 and earlier**, but **standalone `CometChatCallsSDK` 5.0.2 exports `login(UID:authKey:)` / `login(UID:apiKey:)` / `login(authToken:)` / `logout()` and persists the session** (v4-compat surface restored in `calls-core`; the SDK's own sample app logs in via `LoginViewController`). This matters for two reasons: (a) after login, the `generateToken(sessionID:)` overload works without hand-passing an auth token; (b) **login success is the trigger for the ai-agent identification telemetry** (§2) — in a calls-only app that never logs in, the self-report has nothing to fire on. Dual-SDK (ringing) integrations are unaffected: the Chat SDK login remains the only login you need there.
48
-
49
- Unlike the Android / Flutter / JS Calls SDKs, **`CometChatCalls` on iOS has no `login()` and no `getLoggedInUser()`** — those methods do not exist in `CometChatCallsSDK` 5.0.1 and earlier (see correction above for 5.0.2+). There is nothing to "log in" to. Once the Chat SDK session exists, you authorize each call session by passing an **auth token** to `generateToken(authToken:sessionID:)`, then `startSession(callToken:callSetting:view:)` with the returned call token (full flow in §1.1).
50
-
51
- ```swift
52
- import CometChatSDK
53
- import CometChatCallsSDK
54
-
55
- // Chat SDK login is the ONLY login. (UI Kit users: CometChatUIKit.login already did this.)
56
- CometChat.login(UID: uid, authKey: AUTH_KEY) { user in
57
- // Chat SDK ready. No CometChatCalls.login() exists — do NOT call it.
58
- // The incoming-call listener can be registered now; per-call auth happens via generateToken.
59
- } onError: { error in
60
- // chat login failed
61
- }
62
-
63
- // Dev: the auth token for generateToken comes from the Chat SDK:
64
- let authToken = CometChat.getUserAuthToken() // String? — pass to generateToken(authToken:)
65
- // Production: fetch a fresh server-minted token from your backend instead.
66
- ```
67
-
68
- **Surprises:**
69
- - There is **no Calls-SDK session to persist** — the Chat SDK's Keychain session is the only persisted login. On app start just confirm `CometChat.getLoggedInUser() != nil`.
70
- - `generateToken` / `startSession` errors hit the `onError` closure (not `do/try/catch`). The error type is `CometChatCallException` — has `errorDescription` and `errorCode`.
71
-
72
- ### 1.1 Dual-SDK contract
73
-
74
- Chat SDK (`CometChatSDK`) initiates ringing; Calls SDK (`CometChatCallsSDK`) runs the WebRTC session. There is no two-`Call`-classes problem on iOS — Swift's module separation prevents it. But the API split still exists:
75
-
76
- ```swift
77
- // ✓ RIGHT — initiate ringing (Chat SDK)
78
- import CometChatSDK
79
-
80
- let outgoing = Call(receiverId: receiverUid, callType: .video, receiverType: .user)
81
- CometChat.initiateCall(call: outgoing, onSuccess: { initiated in
82
- // initiated.sessionID is what the Calls SDK will join
83
- }, onError: { error in
84
- // surface to UI
85
- })
86
- ```
87
-
88
- ```swift
89
- // ✓ RIGHT — start the WebRTC session (Calls SDK 5.x) after acceptance.
90
- // iOS Calls SDK 5.x is a TWO-STEP flow: generateToken → startSession.
91
- // There is NO joinSession, NO CallSession singleton, and NO SessionSettingsBuilder
92
- // in the 5.x SDK — those are phantom. The real builder is CallSettingsBuilder.
93
- // - CallSettingsBuilder (NOT SessionSettingsBuilder) builds the CallSettings
94
- // - generateToken(authToken:sessionID:) FIRST, then startSession(callToken:callSetting:view:)
95
- // - Attach the event listener via CallSettingsBuilder.setDelegate(_:) (CallsEventsDelegate)
96
- import CometChatCallsSDK
97
-
98
- let settings = CallSettingsBuilder()
99
- .setStartVideoMuted(false)
100
- .setStartAudioMuted(false)
101
- .setDelegate(callListener) // any CallsEventsDelegate — onCallEnded, onUserJoined, …
102
- .build()
103
-
104
- // loggedInAuthToken: the current user's auth token — CometChat.getUserAuthToken()
105
- // (User has NO .authToken property; getUserAuthToken() is the real accessor)
106
- CometChatCalls.generateToken(authToken: loggedInAuthToken, sessionID: sessionID) { callToken in
107
- guard let callToken = callToken else { return }
108
- CometChatCalls.startSession(
109
- callToken: callToken,
110
- callSetting: settings,
111
- view: callContainerView // UIView with measurable bounds
112
- ) { _ in
113
- // session started — the call UI is rendered into callContainerView
114
- } onError: { error in
115
- print("startSession failed: \(error?.errorDescription ?? "unknown")")
116
- }
117
- } onError: { error in
118
- print("generateToken failed: \(error?.errorDescription ?? "unknown")")
119
- }
120
- ```
121
-
122
- ### 1.1a End-to-end initiate→join sequence (ENG-35710)
123
-
124
- After `CometChat.initiateCall` the caller's session is NOT auto-joined — the gap between *initiation* and *joining* is the second canonical iOS failure (after auth-token). Three events must fire in sequence; the caller side handles each in a different callback.
125
-
126
- > **Corrected 2026-06-02 against `calls-sdk-ios/sample-apps/cometchat-calls-sample-app-ringing-ios/CometChatCallsRinging/AppState.swift:213`** — the listener protocol is **`CometChatCallDelegate`** (NOT `CometChatCallsListener` as earlier drafts said), and each callback takes TWO parameters (`Call?` + `CometChatException?`), NOT one. Earlier example would not compile.
127
-
128
- ```swift
129
- // Step A: register the listener on app start (before any call fires)
130
- // Listener ID is a String; listener instance is "self" or any class conforming
131
- // to CometChatCallDelegate.
132
- CometChat.addCallListener(callListenerID, self)
133
-
134
- // Step B: conform to CometChatCallDelegate (NOT CometChatCallsListener)
135
- extension YourClass: CometChatCallDelegate {
136
- // Caller side: the OTHER party accepted — NOW join the session
137
- func onOutgoingCallAccepted(acceptedCall: Call?, error: CometChatException?) {
138
- if let error = error { /* surface */ return }
139
- guard let call = acceptedCall, let sessionID = call.sessionID else { return }
140
- startCallSession(sessionID: sessionID)
141
- }
142
- // Receiver side: incoming call rang — present accept UI; on accept, start the session
143
- func onIncomingCallReceived(incomingCall: Call?, error: CometChatException?) {
144
- if let error = error { /* surface */ return }
145
- guard let call = incomingCall else { return }
146
- presentIncomingCallUI(for: call) { accepted in
147
- if accepted {
148
- CometChat.acceptCall(sessionID: call.sessionID ?? "") { acceptedCall in
149
- self.startCallSession(sessionID: acceptedCall?.sessionID ?? "")
150
- } onError: { _ in /* surface */ }
151
- }
152
- }
153
- }
154
- func onOutgoingCallRejected(rejectedCall: Call?, error: CometChatException?) { /* end UI, cleanup */ }
155
- func onIncomingCallCancelled(canceledCall: Call?, error: CometChatException?) { /* dismiss incoming UI — label is canceledCall: (single L) */ }
156
- }
157
-
158
- // Don't forget to remove the listener on teardown
159
- // CometChat.removeCallListener(callListenerID)
160
-
161
- // Step B: kick the call off (caller — your "Call" button taps this)
162
- let outgoing = Call(receiverId: targetUid, callType: .video, receiverType: .user)
163
- CometChat.initiateCall(call: outgoing, onSuccess: { initiated in
164
- // initiated.sessionID is what the session will use — but DO NOT start the
165
- // session here. Wait for onOutgoingCallAccepted on the listener. Starting before
166
- // the remote accepts means you're alone in an empty session.
167
- }, onError: { error in /* surface */ })
168
-
169
- // Step C: start the session (caller in onOutgoingCallAccepted, receiver after acceptCall)
170
- // 5.x flow: generateToken(authToken:sessionID:) → startSession(callToken:callSetting:view:)
171
- func startCallSession(sessionID: String) {
172
- let settings = CallSettingsBuilder()
173
- .setStartVideoMuted(false)
174
- .setStartAudioMuted(false)
175
- .setDelegate(self) // self conforms to CallsEventsDelegate
176
- .build()
177
- CometChatCalls.generateToken(authToken: loggedInAuthToken, sessionID: sessionID) { callToken in
178
- guard let callToken = callToken else { return }
179
- CometChatCalls.startSession(
180
- callToken: callToken,
181
- callSetting: settings,
182
- view: callContainerView // UIView WITH non-zero bounds (lay out first)
183
- ) { _ in
184
- // session started
185
- } onError: { error in
186
- print("startSession failed: \(error?.errorDescription ?? "unknown")")
187
- }
188
- } onError: { error in
189
- print("generateToken failed: \(error?.errorDescription ?? "unknown")")
190
- }
191
- }
192
- ```
193
-
194
- The shape: `initiateCall` → wait for `onOutgoingCallAccepted` on your `CometChatCallDelegate` → `generateToken` → `startSession`. Skipping the listener and starting inside `initiateCall`'s `onSuccess` is the "ringing but never joins" trap — you'll see the call connect on the wire but the receiver's accept never reaches your code.
195
-
196
- ### 1.2 CallKit + PushKit are mandatory
197
-
198
- iOS will not deliver standard push notifications to a backgrounded/terminated app for an incoming call — the app would have to be foregrounded for it to ring. CallKit + PushKit is the only correct path:
199
-
200
- - **PushKit** delivers VoIP push tokens (separate from APNs tokens) and high-priority VoIP payloads even when the app is terminated
201
- - **CallKit** presents the system incoming-call UI (lock-screen, even when device is locked) and reports call state to the OS
202
- - Your `PKPushRegistry` listener calls `CXProvider.reportNewIncomingCall(...)` immediately on receiving the VoIP payload — Apple terminates apps that delay this
203
-
204
- This pattern is non-negotiable for App Store review on apps that ring users. Standalone mode wires it; additive mode prompts but doesn't force it.
205
-
206
- ### 1.3 Background modes — three required entries
207
-
208
- In the target's "Signing & Capabilities" → Background Modes:
209
-
210
- - **`Audio, AirPlay, and Picture in Picture`** — required for ongoing-call audio when backgrounded
211
- - **`Voice over IP`** — required for PushKit VoIP payload delivery
212
- - **`Remote notifications`** — required for chat push (keeps existing entitlements working)
213
-
214
- In `Info.plist`:
215
-
216
- ```xml
217
- <key>UIBackgroundModes</key>
218
- <array>
219
- <string>audio</string>
220
- <string>voip</string>
221
- <string>remote-notification</string>
222
- </array>
223
- ```
224
-
225
- Apple will reject the app if `voip` is declared but PushKit is not actually used.
226
-
227
- ### 1.4 Server-minted auth tokens
228
-
229
- Same rule as the chat dispatcher / `cometchat-ios-production`. Production calls path uses `CometChat.login(authToken:)`, not `CometChat.login(uid:authKey:)`.
230
-
231
- ### 1.5 Hangup cleanup — `AVAudioSession` routing
232
-
233
- Releasing the camera + mic on iOS is straightforward; the gotcha is `AVAudioSession`:
20
+ **`CometChatUIKit.login(uid:)` does NOT authenticate the Calls SDK.** Built without the bootstrap
21
+ below, `CometChatCallLogs` shows "Oops! Looks like something went wrong" its request goes out
22
+ with an EMPTY `authToken` (measured on 5.1.19/5.0.3). No error points at the cause. After the UI
23
+ Kit login succeeds, run:
234
24
 
235
25
  ```swift
236
- import CometChatCallsSDK
237
-
238
- func endCall() {
239
- // v5: end the session via the static CometChatCalls.endSession().
240
- // There is NO CallSession singleton and NO leaveSession() in the 5.x SDK —
241
- // all in-call control is via static funcs on CometChatCalls.
242
- CometChatCalls.endSession()
243
- callContainer.subviews.forEach { $0.removeFromSuperview() }
244
-
245
- // CRITICAL: deactivate the audio session, otherwise the speaker stays
246
- // routed to "earpiece + voice processing" mode and other audio (music,
247
- // phone calls outside the app) sounds wrong until the user resets it.
248
- do {
249
- try AVAudioSession.sharedInstance().setActive(false, options: .notifyOthersOnDeactivation)
250
- } catch {
251
- // log but don't block — best-effort cleanup
252
- }
253
-
254
- // CallKit must be told the call ended, even if WE ended it
255
- cxProvider.reportCall(with: callUUID, endedAt: Date(), reason: .remoteEnded)
256
- }
257
- ```
258
-
259
- In-call controls are **static funcs on `CometChatCalls`** (there is no `CallSession` type in the 5.x Calls SDK). Audio/video toggles take a `Bool`:
26
+ // DEFAULT — the ai-agent / telemetry-attributed init (persists integrationSource="ai-agent").
27
+ // Takes NO settings argument: it reads the SAME bundled cometchat-settings.json the core skill
28
+ // already ships (Copy Bundle Resources) — do not build a second settings object.
29
+ _ = CometChatCalls.initFromSettings(onSuccess: { _ in
30
+ guard let token = CometChat.getUserAuthToken() else { return }
31
+ CometChatCalls.login(authToken: token,
32
+ onSuccess: { _ in /* calls surfaces are now live */ },
33
+ onError: { error in debugPrint("calls login:", error.errorDescription) })
34
+ }, onError: { error in debugPrint("calls init:", error?.errorDescription ?? "nil") })
35
+ ```
36
+
37
+ ⚠️ **Init the Calls SDK via `CometChatCalls.initFromSettings`, NOT the classic
38
+ `CometChatCalls(callsAppSettings: CallAppSettingsBuilder()…)` builder — that path attributes the app
39
+ to `"manual"` and loses the ai-agent telemetry (RULES §5 / AUDIT-175, the SAME rule the headless
40
+ `cometchat-ios-v5-sdk` follows).** The builder init is the **FALLBACK ONLY**, for an app that does not
41
+ bundle `cometchat-settings.json`:
260
42
 
261
43
  ```swift
262
- CometChatCalls.audioMuted(true) // mute mic; false = unmute
263
- CometChatCalls.videoPaused(true) // pause video; false = resume
264
- CometChatCalls.switchCamera()
265
- CometChatCalls.enterPIPMode() // picture-in-picture; exitPIPMode() to leave
266
- CometChatCalls.startRecording() // stopRecording() to end
267
- // NOTE: the iOS Calls SDK 5.x has NO local screen-share initiation API
268
- // (no startScreenShare/stopScreenShare) — iOS can only RECEIVE a remote
269
- // participant's screen share, not start one.
270
- ```
271
-
272
- Skipping the `setActive(false, options: .notifyOthersOnDeactivation)` is the canonical "music doesn't resume after the call" bug.
273
-
274
- ### 1.6 Permissions with rationale — Info.plist usage strings
275
-
276
- Two required entries; iOS rejects builds that record without them:
277
-
278
- ```xml
279
- <key>NSMicrophoneUsageDescription</key>
280
- <string>So you can talk during voice and video calls.</string>
281
- <key>NSCameraUsageDescription</key>
282
- <string>So you can be seen during video calls.</string>
44
+ // FALLBACK only when no cometchat-settings.json is bundled. Loses ai-agent attribution.
45
+ let callSettings = CallAppSettingsBuilder().set(appID: appID).set(region: region).build()
46
+ _ = CometChatCalls(callsAppSettings: callSettings, onSuccess: { _ in /* … login as above … */ },
47
+ onError: { error in debugPrint("calls init:", error?.errorDescription ?? "nil") })
283
48
  ```
284
49
 
285
- Plus, on iOS 15+, request permission via `AVCaptureDevice.requestAccess(for:)` and `AVAudioApplication.requestRecordPermission` (deprecating `AVAudioSession.requestRecordPermission` in iOS 17+). The skill writes the modern path.
286
-
287
- ### 1.7 IncomingCall UI CallKit owns it
288
-
289
- In standalone mode, you do NOT render an in-app incoming-call screen. CallKit's system UI handles it (rule 1.2). Your job is:
50
+ **Never do both** a builder init AFTER `initFromSettings` re-attributes the app to `"manual"`.
51
+ `initFromSettings` fails `SETTINGS_FILE_NOT_FOUND` if the file is not in Copy Bundle Resources — the
52
+ core skill already adds it for chat, so a UI-Kit app that shipped chat first already satisfies this.
290
53
 
291
- 1. Keep `PKPushRegistry` alive register in `application(_:didFinishLaunchingWithOptions:)` (UIKit) or `App.init()` (SwiftUI's `@main`)
292
- 2. On VoIP payload call `CXProvider.reportNewIncomingCall`
293
- 3. Implement `CXProviderDelegate` `provider(_:perform:)` for `CXAnswerCallAction` this is where you finally call `CometChatCalls.generateToken` then `startSession`
294
-
295
- In additive mode, the UI Kit's incoming-call view can be used for in-foreground rings; CallKit handles backgrounded/terminated rings.
296
-
297
- ### 1.7a Default incoming/outgoing UI fallback (ENG-35710)
298
-
299
- Two iOS testers shipped without a foreground incoming/outgoing screen because the skill jumped straight to CallKit and never showed what to render when the app is already in-foreground. Result: a Call rings on the wire, but the user-facing app shows nothing — the call connects, the call drops, no feedback.
300
-
301
- **If the developer hasn't asked for a custom incoming-call UI, wire the kit's defaults:**
302
-
303
- ```swift
304
- // SwiftUI host
305
- import SwiftUI
306
- import UIKit
307
- import CometChatUIKitSwift
308
-
309
- // The kit ships call UI as UIViewControllers (CometChatIncomingCall / CometChatOutgoingCall /
310
- // CometChatOngoingCall) — there are NO `…SwiftUI`-suffixed wrappers. Bridge with
311
- // UIViewControllerRepresentable. Present the controller when your delegate fires (§1.1a);
312
- // configure it via the kit's IncomingCallConfiguration rather than a constructor arg.
313
- struct CometChatIncomingCallView: UIViewControllerRepresentable {
314
- func makeUIViewController(context: Context) -> CometChatIncomingCall {
315
- CometChatIncomingCall()
316
- }
317
- func updateUIViewController(_ vc: CometChatIncomingCall, context: Context) {}
318
- }
319
-
320
- struct AppRootView: View {
321
- @State private var hasIncomingCall = false
322
- var body: some View {
323
- ZStack {
324
- ContentView() // your app's tabs / nav
325
- if hasIncomingCall {
326
- CometChatIncomingCallView()
327
- .ignoresSafeArea()
328
- }
329
- }
330
- // flip `hasIncomingCall` from your CometChatCallDelegate.onIncomingCallReceived (see §1.1a)
331
- }
332
- }
333
- ```
54
+ The docs' calling-integration page says linking the SDK is enough; it is not — that gap is logged
55
+ for the docs. Chat-only apps skip all of this (they link the Calls SDK purely to satisfy 5.1.19's
56
+ importsee the core skill's install notes).
334
57
 
335
- ```swift
336
- // UIKit host
337
- class RootViewController: UIViewController {
338
- override func viewDidLoad() {
339
- super.viewDidLoad()
340
- // Install the kit's incoming-call VC above all other view controllers
341
- let incoming = CometChatIncomingCall()
342
- addChild(incoming)
343
- view.addSubview(incoming.view)
344
- incoming.view.frame = view.bounds
345
- incoming.view.autoresizingMask = [.flexibleWidth, .flexibleHeight]
346
- incoming.didMove(toParent: self)
347
- }
348
- }
349
- ```
350
-
351
- Mounting at the root (above your nav / tab structure) means foreground rings work app-wide — same idea as the web skill's "mount above the route boundary" rule. CallKit still handles backgrounded/terminated rings; the kit's incoming-call VC handles foreground rings. Together they're the complete foreground-and-background coverage.
352
-
353
- If the developer DOES want a custom UI: tell them to (a) implement `CometChatCallDelegate.onIncomingCallReceived` to drive their own SwiftUI/UIKit screen, (b) call `CometChat.acceptCall` / `rejectCall` from that screen, and (c) on accept, follow the `generateToken` → `startSession` recipe in §1.1a. The kit's default UI is the recommended starting point because it already wires accept/reject/timer/profile-pic; replicating it from scratch is a 200-line side quest.
354
-
355
- ---
356
-
357
- ## 2. Setup
358
-
359
- ### Swift Package Manager (preferred)
360
-
361
- Add via Xcode → File → Add Package Dependencies:
362
-
363
- ```
364
- https://github.com/cometchat/calls-sdk-ios.git
365
- ```
366
-
367
- Pin to `5.0.0..<6.0.0`. SPM resolves `CometChatSDK` automatically.
368
-
369
- ### CocoaPods
370
-
371
- ```ruby
372
- platform :ios, '15.1' # REQUIRED for CometChatCallsSDK 5.0.2+ — a lower platform silently resolves 5.0.1 (no initFromSettings)
373
- target 'YourApp' do
374
- use_frameworks!
375
- pod 'CometChatSDK', '~> 4.0' # signaling
376
- pod 'CometChatCallsSDK', '~> 5.0' # WebRTC session
377
- # additive mode also has CometChatUIKitSwift '~> 5.1' already
378
- end
379
-
380
- post_install do |installer|
381
- installer.pods_project.build_configurations.each do |config|
382
- config.build_settings['ENABLE_USER_SCRIPT_SANDBOXING'] = 'NO' # Xcode 15+
383
- end
384
- end
385
- ```
386
-
387
- ### Init — file-based with `cometchat-settings.json` (recommended)
388
-
389
- > **Version requirement (ENG-37137 — Skills Telemetry).** `CometChatCalls.initFromSettings(onSuccess:onError:)` reads a bundled `cometchat-settings.json` and lets the **Calls SDK** self-report `integrationSource = "ai-agent"` to `/user_sessions`. It ships in **`CometChatCallsSDK` >= 5.0.2** (released 2026-07-20). ⚠️ **THE SILENT-DOWNGRADE TRAP: 5.0.2 raised the minimum iOS deployment target to 15.1.** If the Podfile declares `platform :ios` below 15.1, CocoaPods does NOT error — it silently resolves **5.0.1**, which has no `initFromSettings` (and self-reports version 99.0.0). After `pod install`, **verify `Podfile.lock` shows `CometChatCallsSDK (5.0.2)`** — a missing `initFromSettings` symbol at build time means you got 5.0.1. On 5.0.1/5.0.0 the method does not exist — bump the platform to 15.1 (preferred) or use the **`CallAppSettingsBuilder` fallback** below.
390
-
391
- Like the iOS UI Kit's `CometChatUIKit.initFromSettings` (see `cometchat-ios-core`), the Calls variant takes **no settings argument** — it reads the file straight from the app's main bundle, so the file must be in the target's **Copy Bundle Resources**.
392
-
393
- **Step 1 — `cometchat-settings.json`.** It is the SAME unified file the chat-side skills create. If `cometchat-ios-core` already added one, reuse it — just confirm the `callsSDK` section exists. Creating it fresh (calls-only app):
394
-
395
- ```json
396
- {
397
- "appId": "APP_ID_HERE",
398
- "region": "us",
399
- "credentials": {
400
- "authKey": "AUTH_KEY_HERE"
401
- },
402
- "callsSDK": {
403
- "host": null,
404
- "adminHost": null,
405
- "clientHost": null,
406
- "callsHost": null
407
- }
408
- }
409
- ```
410
-
411
- `initFromSettings` reads the root `appId` / `region` and the four optional `callsSDK` host overrides; everything else in the unified schema is ignored by the Calls SDK. Add the file to the app target (*File → Add Files…* AND confirm it under *Build Phases → Copy Bundle Resources*) — `SETTINGS_FILE_NOT_FOUND` at init means it's missing from Copy Bundle Resources. Commit the file; treat any `authKey` in it as a public demo credential (same rule as `cometchat-ios-core` §2).
412
-
413
- **Step 2 — init (no builder, no args):**
414
-
415
- ```swift
416
- import CometChatSDK
417
- import CometChatCallsSDK
418
-
419
- let appSettings = AppSettings.AppSettingsBuilder()
420
- .subscribePresenceForAllUsers()
421
- .setRegion(region: Secrets.cometchatRegion)
422
- .build()
423
-
424
- CometChat.init(appId: Secrets.cometchatAppID, appSettings: appSettings) { isInitialized, error in
425
- guard error == nil else { return }
426
-
427
- // File-based init — reads cometchat-settings.json from the bundle and
428
- // attributes the integration as ai-agent for /user_sessions telemetry.
429
- CometChatCalls.initFromSettings(onSuccess: { _ in
430
- // ready — register PushKit (rule 1.2) and CXProvider (rule 1.7) here
431
- }, onError: { error in
432
- print("CometChatCalls init failed: \(error?.errorDescription ?? "")")
433
- })
434
- }
435
- ```
436
-
437
- **How the attribution works (don't fight it):** `initFromSettings` persists `integrationSource = "ai-agent"` (appId-scoped) *before* delegating to the normal init. The identification POST itself fires on `CometChatCalls.login(...)` success or on a later `init` that restores a persisted session, and is deduped via a SHA-256 hash — repeats are no-ops until the app/SDK version or integration source changes. Two consequences:
438
-
439
- - **Do NOT scaffold a raw `CallAppSettingsBuilder` init when `initFromSettings` is available** — a direct builder init re-attributes the integration as `manual`.
440
- - When the **Chat SDK is linked in the same app** (dual-SDK ringing mode, additive mode), the Calls SDK suppresses its own self-report — the chat side reports instead, so ALSO use the chat-side file-based init there (`CometChatUIKit.initFromSettings` — `cometchat-ios-core` §2). The calls-side `initFromSettings` is still the right init (one config file, ai-agent source persisted either way).
441
-
442
- ### Init — `CallAppSettingsBuilder` (fallback — 5.0.1 and earlier)
443
-
444
- ```swift
445
- let callAppSettings = CallAppSettingsBuilder()
446
- .setAppId(Secrets.cometchatAppID)
447
- .setRegion(Secrets.cometchatRegion)
448
- .build()
449
-
450
- CometChatCalls.init(callsAppSettings: callAppSettings, onSuccess: { _ in
451
- // ready
452
- }, onError: { error in
453
- print("CometChatCalls.init failed: \(error?.errorDescription ?? "")")
454
- })
455
- ```
456
-
457
- Credentials via `Secrets.swift` (gitignored) or `.xcconfig` Build Settings — see `cometchat-ios-core`.
458
-
459
- ---
460
-
461
- ## 3. Components catalog
462
-
463
- ### Calls SDK primitives (used in standalone or wherever you build custom UI)
464
-
465
- | Type | Purpose |
58
+ ## The five components
59
+ | Component | Role |
466
60
  |---|---|
467
- | `CometChatCalls` | Top-level facade`init`, `generateToken`, `startSession`, `endSession`, `audioMuted(_:)`, `videoPaused(_:)`, `switchCamera`, `enterPIPMode`/`exitPIPMode`, `startRecording`/`stopRecording`, `addCallEventListener` |
468
- | `CallSettingsBuilder` | Per-session config (audio-only, presenter, hide buttons, start muted, `setDelegate`) `.build()` returns `CallSettings` |
469
- | `CallSettings` | The built per-session config passed to `startSession(callToken:callSetting:view:)` (there is no `CallSession` object in 5.x `startSession` returns a session-id `String`) |
470
- | `CallType` | `.video` / `.audio` / `.audioVideo` (swiftinterface:294-297) there is NO `.voice` |
471
- | `DisplayModes` (enum) | `.default` / `.single` / `.spotlight` (swiftinterface:175)passed to `CallSettingsBuilder.setMode(_:)`. The current setter is `setMode(_ value: DisplayModes)` (swiftinterface:281); the `setMode(_ value: NSString)` string overload (swiftinterface:280) is DEPRECATED. There is no `LayoutMode`/`.tile`/`.sidebar` |
472
- | `CallLogsRequest` + `CallLogsBuilder` | Paginated call history (note the plural — there is no `CallLogRequest`/`CallLogRequestBuilder`) |
473
- | `CallsEventsDelegate` (protocol) | Lifecycle + media + participant + button events set via `CallSettingsBuilder.setDelegate(_:)` or `CometChatCalls.addCallEventListener(observerId:delegate:)`. (NOT `CometChatCallsEventsListener` that name doesn't exist.) |
474
-
475
- ### UI Kit views (additive mode — `CometChatUIKitSwift`)
476
-
477
- | View / VC | Purpose |
478
- |---|---|
479
- | `CometChatCallButtons` | Voice + video button row (standalone or in `CometChatMessageHeader`) |
480
- | `CometChatIncomingCall` (UIViewController) | Foreground in-app ring UI |
481
- | `CometChatOutgoingCall` (UIViewController) | Dialing UI |
482
- | `CometChatOngoingCall` (UIViewController) | Active call UI hosting WebRTC |
483
- | `CometChatCallLogs` (UIViewController) | Paginated history |
484
-
485
- SwiftUI hosting via `UIViewControllerRepresentable`:
61
+ | `CometChatCallButtons` | Voice/video triggers. **Has NO no-arg initconstruct it as `CometChatCallButtons(width:height:)`.** `set(user:)` **or** `set(group:)`, plus `set(controller:)`. Put it in the message header's slot, not beside it. |
62
+ | `CometChatIncomingCall` | The ringing screen. `set(call:)`, `set(onAcceptClick:)`, `set(onCancelClick:)` **decline is `onCancelClick`, there is no `onDeclineClick`.** |
63
+ | `CometChatOngoingCall` | The in-call surface. `set(sessionId:)` **lowercase `d`**; `set(sessionID:)` does not compile. Also `set(callSettingsBuilder:)`, `set(callWorkFlow:)`. |
64
+ | `CometChatOutgoingCall` | The caller's ringing screen while the other side has not answered. `set(call:)`, `set(onCancelClick:)`. |
65
+ | `CometChatCallLogs` | Call history. See the `Any` warning below this component is the worst offender. |
66
+
67
+ > **`CometChatCallLogs` callbacks are `Any`-typed cast before touching anything.** Unlike every other list component, five of its setters hand back untyped values and will not compile if you use them directly:
68
+ > `set(onItemClick:)` → `(_ callLog: Any)` · `set(onCallButtonClicked:)` → `(Any)` · `set(options:)` → `(_ callLog: Any)` · `set(onLoad:)` → `([Any])` · **`set(onError:)` → `(_ error: Any)`**, not `CometChatException` like everywhere else.
69
+ > ```swift
70
+ > logs.set(onItemClick: { callLog in
71
+ > guard let log = callLog as? CallLog else { return } // NOT `as? Call` — that cast FAILS at
72
+ > … // runtime and makes the tap a silent no-op (measured: RUNTIME TYPE = CallLog).
73
+ > // CallLog exposes status, type, mode, initiator, receiver not the Call spellings
74
+ > // (callStatus/callType/callInitiator/callReceiver). CallLog is a Calls-SDK type.
75
+ > })
76
+ > logs.set(onError: { error in
77
+ > // The value is the CALLS SDK's exception type — casting to the chat SDK's
78
+ > // CometChatException fails and prints nothing useful (measured).
79
+ > debugPrint((error as? CometChatCallException)?.errorDescription ?? "\(error)")
80
+ > })
81
+ > ```
82
+
83
+ > **`sessionID` vs `sessionId` — the same concept, spelled two ways.** The SDK's `Call` exposes **`sessionID`** (capital), while the kit's `CometChatOngoingCall` takes **`set(sessionId:)`** (lowercase). Reading a log and starting a call in the same function means using both spellings; neither compiles in the other's place.
84
+
85
+ Voice/video click handlers on `CometChatCallButtons` are **properties**: `callButtons.onVoiceCallClick = { user, group in … }`, `onVideoCallClick` likewise. And it is `set(callSettingsBuilder:)` — **plural "Settings"**.
86
+
87
+ > **`@MainActor` if you construct these in a factory.** Inside a `UIViewController` this wiring is free (already main-actor). But if you wrap it in a standalone factory/enum/`static` method, mark that context `@MainActor` — the components' setters are main-actor-isolated. **`CometChatOutgoingCall` is the strictest:** unlike `CometChatIncomingCall`/`CometChatCallButtons` it carries no `@preconcurrency`, so under Swift 5 its `set(call:)`/`set(onCancelClick:)` are a HARD ERROR from a nonisolated context ("call to main actor-isolated instance method … in a synchronous nonisolated context"), not just a warning. (Same rule as `cometchat-ios-core`'s `@MainActor`-factory note.)
486
88
 
487
89
  ```swift
488
- struct CallLogsView: UIViewControllerRepresentable {
489
- func makeUIViewController(context: Context) -> CometChatCallLogs { CometChatCallLogs() }
490
- func updateUIViewController(_ vc: CometChatCallLogs, context: Context) {}
491
- }
492
- ```
493
-
494
- ---
495
-
496
- ## 4. Standalone integration
497
-
498
- When `product === "voice-video"` and there is no existing UI Kit.
499
-
500
- **Split by calling mode:**
501
-
502
- ### 4a. Standalone — Session mode (meeting-room UX, no ringing)
503
-
504
- Calls SDK ONLY. NO Chat SDK, NO CallKit, NO PushKit. Matches `calls-sdk-ios-5/sample-apps/cometchat-calls-sample-app-ios/`. Scaffold:
505
-
506
- 1. **App entry** — `CometChatCalls.initFromSettings(onSuccess:onError:)` with a bundled `cometchat-settings.json` (§2) ONLY — builder init is the pre-5.0.2 fallback. No `CometChat.init`, no `CometChat.login`, no PushKit, no CallKit. Note: with no Chat SDK linked, the Calls SDK is the only telemetry reporter here, and its send triggers on `CometChatCalls.login` success / persisted-session restore — if the app has identified users, log them in via `CometChatCalls.login(UID:authKey:)` (5.0.2+, see §1.0 correction) rather than hand-passing an auth token to `generateToken`.
507
- 2. **`JoinSessionView.swift`** UID picker + "Start meeting" / "Join meeting" + state.
508
- 3. **`CallView.swift` + `CallContainerView: UIViewRepresentable`** `CometChatCalls.generateToken(authToken:sessionID:)` then `CometChatCalls.startSession(callToken:callSetting:view:)`. Coordinator conforms to `CallsEventsDelegate` (set via `CallSettingsBuilder.setDelegate`). See `references/call-session.md`.
509
- 4. **`Info.plist` patch** Camera + microphone permissions ONLY. No `audio` or `voip` Background Modes needed.
510
- 5. **Universal Link routing** meeting URL CallView.
511
-
512
- **Why no CallKit / no PushKit:** session mode is link-driven, not push-driven. No incoming ring to surface.
513
-
514
- ### 4b. Standalone Ringing mode (CallKit + PushKit + Chat SDK signaling)
515
-
516
- Dual-SDK + CallKit + PushKit. Scaffold:
517
-
518
- 1. **App entry** — Chat SDK + Calls SDK init (both file-based: `CometChat.init` per `cometchat-ios-core`, then `CometChatCalls.initFromSettings` — §2), PushKit + CallKit registration (rule 1.2, 1.7).
519
- 2. **`CallKitProviderDelegate.swift`** `CXProviderDelegate` implementation. Routes `CXAnswerCallAction` → `CometChatCalls.generateToken` then `startSession(callToken:callSetting:view:)`. Routes `CXEndCallAction` → `CometChatCalls.endSession()` + `AVAudioSession` cleanup (rule 1.5).
520
- 3. **`PushRegistryDelegate.swift`** `PKPushRegistryDelegate` listening on `.voIP`. On payload `CXProvider.reportNewIncomingCall` immediately.
521
- 4. **`ProfileView.swift` (SwiftUI) or `ProfileViewController.swift` (UIKit)** — Hosts call buttons next to user info. Tap → `CometChat.initiateCall`.
522
- 5. **`OngoingCallView.swift`** Custom view hosting the SDK's call surface via `UIViewRepresentable` bridging. Implements rule 1.5 teardown.
523
- 6. **`CallLogsView.swift`** — `/calls` equivalent `CallLogsRequest.CallLogsBuilder`.
524
- 7. **`Info.plist` patch** — Background Modes (rule 1.3), permissions (rule 1.6).
525
- 8. **VoIP Services certificate setup** — manual step (Apple Developer portal + App Store Connect). The skill documents the steps; cannot automate.
526
-
527
- ## 5. Additive integration
528
-
529
- When `cometchat-ios` is already integrated.
530
-
531
- > **Kit-default path FIRST (what the canonical `SampleApp` actually does).** `CometChatCallsSDK` is **vendored inside `CometChatUIKitSwift`** no separate SPM/Pod add, and **no separate `CometChatCalls.init`**. The sample turns calling on with **`UIKitSettings…enable(inAppIncomingCall: true)`** at init (`SampleApp/SceneDelegate.swift`), then just drops in `CometChatCallButtons(...).set(user:)` (e.g. in the user-details screen) and a `CometChatCallLogs` tab — the kit handles `generateToken`/`startSession` and the incoming-call UI internally. You do NOT hand-write `CometChatCalls.init` + a manual `generateToken → startSession` flow on this path. (The manual two-step is the **standalone / custom-UI** path only — §1.1 / §4.)
532
-
533
- The kit-default additive recipe:
534
- 1. Confirm `CometChatUIKitSwift` is present (CallsSDK is bundled — nothing extra to install).
535
- 2. Set **`.enable(inAppIncomingCall: true)`** on the `UIKitSettings` builder at init (the one calling switch). If the integration was scaffolded with **`CometChatUIKit.initFromSettings`** (`cometchat-ios-core` §2 — the skills default), telemetry attribution is already handled on the chat side; the vendored calls framework needs no separate init or attribution step.
536
- 3. Add Background Modes (`voip`, `remote-notification`, `audio`) + camera/mic permissions to `Info.plist`.
537
- 4. Drop in `CometChatCallButtons` (e.g. user-details / contact screen) — the kit also auto-renders them in `CometChatMessageHeader` when CallsSDK is present; add `CometChatCallLogs` as a tab/route.
538
- 5. (Optional) CallKit + PushKit for background VoIP (asks user — same opt-in as Android).
539
-
540
- Only reach for `CometChatCalls.init` + `generateToken`/`startSession` (§1.1) when building a **custom call surface** without the kit's call components.
541
-
542
- ## 6. Anti-patterns
543
-
544
- 1. **Skipping CallKit + PushKit** in standalone mode. The app cannot ring backgrounded/terminated devices any other way. App Store reviewers test this.
545
- 2. **Calling `CXProvider.reportNewIncomingCall` after async work.** Apple terminates the app process if the report happens more than ~5 seconds after PushKit delivery. Report immediately, then do the actual `generateToken` + `startSession` from inside `CXAnswerCallAction`.
546
- 3. **Forgetting `setActive(false, options: .notifyOthersOnDeactivation)`** on hangup. Music/phone-call audio sounds wrong until the next foreground. The "looks fine in dev, fails review" bug.
547
- 4. **Declaring `voip` in `UIBackgroundModes` without using PushKit.** Apple rejects.
548
- 5. **Mixing CallKit and an in-app incoming-call screen** in standalone mode. Causes double-rings and confused state. CallKit owns standalone rings; in-app UI is additive-mode only.
549
- 6. **Using SwiftUI `.alert` for incoming calls.** It only fires when the app is foregrounded. Use CallKit (rule 1.7).
550
- 7. **Pinning `CometChatCallsSDK` to a `4.x`** because that's what the chat SDK is on. They version independently — Calls SDK 5.x is the current calls major.
551
- 8. **Hand-rolling `CallAppSettingsBuilder` init when `initFromSettings` is available (5.0.2+, §2).** The raw builder init re-attributes the integration as `manual` — file-based init is the skills path; the builder is only the pre-5.0.2 fallback.
552
-
553
- ## 7. Verification checklist
554
-
555
- **Static:**
556
-
557
- - [ ] `CometChatCallsSDK` in SPM Package.resolved or Podfile.lock
558
- - [ ] `CometChat.init` followed by `CometChatCalls.initFromSettings` in app entry (builder `CometChatCalls.init` only as the pre-5.0.2 fallback — §2)
559
- - [ ] `cometchat-settings.json` present, has the `callsSDK` section, and listed under Copy Bundle Resources
560
- - [ ] PushKit registry listening on `.voIP`
561
- - [ ] `CXProvider` configured with `CXProviderConfiguration` (app name + ringtone if any)
562
- - [ ] `CXProviderDelegate` implements answer + end actions
563
- - [ ] `Info.plist` has `NSMicrophoneUsageDescription` + `NSCameraUsageDescription`
564
- - [ ] `Info.plist` `UIBackgroundModes` has `audio` + `voip` + `remote-notification`
565
- - [ ] Hangup path includes `endSession` + `setActive(false, options: .notifyOthersOnDeactivation)` + `cxProvider.reportCall(...endedAt:reason:)`
566
- - [ ] **Standalone only:** No in-app incoming-call screen — CallKit owns it
567
-
568
- **Runtime (real device):**
569
-
570
- - [ ] Outgoing call connects, two-way audio + video
571
- - [ ] Incoming call rings on lock screen (device locked + app terminated)
572
- - [ ] Tap "Answer" on lock screen → app opens directly into ongoing call
573
- - [ ] Hangup ends call, camera light off, music resumes if it was playing
574
- - [ ] Background the app during a call → audio continues
575
- - [ ] Lock device during a call → ongoing-call UI on lock screen, audio continues
576
-
577
- ## 8. Pointers
578
-
579
- - `references/audio-modes-and-controls.md` — audio-route switching (speaker/earpiece/Bluetooth) + custom control panel (button-disable matrix)
580
- - `cometchat-ios-core` — Chat SDK init, login, `Secrets.swift` conventions
581
- - `cometchat-ios-components` — full UI Kit catalog (additive mode)
582
- - `cometchat-ios-push` — APNs setup; some overlap with PushKit but distinct (PushKit is VoIP-only)
583
- - `cometchat-ios-production` — server-minted tokens, security checklist
584
- - `cometchat-ios-troubleshooting` — common failure modes (PushKit delivery, CallKit reporting timing, ENABLE_USER_SCRIPT_SANDBOXING)
90
+ // Minimum voice-video-calls wiring — all five components (inside a @MainActor context, e.g. a UIViewController)
91
+ let callButtons = CometChatCallButtons(width: 180, height: 40)
92
+ callButtons.set(user: user) // or .set(group:) for a group call
93
+ callButtons.set(controller: self)
94
+ callButtons.onVoiceCallClick = { user, group in /* initiate voice call */ }
95
+ callButtons.onVideoCallClick = { user, group in /* initiate video call */ }
96
+
97
+ // Present incoming call over any screen via a global app-level listener
98
+ let incoming = CometChatIncomingCall()
99
+ incoming.set(call: incomingCall)
100
+ // accept/cancel closures are TWO-arg: (call: Call?, controller: UIViewController?). A one-arg
101
+ // `{ call in … }` does NOT compile ("expects 2 arguments, but 1 was used").
102
+ incoming.set(onAcceptClick: { call, _ in /* push CometChatOngoingCall */ })
103
+ incoming.set(onCancelClick: { call, _ in self.dismiss(animated: true) })
104
+
105
+ let outgoing = CometChatOutgoingCall()
106
+ outgoing.set(call: pendingCall)
107
+ outgoing.set(onCancelClick: { call, _ in self.dismiss(animated: true) })
108
+
109
+ let ongoing = CometChatOngoingCall()
110
+ // `Call.sessionID` (uppercase D, SDK) is OPTIONAL (String?); `set(sessionId:)` (lowercase d, kit)
111
+ // wants a non-optional String so GUARD it. Passing the optional directly does not compile.
112
+ if let sid = pendingCall.sessionID { ongoing.set(sessionId: sid) }
113
+
114
+ let logs = CometChatCallLogs()
115
+ // NOTE: CometChatCallLogs has NO `set(controller:)` — present/push it like any UIViewController
116
+ // (e.g. UINavigationController(rootViewController: logs)). Its only setters are the Any-typed
117
+ // callbacks below plus set(callRequestBuilder:).
118
+ logs.set(onItemClick: { callLog in guard let log = callLog as? CallLog else { return } /* … */ })
119
+ ```
120
+
121
+ ## Incoming calls are app-level, not screen-level
122
+ A call can arrive on any screen, so listen at the app level (`CometChatCallEventListener` / `CometChatCallEvents`) and present `CometChatIncomingCall` over whatever is showing. Wiring it inside one chat screen means calls are missed everywhere else.
123
+
124
+ ## Permissions and background
125
+ Camera and microphone usage descriptions in `Info.plist`, or the app crashes on first call rather than failing gracefully. Ringing while backgrounded is handled by the **`CometChatPushNotifications`** SDK it owns CallKit + PushKit for you. **Do NOT hand-roll `PKPushRegistryDelegate` / `CXProviderDelegate` or call `UIKitSettings.set(voipToken:)`** (that setter is the legacy path the current docs no longer use). Full VoIP wiring: `cometchat-ios-v5-sdk` § "VoIP call notifications" and `cometchat-ios-push`; needs an APNs VoIP provider in the Dashboard and a physical device.
126
+
127
+ ## Gotchas
128
+ - **Simulator limits.** No camera; a WebRTC surface may behave differently than on device. Verify calling on a real device.
129
+ - **Every call screen needs an exit.** Accept, decline and hang-up must all lead somewhere.
130
+ - **Version lock.** Kit 5.1.22 / SDK 4.1.7 / Calls 5.0.3 are exact; mixing versions fails to build or crashes at runtime.
131
+
132
+ ## Verify it works
133
+ On a device: the call button appears in the header, tapping it rings the other side, the incoming screen shows over whatever was on screen, accept connects with audio and video, hang-up releases camera and microphone, and the call appears in call logs.