@cometchat/skills 4.4.1 → 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 (489) 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/README.md +41 -163
  5. package/RULES.md +114 -0
  6. package/bin/cometchat-skills.mjs +1180 -0
  7. package/bin/legacy-skills.json +95 -0
  8. package/catalogs/android-v6.json +1646 -0
  9. package/catalogs/flutter-v6.json +651 -0
  10. package/catalogs/ios-v5.json +1383 -0
  11. package/catalogs/rn-calls-v5.json +134 -0
  12. package/catalogs/rn-calls-v5.symbols.txt +58 -0
  13. package/catalogs/rn-sdk-v4.json +672 -0
  14. package/catalogs/rn-v5.json +449 -0
  15. package/catalogs/rn-v5.symbols.txt +216 -0
  16. package/catalogs/sdk-android-v5.json +514 -0
  17. package/contracts.android-calls-v5.json +122 -0
  18. package/contracts.android-v6.json +135 -0
  19. package/contracts.angular-v5.json +694 -0
  20. package/contracts.flutter-calls-v5.json +77 -0
  21. package/contracts.flutter-v6.json +126 -0
  22. package/contracts.ios-calls-v5.json +67 -0
  23. package/contracts.ios-v5.json +436 -0
  24. package/contracts.json +82 -0
  25. package/contracts.rn-calls-v5.json +77 -0
  26. package/contracts.rn-v5.json +727 -0
  27. package/contracts.sdk-android-v5.json +15 -0
  28. package/contracts.web-calls-v5.json +45 -0
  29. package/features.android-calls-v5.json +246 -0
  30. package/features.android-v6.json +65 -0
  31. package/features.angular-v5.json +521 -0
  32. package/features.flutter-calls-v5.json +286 -0
  33. package/features.flutter-v6.json +484 -0
  34. package/features.ios-calls-v5.json +236 -0
  35. package/features.ios-v5.json +573 -0
  36. package/features.json +61 -0
  37. package/features.rn-calls-v5.json +187 -0
  38. package/features.rn-v5.json +614 -0
  39. package/features.sdk-android-v5.json +40 -0
  40. package/features.sdk-jsv4.json +24 -0
  41. package/features.web-calls-v5.json +108 -0
  42. package/package.json +151 -74
  43. package/peers.yaml +312 -0
  44. package/registry/README.md +31 -0
  45. package/registry/android-calls-v5.json +54 -0
  46. package/registry/android-v6.json +137 -0
  47. package/registry/angular-v5.json +114 -0
  48. package/registry/flutter-calls-v5.json +54 -0
  49. package/registry/flutter-v6.json +119 -0
  50. package/registry/ios-calls-v5.json +59 -0
  51. package/registry/ios-v5.json +97 -0
  52. package/registry/rn-calls-v5.json +59 -0
  53. package/registry/rn-v5.json +129 -0
  54. package/registry/sdk-android-v5.json +53 -0
  55. package/registry/sdk-jsv4.json +53 -0
  56. package/registry/web-calls-v5.json +54 -0
  57. package/registry/web-v7.json +99 -0
  58. package/skills/cometchat/SKILL.md +42 -2096
  59. package/skills/cometchat-android-v5-calls-sdk/SKILL.md +206 -0
  60. package/skills/cometchat-android-v5-calls-sdk/references/build-truth.md +63 -0
  61. package/skills/cometchat-android-v5-calls-sdk/references/docs-map.md +119 -0
  62. package/skills/cometchat-android-v5-calls-sdk/references/method-map.md +53 -0
  63. package/skills/cometchat-android-v5-calls-sdk/references/pitfalls.md +72 -0
  64. package/skills/cometchat-android-v5-calls-sdk/references/ringing.md +92 -0
  65. package/skills/cometchat-android-v5-calls-sdk/references/user-switch.md +90 -0
  66. package/skills/cometchat-android-v5-sdk/SKILL.md +127 -0
  67. package/skills/cometchat-android-v5-sdk/references/app-surface.md +88 -0
  68. package/skills/cometchat-android-v5-sdk/references/docs-map.md +91 -0
  69. package/skills/cometchat-android-v6-builder-settings/SKILL.md +51 -137
  70. package/skills/cometchat-android-v6-calls/SKILL.md +128 -411
  71. package/skills/cometchat-android-v6-compose-components/SKILL.md +84 -194
  72. package/skills/cometchat-android-v6-compose-customization/SKILL.md +66 -411
  73. package/skills/cometchat-android-v6-compose-placement/SKILL.md +154 -237
  74. package/skills/cometchat-android-v6-core/SKILL.md +236 -672
  75. package/skills/cometchat-android-v6-core/references/anti-patterns.md +31 -0
  76. package/skills/cometchat-android-v6-core/references/component-props.md +168 -0
  77. package/skills/cometchat-android-v6-core/references/docs-map.md +153 -0
  78. package/skills/cometchat-android-v6-core/references/layout.md +112 -0
  79. package/skills/cometchat-android-v6-core/references/lifecycle.md +75 -0
  80. package/skills/cometchat-android-v6-core/references/setup-credentials.md +105 -0
  81. package/skills/cometchat-android-v6-core/references/troubleshooting.md +36 -0
  82. package/skills/cometchat-android-v6-events/SKILL.md +46 -184
  83. package/skills/cometchat-android-v6-extensions/SKILL.md +39 -179
  84. package/skills/cometchat-android-v6-features/SKILL.md +74 -143
  85. package/skills/cometchat-android-v6-kotlin-components/SKILL.md +75 -193
  86. package/skills/cometchat-android-v6-kotlin-customization/SKILL.md +67 -419
  87. package/skills/cometchat-android-v6-kotlin-placement/SKILL.md +77 -223
  88. package/skills/cometchat-android-v6-migration/SKILL.md +67 -378
  89. package/skills/cometchat-android-v6-production/SKILL.md +40 -179
  90. package/skills/cometchat-android-v6-push/SKILL.md +39 -289
  91. package/skills/cometchat-android-v6-testing/SKILL.md +50 -265
  92. package/skills/cometchat-android-v6-troubleshooting/SKILL.md +70 -254
  93. package/skills/cometchat-angular-v5-calls/SKILL.md +193 -0
  94. package/skills/cometchat-angular-v5-components/SKILL.md +131 -0
  95. package/skills/cometchat-angular-v5-components/references/catalog.md +111 -0
  96. package/skills/cometchat-angular-v5-components/references/host-composed.md +46 -0
  97. package/skills/cometchat-angular-v5-core/SKILL.md +300 -0
  98. package/skills/cometchat-angular-v5-core/references/anti-patterns.md +49 -0
  99. package/skills/cometchat-angular-v5-core/references/component-props.md +55 -0
  100. package/skills/cometchat-angular-v5-core/references/dependencies.md +66 -0
  101. package/skills/cometchat-angular-v5-core/references/docs-map.md +132 -0
  102. package/skills/cometchat-angular-v5-core/references/layout.md +64 -0
  103. package/skills/cometchat-angular-v5-core/references/lifecycle.md +202 -0
  104. package/skills/cometchat-angular-v5-core/references/setup-credentials.md +137 -0
  105. package/skills/cometchat-angular-v5-core/references/theming.md +70 -0
  106. package/skills/cometchat-angular-v5-core/references/troubleshooting.md +27 -0
  107. package/skills/cometchat-angular-v5-customization/SKILL.md +94 -0
  108. package/skills/cometchat-angular-v5-features/SKILL.md +107 -0
  109. package/skills/cometchat-angular-v5-features/references/custom-messages.md +133 -0
  110. package/skills/cometchat-angular-v5-features/references/formatters.md +28 -0
  111. package/skills/cometchat-angular-v5-features/references/host-composed-extensions.md +85 -0
  112. package/skills/cometchat-angular-v5-migration/SKILL.md +40 -0
  113. package/skills/cometchat-angular-v5-migration/references/migration-guide.md +165 -0
  114. package/skills/cometchat-angular-v5-patterns/SKILL.md +107 -0
  115. package/skills/cometchat-angular-v5-placement/SKILL.md +133 -0
  116. package/skills/cometchat-angular-v5-placement/references/combined-app.md +174 -0
  117. package/skills/cometchat-angular-v5-placement/references/core-surface.md +199 -0
  118. package/skills/cometchat-angular-v5-production/SKILL.md +101 -0
  119. package/skills/cometchat-angular-v5-push/SKILL.md +61 -0
  120. package/skills/cometchat-angular-v5-testing/SKILL.md +112 -0
  121. package/skills/cometchat-angular-v5-troubleshooting/SKILL.md +96 -0
  122. package/skills/cometchat-flutter-v5-sdk/SKILL.md +188 -0
  123. package/skills/cometchat-flutter-v5-sdk/references/doc-corrections.md +55 -0
  124. package/skills/cometchat-flutter-v5-sdk/references/docs-map.md +211 -0
  125. package/skills/cometchat-flutter-v5-sdk/references/platform-notes.md +48 -0
  126. package/skills/cometchat-flutter-v5-sdk/references/transcription.md +87 -0
  127. package/skills/cometchat-flutter-v6-calls/SKILL.md +75 -387
  128. package/skills/cometchat-flutter-v6-components/SKILL.md +88 -361
  129. package/skills/cometchat-flutter-v6-core/SKILL.md +154 -593
  130. package/skills/cometchat-flutter-v6-core/references/anti-patterns.md +55 -0
  131. package/skills/cometchat-flutter-v6-core/references/docs-map.md +143 -0
  132. package/skills/cometchat-flutter-v6-core/references/layout.md +45 -0
  133. package/skills/cometchat-flutter-v6-core/references/lifecycle.md +87 -0
  134. package/skills/cometchat-flutter-v6-core/references/setup-credentials.md +84 -0
  135. package/skills/cometchat-flutter-v6-core/references/troubleshooting.md +26 -0
  136. package/skills/cometchat-flutter-v6-customization/SKILL.md +70 -712
  137. package/skills/cometchat-flutter-v6-events/SKILL.md +79 -174
  138. package/skills/cometchat-flutter-v6-features/SKILL.md +55 -394
  139. package/skills/cometchat-flutter-v6-migration/SKILL.md +68 -367
  140. package/skills/cometchat-flutter-v6-migration/references/migration-guide.md +131 -0
  141. package/skills/cometchat-flutter-v6-patterns/SKILL.md +61 -0
  142. package/skills/cometchat-flutter-v6-placement/SKILL.md +94 -381
  143. package/skills/cometchat-flutter-v6-production/SKILL.md +58 -615
  144. package/skills/cometchat-flutter-v6-push/SKILL.md +46 -455
  145. package/skills/cometchat-flutter-v6-testing/SKILL.md +68 -299
  146. package/skills/cometchat-flutter-v6-troubleshooting/SKILL.md +54 -878
  147. package/skills/cometchat-ios-calls/SKILL.md +105 -511
  148. package/skills/cometchat-ios-components/SKILL.md +44 -834
  149. package/skills/cometchat-ios-core/SKILL.md +181 -1068
  150. package/skills/cometchat-ios-core/references/anti-patterns.md +80 -0
  151. package/skills/cometchat-ios-core/references/docs-map.md +123 -0
  152. package/skills/cometchat-ios-core/references/install.md +23 -0
  153. package/skills/cometchat-ios-core/references/layout.md +186 -0
  154. package/skills/cometchat-ios-core/references/setup-credentials.md +197 -0
  155. package/skills/cometchat-ios-core/references/swiftui.md +91 -0
  156. package/skills/cometchat-ios-core/references/troubleshooting.md +100 -0
  157. package/skills/cometchat-ios-customization/SKILL.md +33 -968
  158. package/skills/cometchat-ios-features/SKILL.md +29 -738
  159. package/skills/cometchat-ios-migration/SKILL.md +39 -0
  160. package/skills/cometchat-ios-placement/SKILL.md +51 -729
  161. package/skills/cometchat-ios-push/SKILL.md +24 -602
  162. package/skills/cometchat-ios-v5-sdk/SKILL.md +161 -0
  163. package/skills/cometchat-ios-v5-sdk/references/docs-map.md +326 -0
  164. package/skills/cometchat-js-v5-sdk/SKILL.md +95 -0
  165. package/skills/cometchat-js-v5-sdk/references/docs-map.md +114 -0
  166. package/skills/cometchat-onboarding/SKILL.md +89 -0
  167. package/skills/cometchat-onboarding/references/archetypes.md +51 -0
  168. package/skills/cometchat-onboarding/references/calling-first.md +77 -0
  169. package/skills/cometchat-onboarding/references/not-in-this-pack.md +8 -0
  170. package/skills/cometchat-onboarding/references/plan-artifact.md +133 -0
  171. package/skills/cometchat-onboarding/references/platforms.md +90 -0
  172. package/skills/cometchat-react-native-bare-patterns/SKILL.md +120 -0
  173. package/skills/cometchat-react-native-calls/SKILL.md +200 -0
  174. package/skills/cometchat-react-native-components/SKILL.md +142 -0
  175. package/skills/cometchat-react-native-core/SKILL.md +313 -0
  176. package/skills/cometchat-react-native-core/references/anti-patterns.md +79 -0
  177. package/skills/cometchat-react-native-core/references/component-props.md +105 -0
  178. package/skills/cometchat-react-native-core/references/dependencies.md +62 -0
  179. package/skills/cometchat-react-native-core/references/docs-map.md +126 -0
  180. package/skills/cometchat-react-native-core/references/layout.md +61 -0
  181. package/skills/cometchat-react-native-core/references/lifecycle.md +64 -0
  182. package/skills/cometchat-react-native-core/references/setup-credentials.md +39 -0
  183. package/skills/cometchat-react-native-customization/SKILL.md +198 -0
  184. package/skills/cometchat-react-native-expo-patterns/SKILL.md +116 -0
  185. package/skills/cometchat-react-native-features/SKILL.md +122 -0
  186. package/skills/cometchat-react-native-migration/SKILL.md +103 -0
  187. package/skills/cometchat-react-native-placement/SKILL.md +158 -0
  188. package/skills/cometchat-react-native-production/SKILL.md +78 -0
  189. package/skills/cometchat-react-native-push/SKILL.md +88 -0
  190. package/skills/cometchat-react-native-sdk/SKILL.md +126 -0
  191. package/skills/cometchat-react-native-sdk/references/method-map.md +239 -0
  192. package/skills/cometchat-react-native-sdk/references/page-map.md +96 -0
  193. package/skills/cometchat-react-native-testing/SKILL.md +94 -0
  194. package/skills/cometchat-react-native-troubleshooting/SKILL.md +116 -0
  195. package/skills/cometchat-react-native-v5-sdk/SKILL.md +150 -0
  196. package/skills/cometchat-react-native-v5-sdk/references/docs-map.md +127 -0
  197. package/skills/cometchat-react-native-v5-sdk/references/ringing-voip.md +369 -0
  198. package/skills/cometchat-react-v7-calls/SKILL.md +75 -0
  199. package/skills/cometchat-react-v7-components/SKILL.md +72 -0
  200. package/skills/cometchat-react-v7-core/SKILL.md +101 -0
  201. package/skills/cometchat-react-v7-core/references/anti-patterns.md +19 -0
  202. package/skills/cometchat-react-v7-core/references/component-props.md +82 -0
  203. package/skills/cometchat-react-v7-core/references/dependencies.md +23 -0
  204. package/skills/cometchat-react-v7-core/references/docs-map.md +117 -0
  205. package/skills/cometchat-react-v7-core/references/i18n-rtl-a11y.md +22 -0
  206. package/skills/cometchat-react-v7-core/references/layout.md +158 -0
  207. package/skills/cometchat-react-v7-core/references/lifecycle.md +74 -0
  208. package/skills/cometchat-react-v7-core/references/setup-credentials.md +58 -0
  209. package/skills/cometchat-react-v7-core/references/ssr.md +11 -0
  210. package/skills/cometchat-react-v7-core/references/theming.md +52 -0
  211. package/skills/cometchat-react-v7-core/references/troubleshooting.md +28 -0
  212. package/skills/cometchat-react-v7-customization/SKILL.md +84 -0
  213. package/skills/cometchat-react-v7-features/SKILL.md +92 -0
  214. package/skills/cometchat-react-v7-migration/SKILL.md +39 -0
  215. package/skills/cometchat-react-v7-migration/references/migration-guide.md +119 -0
  216. package/skills/cometchat-react-v7-patterns/SKILL.md +43 -0
  217. package/skills/cometchat-react-v7-placement/SKILL.md +106 -0
  218. package/skills/cometchat-react-v7-placement/references/recipes.md +354 -0
  219. package/skills/cometchat-react-v7-push/SKILL.md +53 -0
  220. package/test-suite/README.md +70 -0
  221. package/test-suite/catalogs/android-calls-v5.json +830 -0
  222. package/test-suite/catalogs/android-calls-v5.symbols.txt +499 -0
  223. package/test-suite/catalogs/android-v6.json +1646 -0
  224. package/test-suite/catalogs/android-v6.symbols.txt +298 -0
  225. package/test-suite/catalogs/angular-v5.json +7587 -0
  226. package/test-suite/catalogs/flutter-calls-v5.json +196 -0
  227. package/test-suite/catalogs/flutter-calls-v5.symbols.txt +59 -0
  228. package/test-suite/catalogs/flutter-v6.json +651 -0
  229. package/test-suite/catalogs/ios-calls-v5.json +158 -0
  230. package/test-suite/catalogs/ios-calls-v5.symbols.txt +70 -0
  231. package/test-suite/catalogs/ios-v5.json +1383 -0
  232. package/test-suite/catalogs/ios-v5.symbols.txt +699 -0
  233. package/test-suite/catalogs/rn-calls-v5.json +134 -0
  234. package/test-suite/catalogs/rn-sdk-v4.json +672 -0
  235. package/test-suite/catalogs/rn-v5.json +449 -0
  236. package/test-suite/catalogs/sdk-android-v5.json +514 -0
  237. package/test-suite/catalogs/sdk-android-v5.symbols.txt +254 -0
  238. package/test-suite/catalogs/sdk-jsv4.json +800 -0
  239. package/test-suite/catalogs/web-calls-v5.json +195 -0
  240. package/test-suite/catalogs/web-v7.json +1243 -0
  241. package/test-suite/scripts/build-registry.mjs +113 -0
  242. package/test-suite/scripts/catalog-refresh-dart.mjs +151 -0
  243. package/test-suite/scripts/catalog-refresh.mjs +100 -0
  244. package/test-suite/scripts/lint-skills.mjs +909 -0
  245. package/test-suite/scripts/measure-tokens.mjs +169 -0
  246. package/test-suite/scripts/typecheck-fences-dart.mjs +437 -0
  247. package/test-suite/scripts/typecheck-fences-kotlin.mjs +269 -0
  248. package/test-suite/scripts/typecheck-fences.mjs +206 -0
  249. package/test-suite/scripts/verify-catalog.mjs +242 -0
  250. package/test-suite/scripts/verify-contract-fences.mjs +94 -0
  251. package/test-suite/scripts/verify-detection.mjs +178 -0
  252. package/test-suite/scripts/verify-docs-base.mjs +91 -0
  253. package/test-suite/scripts/verify-family-agnostic.mjs +130 -0
  254. package/test-suite/scripts/verify-golden-path.mjs +138 -0
  255. package/test-suite/scripts/verify-oracle-components.mjs +133 -0
  256. package/test-suite/scripts/verify-template-bindings.mjs +148 -0
  257. package/test-suite/typecheck/angular-v5/package.json +21 -0
  258. package/test-suite/typecheck/angular-v5/tsconfig.json +21 -0
  259. package/test-suite/typecheck/flutter-v6/analysis_options.yaml +25 -0
  260. package/test-suite/typecheck/flutter-v6/pubspec.yaml +21 -0
  261. package/test-suite/typecheck/web-v7/package.json +18 -0
  262. package/test-suite/typecheck/web-v7/tsconfig.json +19 -0
  263. package/bin/install.js +0 -1003
  264. package/skills/.claude-plugin/marketplace.json +0 -86
  265. package/skills/cometchat/references/asking-questions.md +0 -48
  266. package/skills/cometchat-a11y/SKILL.md +0 -477
  267. package/skills/cometchat-android-v5/SKILL.md +0 -121
  268. package/skills/cometchat-android-v5-calls/SKILL.md +0 -427
  269. package/skills/cometchat-android-v5-calls/references/README.md +0 -53
  270. package/skills/cometchat-android-v5-calls/references/add-calls-to-existing-chat.md +0 -197
  271. package/skills/cometchat-android-v5-calls/references/audio-controls.md +0 -91
  272. package/skills/cometchat-android-v5-calls/references/background-handling.md +0 -168
  273. package/skills/cometchat-android-v5-calls/references/call-layouts.md +0 -131
  274. package/skills/cometchat-android-v5-calls/references/call-logs.md +0 -113
  275. package/skills/cometchat-android-v5-calls/references/call-session.md +0 -274
  276. package/skills/cometchat-android-v5-calls/references/custom-ui.md +0 -150
  277. package/skills/cometchat-android-v5-calls/references/event-listeners.md +0 -123
  278. package/skills/cometchat-android-v5-calls/references/group-calls.md +0 -205
  279. package/skills/cometchat-android-v5-calls/references/idle-timeout.md +0 -117
  280. package/skills/cometchat-android-v5-calls/references/in-call-chat.md +0 -134
  281. package/skills/cometchat-android-v5-calls/references/join-session.md +0 -120
  282. package/skills/cometchat-android-v5-calls/references/migration-v4-to-v5.md +0 -222
  283. package/skills/cometchat-android-v5-calls/references/participant-management.md +0 -110
  284. package/skills/cometchat-android-v5-calls/references/picture-in-picture.md +0 -106
  285. package/skills/cometchat-android-v5-calls/references/raise-hand.md +0 -248
  286. package/skills/cometchat-android-v5-calls/references/recording.md +0 -101
  287. package/skills/cometchat-android-v5-calls/references/ringing-integration.md +0 -152
  288. package/skills/cometchat-android-v5-calls/references/screen-sharing.md +0 -78
  289. package/skills/cometchat-android-v5-calls/references/server-fcm-voip.md +0 -215
  290. package/skills/cometchat-android-v5-calls/references/session-settings.md +0 -121
  291. package/skills/cometchat-android-v5-calls/references/setup.md +0 -137
  292. package/skills/cometchat-android-v5-calls/references/share-invite.md +0 -156
  293. package/skills/cometchat-android-v5-calls/references/video-controls.md +0 -87
  294. package/skills/cometchat-android-v5-calls/references/voip-calling.md +0 -526
  295. package/skills/cometchat-android-v5-components/SKILL.md +0 -431
  296. package/skills/cometchat-android-v5-core/SKILL.md +0 -486
  297. package/skills/cometchat-android-v5-customization/SKILL.md +0 -469
  298. package/skills/cometchat-android-v5-extensions/SKILL.md +0 -127
  299. package/skills/cometchat-android-v5-features/SKILL.md +0 -131
  300. package/skills/cometchat-android-v5-placement/SKILL.md +0 -277
  301. package/skills/cometchat-android-v5-production/SKILL.md +0 -95
  302. package/skills/cometchat-android-v5-push/SKILL.md +0 -619
  303. package/skills/cometchat-android-v5-testing/SKILL.md +0 -188
  304. package/skills/cometchat-android-v5-theming/SKILL.md +0 -167
  305. package/skills/cometchat-android-v5-troubleshooting/SKILL.md +0 -74
  306. package/skills/cometchat-android-v6/SKILL.md +0 -108
  307. package/skills/cometchat-android-v6-calls/references/add-calls-to-existing-chat.md +0 -97
  308. package/skills/cometchat-android-v6-calls/references/advanced-features.md +0 -87
  309. package/skills/cometchat-android-v6-calls/references/call-layouts.md +0 -100
  310. package/skills/cometchat-android-v6-calls/references/call-session.md +0 -163
  311. package/skills/cometchat-android-v6-calls/references/device-management.md +0 -172
  312. package/skills/cometchat-android-v6-calls/references/group-calls.md +0 -191
  313. package/skills/cometchat-android-v6-calls/references/idle-timeout.md +0 -110
  314. package/skills/cometchat-android-v6-calls/references/in-call-chat.md +0 -141
  315. package/skills/cometchat-android-v6-calls/references/raise-hand.md +0 -188
  316. package/skills/cometchat-android-v6-calls/references/ringing-integration.md +0 -176
  317. package/skills/cometchat-android-v6-calls/references/server-fcm-voip.md +0 -127
  318. package/skills/cometchat-android-v6-calls/references/share-invite.md +0 -105
  319. package/skills/cometchat-android-v6-compose-theming/SKILL.md +0 -250
  320. package/skills/cometchat-android-v6-kotlin-theming/SKILL.md +0 -233
  321. package/skills/cometchat-angular-calls/SKILL.md +0 -378
  322. package/skills/cometchat-angular-calls/references/add-calls-to-existing-chat.md +0 -96
  323. package/skills/cometchat-angular-calls/references/call-layouts.md +0 -123
  324. package/skills/cometchat-angular-calls/references/call-session.md +0 -167
  325. package/skills/cometchat-angular-calls/references/custom-ui.md +0 -239
  326. package/skills/cometchat-angular-calls/references/device-management.md +0 -154
  327. package/skills/cometchat-angular-calls/references/group-calls.md +0 -433
  328. package/skills/cometchat-angular-calls/references/idle-timeout.md +0 -161
  329. package/skills/cometchat-angular-calls/references/in-call-chat.md +0 -148
  330. package/skills/cometchat-angular-calls/references/lazy-loading-pitfalls.md +0 -205
  331. package/skills/cometchat-angular-calls/references/migration-v4-to-v5.md +0 -53
  332. package/skills/cometchat-angular-calls/references/ngzone-and-async-callbacks.md +0 -184
  333. package/skills/cometchat-angular-calls/references/picture-in-picture.md +0 -285
  334. package/skills/cometchat-angular-calls/references/raise-hand.md +0 -172
  335. package/skills/cometchat-angular-calls/references/recording-screen-share.md +0 -260
  336. package/skills/cometchat-angular-calls/references/ringing-integration.md +0 -133
  337. package/skills/cometchat-angular-calls/references/server-web-push-vapid.md +0 -100
  338. package/skills/cometchat-angular-calls/references/share-invite.md +0 -122
  339. package/skills/cometchat-angular-calls/references/virtual-background.md +0 -29
  340. package/skills/cometchat-angular-components/SKILL.md +0 -235
  341. package/skills/cometchat-angular-core/SKILL.md +0 -386
  342. package/skills/cometchat-angular-customization/SKILL.md +0 -616
  343. package/skills/cometchat-angular-features/SKILL.md +0 -329
  344. package/skills/cometchat-angular-patterns/SKILL.md +0 -256
  345. package/skills/cometchat-angular-placement/SKILL.md +0 -314
  346. package/skills/cometchat-angular-production/SKILL.md +0 -564
  347. package/skills/cometchat-angular-push/SKILL.md +0 -389
  348. package/skills/cometchat-angular-testing/SKILL.md +0 -605
  349. package/skills/cometchat-angular-theming/SKILL.md +0 -290
  350. package/skills/cometchat-angular-troubleshooting/SKILL.md +0 -364
  351. package/skills/cometchat-astro-patterns/SKILL.md +0 -708
  352. package/skills/cometchat-calls/SKILL.md +0 -364
  353. package/skills/cometchat-calls/references/use-case-broadcast.md +0 -199
  354. package/skills/cometchat-calls/references/use-case-marketplace.md +0 -157
  355. package/skills/cometchat-calls/references/use-case-support.md +0 -189
  356. package/skills/cometchat-calls/references/use-case-team.md +0 -180
  357. package/skills/cometchat-calls/references/use-case-telehealth.md +0 -153
  358. package/skills/cometchat-components/SKILL.md +0 -1142
  359. package/skills/cometchat-core/SKILL.md +0 -1048
  360. package/skills/cometchat-customization/SKILL.md +0 -580
  361. package/skills/cometchat-customization/references/component-catalog.md +0 -236
  362. package/skills/cometchat-features/SKILL.md +0 -861
  363. package/skills/cometchat-flutter-v5/SKILL.md +0 -173
  364. package/skills/cometchat-flutter-v5-calls/SKILL.md +0 -453
  365. package/skills/cometchat-flutter-v5-calls/references/add-calls-to-existing-chat.md +0 -193
  366. package/skills/cometchat-flutter-v5-calls/references/call-layouts.md +0 -103
  367. package/skills/cometchat-flutter-v5-calls/references/call-session.md +0 -285
  368. package/skills/cometchat-flutter-v5-calls/references/device-management.md +0 -124
  369. package/skills/cometchat-flutter-v5-calls/references/group-calls.md +0 -181
  370. package/skills/cometchat-flutter-v5-calls/references/idle-timeout.md +0 -99
  371. package/skills/cometchat-flutter-v5-calls/references/in-call-chat.md +0 -135
  372. package/skills/cometchat-flutter-v5-calls/references/migration-v4-to-v5.md +0 -210
  373. package/skills/cometchat-flutter-v5-calls/references/raise-hand.md +0 -255
  374. package/skills/cometchat-flutter-v5-calls/references/ringing-integration.md +0 -196
  375. package/skills/cometchat-flutter-v5-calls/references/server-push-bridge.md +0 -101
  376. package/skills/cometchat-flutter-v5-calls/references/share-invite.md +0 -148
  377. package/skills/cometchat-flutter-v5-conversations/SKILL.md +0 -118
  378. package/skills/cometchat-flutter-v5-core/SKILL.md +0 -239
  379. package/skills/cometchat-flutter-v5-customization/SKILL.md +0 -358
  380. package/skills/cometchat-flutter-v5-events/SKILL.md +0 -156
  381. package/skills/cometchat-flutter-v5-messages/SKILL.md +0 -259
  382. package/skills/cometchat-flutter-v5-production/SKILL.md +0 -216
  383. package/skills/cometchat-flutter-v5-push/SKILL.md +0 -285
  384. package/skills/cometchat-flutter-v5-testing/SKILL.md +0 -401
  385. package/skills/cometchat-flutter-v5-theming/SKILL.md +0 -161
  386. package/skills/cometchat-flutter-v5-troubleshooting/SKILL.md +0 -130
  387. package/skills/cometchat-flutter-v5-users-groups/SKILL.md +0 -152
  388. package/skills/cometchat-flutter-v6/SKILL.md +0 -446
  389. package/skills/cometchat-flutter-v6-calls/references/add-calls-to-existing-chat.md +0 -136
  390. package/skills/cometchat-flutter-v6-calls/references/advanced-features.md +0 -89
  391. package/skills/cometchat-flutter-v6-calls/references/call-layouts.md +0 -105
  392. package/skills/cometchat-flutter-v6-calls/references/call-session.md +0 -229
  393. package/skills/cometchat-flutter-v6-calls/references/device-management.md +0 -105
  394. package/skills/cometchat-flutter-v6-calls/references/group-calls.md +0 -190
  395. package/skills/cometchat-flutter-v6-calls/references/idle-timeout.md +0 -88
  396. package/skills/cometchat-flutter-v6-calls/references/in-call-chat.md +0 -125
  397. package/skills/cometchat-flutter-v6-calls/references/raise-hand.md +0 -275
  398. package/skills/cometchat-flutter-v6-calls/references/ringing-integration.md +0 -171
  399. package/skills/cometchat-flutter-v6-calls/references/server-push-bridge.md +0 -93
  400. package/skills/cometchat-flutter-v6-calls/references/share-invite.md +0 -102
  401. package/skills/cometchat-flutter-v6-conversations/SKILL.md +0 -238
  402. package/skills/cometchat-flutter-v6-messages/SKILL.md +0 -384
  403. package/skills/cometchat-flutter-v6-theming/SKILL.md +0 -293
  404. package/skills/cometchat-flutter-v6-users-groups/SKILL.md +0 -224
  405. package/skills/cometchat-i18n/SKILL.md +0 -419
  406. package/skills/cometchat-ios/SKILL.md +0 -325
  407. package/skills/cometchat-ios-calls/references/add-calls-to-existing-chat.md +0 -174
  408. package/skills/cometchat-ios-calls/references/audio-modes-and-controls.md +0 -45
  409. package/skills/cometchat-ios-calls/references/avaudiosession-routing.md +0 -188
  410. package/skills/cometchat-ios-calls/references/call-layouts.md +0 -76
  411. package/skills/cometchat-ios-calls/references/call-session.md +0 -218
  412. package/skills/cometchat-ios-calls/references/callkit-and-pushkit.md +0 -357
  413. package/skills/cometchat-ios-calls/references/custom-ui.md +0 -322
  414. package/skills/cometchat-ios-calls/references/device-management.md +0 -171
  415. package/skills/cometchat-ios-calls/references/group-calls.md +0 -359
  416. package/skills/cometchat-ios-calls/references/idle-timeout.md +0 -184
  417. package/skills/cometchat-ios-calls/references/in-call-chat.md +0 -179
  418. package/skills/cometchat-ios-calls/references/migration-v4-to-v5.md +0 -196
  419. package/skills/cometchat-ios-calls/references/picture-in-picture.md +0 -246
  420. package/skills/cometchat-ios-calls/references/raise-hand.md +0 -26
  421. package/skills/cometchat-ios-calls/references/recording-screen-share.md +0 -252
  422. package/skills/cometchat-ios-calls/references/ringing-integration.md +0 -143
  423. package/skills/cometchat-ios-calls/references/server-apns-pushkit.md +0 -267
  424. package/skills/cometchat-ios-calls/references/share-invite.md +0 -148
  425. package/skills/cometchat-ios-calls/references/swiftui-uikit-hosting.md +0 -246
  426. package/skills/cometchat-ios-calls/references/voip-cert-setup.md +0 -166
  427. package/skills/cometchat-ios-production/SKILL.md +0 -738
  428. package/skills/cometchat-ios-testing/SKILL.md +0 -376
  429. package/skills/cometchat-ios-theming/SKILL.md +0 -667
  430. package/skills/cometchat-ios-troubleshooting/SKILL.md +0 -1003
  431. package/skills/cometchat-native-bare-patterns/SKILL.md +0 -550
  432. package/skills/cometchat-native-calls/SKILL.md +0 -669
  433. package/skills/cometchat-native-calls/references/add-calls-to-existing-chat.md +0 -203
  434. package/skills/cometchat-native-calls/references/call-layouts.md +0 -125
  435. package/skills/cometchat-native-calls/references/call-session.md +0 -182
  436. package/skills/cometchat-native-calls/references/custom-ui.md +0 -254
  437. package/skills/cometchat-native-calls/references/device-management.md +0 -158
  438. package/skills/cometchat-native-calls/references/expo-vs-bare.md +0 -179
  439. package/skills/cometchat-native-calls/references/group-calls.md +0 -296
  440. package/skills/cometchat-native-calls/references/idle-timeout.md +0 -128
  441. package/skills/cometchat-native-calls/references/in-call-chat.md +0 -145
  442. package/skills/cometchat-native-calls/references/migration-v4-to-v5.md +0 -72
  443. package/skills/cometchat-native-calls/references/picture-in-picture.md +0 -276
  444. package/skills/cometchat-native-calls/references/raise-hand.md +0 -205
  445. package/skills/cometchat-native-calls/references/recording-screen-share.md +0 -169
  446. package/skills/cometchat-native-calls/references/ringing-integration.md +0 -118
  447. package/skills/cometchat-native-calls/references/server-push-bridge.md +0 -135
  448. package/skills/cometchat-native-calls/references/server-push-payloads.md +0 -193
  449. package/skills/cometchat-native-calls/references/share-invite.md +0 -146
  450. package/skills/cometchat-native-calls/references/voip-push-end-to-end.md +0 -319
  451. package/skills/cometchat-native-components/SKILL.md +0 -628
  452. package/skills/cometchat-native-core/SKILL.md +0 -679
  453. package/skills/cometchat-native-customization/SKILL.md +0 -716
  454. package/skills/cometchat-native-expo-patterns/SKILL.md +0 -552
  455. package/skills/cometchat-native-features/SKILL.md +0 -638
  456. package/skills/cometchat-native-placement/SKILL.md +0 -509
  457. package/skills/cometchat-native-production/SKILL.md +0 -700
  458. package/skills/cometchat-native-push/SKILL.md +0 -594
  459. package/skills/cometchat-native-testing/SKILL.md +0 -582
  460. package/skills/cometchat-native-theming/SKILL.md +0 -681
  461. package/skills/cometchat-native-troubleshooting/SKILL.md +0 -501
  462. package/skills/cometchat-nextjs-patterns/SKILL.md +0 -899
  463. package/skills/cometchat-placement/SKILL.md +0 -1360
  464. package/skills/cometchat-production/SKILL.md +0 -1027
  465. package/skills/cometchat-react-calls/SKILL.md +0 -749
  466. package/skills/cometchat-react-calls/references/add-calls-to-existing-chat.md +0 -146
  467. package/skills/cometchat-react-calls/references/call-layouts.md +0 -160
  468. package/skills/cometchat-react-calls/references/call-session.md +0 -235
  469. package/skills/cometchat-react-calls/references/custom-ui.md +0 -247
  470. package/skills/cometchat-react-calls/references/device-management.md +0 -210
  471. package/skills/cometchat-react-calls/references/group-calls.md +0 -257
  472. package/skills/cometchat-react-calls/references/idle-timeout.md +0 -188
  473. package/skills/cometchat-react-calls/references/in-call-chat.md +0 -212
  474. package/skills/cometchat-react-calls/references/migration-v4-to-v5.md +0 -170
  475. package/skills/cometchat-react-calls/references/picture-in-picture.md +0 -245
  476. package/skills/cometchat-react-calls/references/raise-hand.md +0 -238
  477. package/skills/cometchat-react-calls/references/recording-screen-share.md +0 -144
  478. package/skills/cometchat-react-calls/references/ringing-integration.md +0 -255
  479. package/skills/cometchat-react-calls/references/server-web-push-vapid.md +0 -241
  480. package/skills/cometchat-react-calls/references/share-invite.md +0 -175
  481. package/skills/cometchat-react-calls/references/testing-calls-on-web.md +0 -216
  482. package/skills/cometchat-react-calls/references/virtual-background.md +0 -32
  483. package/skills/cometchat-react-calls/references/voip-and-web-push.md +0 -165
  484. package/skills/cometchat-react-patterns/SKILL.md +0 -628
  485. package/skills/cometchat-react-push/SKILL.md +0 -634
  486. package/skills/cometchat-react-router-patterns/SKILL.md +0 -758
  487. package/skills/cometchat-react-testing/SKILL.md +0 -413
  488. package/skills/cometchat-theming/SKILL.md +0 -498
  489. package/skills/cometchat-troubleshooting/SKILL.md +0 -294
@@ -1,539 +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), CometChatCalls init, 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 13+ deployment target; CometChatCallsSDK 5.x; 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.0.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`). 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)
46
-
47
- Unlike the Android / Flutter / JS Calls SDKs, **`CometChatCalls` on iOS has no `login()` and no `getLoggedInUser()`** — those methods do not exist in `CometChatCallsSDK` 5.x. 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).
48
-
49
- ```swift
50
- import CometChatSDK
51
- import CometChatCallsSDK
52
-
53
- // Chat SDK login is the ONLY login. (UI Kit users: CometChatUIKit.login already did this.)
54
- CometChat.login(UID: uid, authKey: AUTH_KEY) { user in
55
- // Chat SDK ready. No CometChatCalls.login() exists — do NOT call it.
56
- // The incoming-call listener can be registered now; per-call auth happens via generateToken.
57
- } onError: { error in
58
- // chat login failed
59
- }
60
-
61
- // Dev: the auth token for generateToken comes from the Chat SDK:
62
- let authToken = CometChat.getUserAuthToken() // String? — pass to generateToken(authToken:)
63
- // Production: fetch a fresh server-minted token from your backend instead.
64
- ```
65
-
66
- **Surprises:**
67
- - 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`.
68
- - `generateToken` / `startSession` errors hit the `onError` closure (not `do/try/catch`). The error type is `CometChatCallException` — has `errorDescription` and `errorCode`.
69
-
70
- ### 1.1 Dual-SDK contract
71
-
72
- 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:
73
-
74
- ```swift
75
- // ✓ RIGHT — initiate ringing (Chat SDK)
76
- import CometChatSDK
77
-
78
- let outgoing = Call(receiverId: receiverUid, callType: .video, receiverType: .user)
79
- CometChat.initiateCall(call: outgoing, onSuccess: { initiated in
80
- // initiated.sessionID is what the Calls SDK will join
81
- }, onError: { error in
82
- // surface to UI
83
- })
84
- ```
85
-
86
- ```swift
87
- // ✓ RIGHT — start the WebRTC session (Calls SDK 5.x) after acceptance.
88
- // iOS Calls SDK 5.x is a TWO-STEP flow: generateToken → startSession.
89
- // There is NO joinSession, NO CallSession singleton, and NO SessionSettingsBuilder
90
- // in the 5.x SDK — those are phantom. The real builder is CallSettingsBuilder.
91
- // - CallSettingsBuilder (NOT SessionSettingsBuilder) builds the CallSettings
92
- // - generateToken(authToken:sessionID:) FIRST, then startSession(callToken:callSetting:view:)
93
- // - Attach the event listener via CallSettingsBuilder.setDelegate(_:) (CallsEventsDelegate)
94
- import CometChatCallsSDK
95
-
96
- let settings = CallSettingsBuilder()
97
- .setStartVideoMuted(false)
98
- .setStartAudioMuted(false)
99
- .setDelegate(callListener) // any CallsEventsDelegate — onCallEnded, onUserJoined, …
100
- .build()
101
-
102
- // loggedInAuthToken: the current user's auth token — CometChat.getUserAuthToken()
103
- // (User has NO .authToken property; getUserAuthToken() is the real accessor)
104
- CometChatCalls.generateToken(authToken: loggedInAuthToken, sessionID: sessionID) { callToken in
105
- guard let callToken = callToken else { return }
106
- CometChatCalls.startSession(
107
- callToken: callToken,
108
- callSetting: settings,
109
- view: callContainerView // UIView with measurable bounds
110
- ) { _ in
111
- // session started — the call UI is rendered into callContainerView
112
- } onError: { error in
113
- print("startSession failed: \(error?.errorDescription ?? "unknown")")
114
- }
115
- } onError: { error in
116
- print("generateToken failed: \(error?.errorDescription ?? "unknown")")
117
- }
118
- ```
119
-
120
- ### 1.1a End-to-end initiate→join sequence (ENG-35710)
121
-
122
- 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.
123
-
124
- > **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.
125
-
126
- ```swift
127
- // Step A: register the listener on app start (before any call fires)
128
- // Listener ID is a String; listener instance is "self" or any class conforming
129
- // to CometChatCallDelegate.
130
- CometChat.addCallListener(callListenerID, self)
131
-
132
- // Step B: conform to CometChatCallDelegate (NOT CometChatCallsListener)
133
- extension YourClass: CometChatCallDelegate {
134
- // Caller side: the OTHER party accepted — NOW join the session
135
- func onOutgoingCallAccepted(acceptedCall: Call?, error: CometChatException?) {
136
- if let error = error { /* surface */ return }
137
- guard let call = acceptedCall, let sessionID = call.sessionID else { return }
138
- startCallSession(sessionID: sessionID)
139
- }
140
- // Receiver side: incoming call rang — present accept UI; on accept, start the session
141
- func onIncomingCallReceived(incomingCall: Call?, error: CometChatException?) {
142
- if let error = error { /* surface */ return }
143
- guard let call = incomingCall else { return }
144
- presentIncomingCallUI(for: call) { accepted in
145
- if accepted {
146
- CometChat.acceptCall(sessionID: call.sessionID ?? "") { acceptedCall in
147
- self.startCallSession(sessionID: acceptedCall?.sessionID ?? "")
148
- } onError: { _ in /* surface */ }
149
- }
150
- }
151
- }
152
- func onOutgoingCallRejected(rejectedCall: Call?, error: CometChatException?) { /* end UI, cleanup */ }
153
- func onIncomingCallCancelled(canceledCall: Call?, error: CometChatException?) { /* dismiss incoming UI — label is canceledCall: (single L) */ }
154
- }
155
-
156
- // Don't forget to remove the listener on teardown
157
- // CometChat.removeCallListener(callListenerID)
158
-
159
- // Step B: kick the call off (caller — your "Call" button taps this)
160
- let outgoing = Call(receiverId: targetUid, callType: .video, receiverType: .user)
161
- CometChat.initiateCall(call: outgoing, onSuccess: { initiated in
162
- // initiated.sessionID is what the session will use — but DO NOT start the
163
- // session here. Wait for onOutgoingCallAccepted on the listener. Starting before
164
- // the remote accepts means you're alone in an empty session.
165
- }, onError: { error in /* surface */ })
166
-
167
- // Step C: start the session (caller in onOutgoingCallAccepted, receiver after acceptCall)
168
- // 5.x flow: generateToken(authToken:sessionID:) → startSession(callToken:callSetting:view:)
169
- func startCallSession(sessionID: String) {
170
- let settings = CallSettingsBuilder()
171
- .setStartVideoMuted(false)
172
- .setStartAudioMuted(false)
173
- .setDelegate(self) // self conforms to CallsEventsDelegate
174
- .build()
175
- CometChatCalls.generateToken(authToken: loggedInAuthToken, sessionID: sessionID) { callToken in
176
- guard let callToken = callToken else { return }
177
- CometChatCalls.startSession(
178
- callToken: callToken,
179
- callSetting: settings,
180
- view: callContainerView // UIView WITH non-zero bounds (lay out first)
181
- ) { _ in
182
- // session started
183
- } onError: { error in
184
- print("startSession failed: \(error?.errorDescription ?? "unknown")")
185
- }
186
- } onError: { error in
187
- print("generateToken failed: \(error?.errorDescription ?? "unknown")")
188
- }
189
- }
190
- ```
191
-
192
- 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.
193
-
194
- ### 1.2 CallKit + PushKit are mandatory
195
-
196
- 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:
197
-
198
- - **PushKit** delivers VoIP push tokens (separate from APNs tokens) and high-priority VoIP payloads even when the app is terminated
199
- - **CallKit** presents the system incoming-call UI (lock-screen, even when device is locked) and reports call state to the OS
200
- - Your `PKPushRegistry` listener calls `CXProvider.reportNewIncomingCall(...)` immediately on receiving the VoIP payload — Apple terminates apps that delay this
201
-
202
- 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.
203
-
204
- ### 1.3 Background modes — three required entries
205
-
206
- In the target's "Signing & Capabilities" → Background Modes:
207
-
208
- - **`Audio, AirPlay, and Picture in Picture`** — required for ongoing-call audio when backgrounded
209
- - **`Voice over IP`** — required for PushKit VoIP payload delivery
210
- - **`Remote notifications`** — required for chat push (keeps existing entitlements working)
211
-
212
- In `Info.plist`:
213
-
214
- ```xml
215
- <key>UIBackgroundModes</key>
216
- <array>
217
- <string>audio</string>
218
- <string>voip</string>
219
- <string>remote-notification</string>
220
- </array>
221
- ```
222
-
223
- Apple will reject the app if `voip` is declared but PushKit is not actually used.
224
-
225
- ### 1.4 Server-minted auth tokens
226
-
227
- Same rule as the chat dispatcher / `cometchat-ios-production`. Production calls path uses `CometChat.login(authToken:)`, not `CometChat.login(uid:authKey:)`.
228
-
229
- ### 1.5 Hangup cleanup — `AVAudioSession` routing
230
-
231
- 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:
232
24
 
233
25
  ```swift
234
- import CometChatCallsSDK
235
-
236
- func endCall() {
237
- // v5: end the session via the static CometChatCalls.endSession().
238
- // There is NO CallSession singleton and NO leaveSession() in the 5.x SDK —
239
- // all in-call control is via static funcs on CometChatCalls.
240
- CometChatCalls.endSession()
241
- callContainer.subviews.forEach { $0.removeFromSuperview() }
242
-
243
- // CRITICAL: deactivate the audio session, otherwise the speaker stays
244
- // routed to "earpiece + voice processing" mode and other audio (music,
245
- // phone calls outside the app) sounds wrong until the user resets it.
246
- do {
247
- try AVAudioSession.sharedInstance().setActive(false, options: .notifyOthersOnDeactivation)
248
- } catch {
249
- // log but don't block — best-effort cleanup
250
- }
251
-
252
- // CallKit must be told the call ended, even if WE ended it
253
- cxProvider.reportCall(with: callUUID, endedAt: Date(), reason: .remoteEnded)
254
- }
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") })
255
35
  ```
256
36
 
257
- 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`:
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`:
258
42
 
259
43
  ```swift
260
- CometChatCalls.audioMuted(true) // mute mic; false = unmute
261
- CometChatCalls.videoPaused(true) // pause video; false = resume
262
- CometChatCalls.switchCamera()
263
- CometChatCalls.enterPIPMode() // picture-in-picture; exitPIPMode() to leave
264
- CometChatCalls.startRecording() // stopRecording() to end
265
- // NOTE: the iOS Calls SDK 5.x has NO local screen-share initiation API
266
- // (no startScreenShare/stopScreenShare) — iOS can only RECEIVE a remote
267
- // participant's screen share, not start one.
268
- ```
269
-
270
- Skipping the `setActive(false, options: .notifyOthersOnDeactivation)` is the canonical "music doesn't resume after the call" bug.
271
-
272
- ### 1.6 Permissions with rationale — Info.plist usage strings
273
-
274
- Two required entries; iOS rejects builds that record without them:
275
-
276
- ```xml
277
- <key>NSMicrophoneUsageDescription</key>
278
- <string>So you can talk during voice and video calls.</string>
279
- <key>NSCameraUsageDescription</key>
280
- <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") })
281
48
  ```
282
49
 
283
- 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.
284
-
285
- ### 1.7 IncomingCall UI CallKit owns it
286
-
287
- 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:
288
-
289
- 1. Keep `PKPushRegistry` alive — register in `application(_:didFinishLaunchingWithOptions:)` (UIKit) or `App.init()` (SwiftUI's `@main`)
290
- 2. On VoIP payload → call `CXProvider.reportNewIncomingCall`
291
- 3. Implement `CXProviderDelegate` `provider(_:perform:)` for `CXAnswerCallAction` — this is where you finally call `CometChatCalls.generateToken` then `startSession`
292
-
293
- In additive mode, the UI Kit's incoming-call view can be used for in-foreground rings; CallKit handles backgrounded/terminated rings.
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.
294
53
 
295
- ### 1.7a Default incoming/outgoing UI fallback (ENG-35710)
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
+ import — see the core skill's install notes).
296
57
 
297
- 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.
298
-
299
- **If the developer hasn't asked for a custom incoming-call UI, wire the kit's defaults:**
300
-
301
- ```swift
302
- // SwiftUI host
303
- import SwiftUI
304
- import UIKit
305
- import CometChatUIKitSwift
306
-
307
- // The kit ships call UI as UIViewControllers (CometChatIncomingCall / CometChatOutgoingCall /
308
- // CometChatOngoingCall) — there are NO `…SwiftUI`-suffixed wrappers. Bridge with
309
- // UIViewControllerRepresentable. Present the controller when your delegate fires (§1.1a);
310
- // configure it via the kit's IncomingCallConfiguration rather than a constructor arg.
311
- struct CometChatIncomingCallView: UIViewControllerRepresentable {
312
- func makeUIViewController(context: Context) -> CometChatIncomingCall {
313
- CometChatIncomingCall()
314
- }
315
- func updateUIViewController(_ vc: CometChatIncomingCall, context: Context) {}
316
- }
317
-
318
- struct AppRootView: View {
319
- @State private var hasIncomingCall = false
320
- var body: some View {
321
- ZStack {
322
- ContentView() // your app's tabs / nav
323
- if hasIncomingCall {
324
- CometChatIncomingCallView()
325
- .ignoresSafeArea()
326
- }
327
- }
328
- // flip `hasIncomingCall` from your CometChatCallDelegate.onIncomingCallReceived (see §1.1a)
329
- }
330
- }
331
- ```
332
-
333
- ```swift
334
- // UIKit host
335
- class RootViewController: UIViewController {
336
- override func viewDidLoad() {
337
- super.viewDidLoad()
338
- // Install the kit's incoming-call VC above all other view controllers
339
- let incoming = CometChatIncomingCall()
340
- addChild(incoming)
341
- view.addSubview(incoming.view)
342
- incoming.view.frame = view.bounds
343
- incoming.view.autoresizingMask = [.flexibleWidth, .flexibleHeight]
344
- incoming.didMove(toParent: self)
345
- }
346
- }
347
- ```
348
-
349
- 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.
350
-
351
- 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.
352
-
353
- ---
354
-
355
- ## 2. Setup
356
-
357
- ### Swift Package Manager (preferred)
358
-
359
- Add via Xcode → File → Add Package Dependencies:
360
-
361
- ```
362
- https://github.com/cometchat/calls-sdk-ios.git
363
- ```
364
-
365
- Pin to `5.0.0..<6.0.0`. SPM resolves `CometChatSDK` automatically.
366
-
367
- ### CocoaPods
368
-
369
- ```ruby
370
- platform :ios, '13.0'
371
- target 'YourApp' do
372
- use_frameworks!
373
- pod 'CometChatSDK', '~> 4.0' # signaling
374
- pod 'CometChatCallsSDK', '~> 5.0' # WebRTC session
375
- # additive mode also has CometChatUIKitSwift '~> 5.1' already
376
- end
377
-
378
- post_install do |installer|
379
- installer.pods_project.build_configurations.each do |config|
380
- config.build_settings['ENABLE_USER_SCRIPT_SANDBOXING'] = 'NO' # Xcode 15+
381
- end
382
- end
383
- ```
384
-
385
- ### Init
386
-
387
- In SwiftUI app entry (`@main struct App.init()`) or UIKit `application(_:didFinishLaunchingWithOptions:)`:
388
-
389
- ```swift
390
- import CometChatSDK
391
- import CometChatCallsSDK
392
-
393
- let appSettings = AppSettings.AppSettingsBuilder()
394
- .subscribePresenceForAllUsers()
395
- .setRegion(region: Secrets.cometchatRegion)
396
- .build()
397
-
398
- CometChat.init(appId: Secrets.cometchatAppID, appSettings: appSettings) { isInitialized, error in
399
- guard error == nil else { return }
400
-
401
- let callAppSettings = CallAppSettingsBuilder()
402
- .setAppId(Secrets.cometchatAppID)
403
- .setRegion(Secrets.cometchatRegion)
404
- .build()
405
-
406
- CometChatCalls.init(callsAppSettings: callAppSettings, onSuccess: { _ in
407
- // ready — register PushKit (rule 1.2) and CXProvider (rule 1.7) here
408
- }, onError: { error in
409
- print("CometChatCalls.init failed: \(error?.errorDescription ?? "")")
410
- })
411
- }
412
- ```
413
-
414
- Credentials via `Secrets.swift` (gitignored) or `.xcconfig` Build Settings — see `cometchat-ios-core`.
415
-
416
- ---
417
-
418
- ## 3. Components catalog
419
-
420
- ### Calls SDK primitives (used in standalone or wherever you build custom UI)
421
-
422
- | Type | Purpose |
423
- |---|---|
424
- | `CometChatCalls` | Top-level facade — `init`, `generateToken`, `startSession`, `endSession`, `audioMuted(_:)`, `videoPaused(_:)`, `switchCamera`, `enterPIPMode`/`exitPIPMode`, `startRecording`/`stopRecording`, `addCallEventListener` |
425
- | `CallSettingsBuilder` | Per-session config (audio-only, presenter, hide buttons, start muted, `setDelegate`) → `.build()` returns `CallSettings` |
426
- | `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`) |
427
- | `CallType` | `.video` / `.audio` / `.audioVideo` (swiftinterface:294-297) — there is NO `.voice` |
428
- | `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` |
429
- | `CallLogsRequest` + `CallLogsBuilder` | Paginated call history (note the plural — there is no `CallLogRequest`/`CallLogRequestBuilder`) |
430
- | `CallsEventsDelegate` (protocol) | Lifecycle + media + participant + button events — set via `CallSettingsBuilder.setDelegate(_:)` or `CometChatCalls.addCallEventListener(observerId:delegate:)`. (NOT `CometChatCallsEventsListener` — that name doesn't exist.) |
431
-
432
- ### UI Kit views (additive mode — `CometChatUIKitSwift`)
433
-
434
- | View / VC | Purpose |
58
+ ## The five components
59
+ | Component | Role |
435
60
  |---|---|
436
- | `CometChatCallButtons` | Voice + video button row (standalone or in `CometChatMessageHeader`) |
437
- | `CometChatIncomingCall` (UIViewController) | Foreground in-app ring UI |
438
- | `CometChatOutgoingCall` (UIViewController) | Dialing UI |
439
- | `CometChatOngoingCall` (UIViewController) | Active call UI hosting WebRTC |
440
- | `CometChatCallLogs` (UIViewController) | Paginated history |
441
-
442
- SwiftUI hosting via `UIViewControllerRepresentable`:
61
+ | `CometChatCallButtons` | Voice/video triggers. **Has NO no-arg init — construct 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.)
443
88
 
444
89
  ```swift
445
- struct CallLogsView: UIViewControllerRepresentable {
446
- func makeUIViewController(context: Context) -> CometChatCallLogs { CometChatCallLogs() }
447
- func updateUIViewController(_ vc: CometChatCallLogs, context: Context) {}
448
- }
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 } /* … */ })
449
119
  ```
450
120
 
451
- ---
452
-
453
- ## 4. Standalone integration
454
-
455
- When `product === "voice-video"` and there is no existing UI Kit.
456
-
457
- **Split by calling mode:**
458
-
459
- ### 4a. Standalone — Session mode (meeting-room UX, no ringing)
460
-
461
- Calls SDK ONLY. NO Chat SDK, NO CallKit, NO PushKit. Matches `calls-sdk-ios-5/sample-apps/cometchat-calls-sample-app-ios/`. Scaffold:
462
-
463
- 1. **App entry** — `CometChatCalls.init(callsAppSettings:)` with a `CallAppSettingsBuilder().setAppId(...).setRegion(...).build()` ONLY. No `CometChat.init`, no `CometChat.login`, no PushKit, no CallKit.
464
- 2. **`JoinSessionView.swift`** — UID picker + "Start meeting" / "Join meeting" + state.
465
- 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`.
466
- 4. **`Info.plist` patch** — Camera + microphone permissions ONLY. No `audio` or `voip` Background Modes needed.
467
- 5. **Universal Link routing** — meeting URL → CallView.
468
-
469
- **Why no CallKit / no PushKit:** session mode is link-driven, not push-driven. No incoming ring to surface.
470
-
471
- ### 4b. Standalone — Ringing mode (CallKit + PushKit + Chat SDK signaling)
472
-
473
- Dual-SDK + CallKit + PushKit. Scaffold:
474
-
475
- 1. **App entry** — Chat SDK + Calls SDK init, PushKit + CallKit registration (rule 1.2, 1.7).
476
- 2. **`CallKitProviderDelegate.swift`** — `CXProviderDelegate` implementation. Routes `CXAnswerCallAction` → `CometChatCalls.generateToken` then `startSession(callToken:callSetting:view:)`. Routes `CXEndCallAction` → `CometChatCalls.endSession()` + `AVAudioSession` cleanup (rule 1.5).
477
- 3. **`PushRegistryDelegate.swift`** — `PKPushRegistryDelegate` listening on `.voIP`. On payload → `CXProvider.reportNewIncomingCall` immediately.
478
- 4. **`ProfileView.swift` (SwiftUI) or `ProfileViewController.swift` (UIKit)** — Hosts call buttons next to user info. Tap → `CometChat.initiateCall`.
479
- 5. **`OngoingCallView.swift`** — Custom view hosting the SDK's call surface via `UIViewRepresentable` bridging. Implements rule 1.5 teardown.
480
- 6. **`CallLogsView.swift`** — `/calls` equivalent — `CallLogsRequest.CallLogsBuilder`.
481
- 7. **`Info.plist` patch** — Background Modes (rule 1.3), permissions (rule 1.6).
482
- 8. **VoIP Services certificate setup** — manual step (Apple Developer portal + App Store Connect). The skill documents the steps; cannot automate.
483
-
484
- ## 5. Additive integration
485
-
486
- When `cometchat-ios` is already integrated.
487
-
488
- > ✅ **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.)
489
-
490
- The kit-default additive recipe:
491
- 1. Confirm `CometChatUIKitSwift` is present (CallsSDK is bundled — nothing extra to install).
492
- 2. Set **`.enable(inAppIncomingCall: true)`** on the `UIKitSettings` builder at init (the one calling switch).
493
- 3. Add Background Modes (`voip`, `remote-notification`, `audio`) + camera/mic permissions to `Info.plist`.
494
- 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.
495
- 5. (Optional) CallKit + PushKit for background VoIP (asks user — same opt-in as Android).
496
-
497
- Only reach for `CometChatCalls.init` + `generateToken`/`startSession` (§1.1) when building a **custom call surface** without the kit's call components.
498
-
499
- ## 6. Anti-patterns
500
-
501
- 1. **Skipping CallKit + PushKit** in standalone mode. The app cannot ring backgrounded/terminated devices any other way. App Store reviewers test this.
502
- 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`.
503
- 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.
504
- 4. **Declaring `voip` in `UIBackgroundModes` without using PushKit.** Apple rejects.
505
- 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.
506
- 6. **Using SwiftUI `.alert` for incoming calls.** It only fires when the app is foregrounded. Use CallKit (rule 1.7).
507
- 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.
508
-
509
- ## 7. Verification checklist
510
-
511
- **Static:**
512
-
513
- - [ ] `CometChatCallsSDK` in SPM Package.resolved or Podfile.lock
514
- - [ ] `CometChat.init` followed by `CometChatCalls.init` in app entry
515
- - [ ] PushKit registry listening on `.voIP`
516
- - [ ] `CXProvider` configured with `CXProviderConfiguration` (app name + ringtone if any)
517
- - [ ] `CXProviderDelegate` implements answer + end actions
518
- - [ ] `Info.plist` has `NSMicrophoneUsageDescription` + `NSCameraUsageDescription`
519
- - [ ] `Info.plist` `UIBackgroundModes` has `audio` + `voip` + `remote-notification`
520
- - [ ] Hangup path includes `endSession` + `setActive(false, options: .notifyOthersOnDeactivation)` + `cxProvider.reportCall(...endedAt:reason:)`
521
- - [ ] **Standalone only:** No in-app incoming-call screen — CallKit owns it
522
-
523
- **Runtime (real device):**
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.
524
123
 
525
- - [ ] Outgoing call connects, two-way audio + video
526
- - [ ] Incoming call rings on lock screen (device locked + app terminated)
527
- - [ ] Tap "Answer" on lock screen → app opens directly into ongoing call
528
- - [ ] Hangup ends call, camera light off, music resumes if it was playing
529
- - [ ] Background the app during a call → audio continues
530
- - [ ] Lock device during a call → ongoing-call UI on lock screen, audio continues
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.
531
126
 
532
- ## 8. Pointers
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.
533
131
 
534
- - `references/audio-modes-and-controls.md` audio-route switching (speaker/earpiece/Bluetooth) + custom control panel (button-disable matrix)
535
- - `cometchat-ios-core` Chat SDK init, login, `Secrets.swift` conventions
536
- - `cometchat-ios-components` — full UI Kit catalog (additive mode)
537
- - `cometchat-ios-push` — APNs setup; some overlap with PushKit but distinct (PushKit is VoIP-only)
538
- - `cometchat-ios-production` — server-minted tokens, security checklist
539
- - `cometchat-ios-troubleshooting` — common failure modes (PushKit delivery, CallKit reporting timing, ENABLE_USER_SCRIPT_SANDBOXING)
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.