@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,669 +0,0 @@
1
- ---
2
- name: cometchat-native-calls
3
- description: CometChat Calls SDK integration for React Native (Expo managed + bare CLI). Covers @cometchat/calls-sdk-react-native install, dual-SDK init, native module linking (iOS pods, Android Gradle), VoIP push via react-native-callkeep + react-native-voip-push-notification + @react-native-firebase/messaging, CallKit on iOS / ConnectionService on Android, foreground service correctness on Android 14+, gesture handler + reanimated peer deps, Expo-specific config plugins, and additive-vs-standalone modes.
4
- license: "MIT"
5
- compatibility: "React Native >= 0.70 (>= 0.72 recommended), Expo SDK >= 49 (managed) / bare RN CLI; @cometchat/calls-sdk-react-native ^4.x; @cometchat/chat-sdk-react-native ^4.x; @cometchat/chat-uikit-react-native ^5.x (additive mode)"
6
- metadata:
7
- author: "CometChat"
8
- version: "4.0.0"
9
- tags: "cometchat react-native calls voice video webrtc expo bare-rn callkeep voip-push pushkit callkit connectionservice fcm gesture-handler"
10
- ---
11
-
12
- ## Purpose
13
-
14
- Production-grade voice + video calling for React Native (Expo managed + bare CLI). Loaded by `cometchat-calls` when `framework` is `expo` or `react-native`. Operates in two modes:
15
-
16
- - **Standalone** — calls is the product. Chat SDK (signaling) + Calls SDK (WebRTC) + your own RN screens. **VoIP push is mandatory** — same rule as native iOS / Android.
17
- - **Additive** — calls layered onto an existing CometChat React Native UI Kit integration. Adds call buttons inline, mounts `CometChatIncomingCall` at app root.
18
-
19
- **Read these other skills first:**
20
- - `cometchat-calls` — dispatcher (modes, hard rules, anti-patterns)
21
- - `cometchat-native-core` — Chat SDK init, login, env conventions, gesture handler peer-dep rules
22
- - Framework path: `cometchat-native-expo-patterns` (managed) OR `cometchat-native-bare-patterns` (CLI)
23
-
24
- **Ground truth:**
25
- - SDK source — `calls-sdk-react-native-5/package/`
26
- - Sample app — `calls-sdk-react-native-5/sample-apps/cometchat-calls-sample-app-react-native/`
27
- - Public docs — https://www.cometchat.com/docs/calls/react-native/overview
28
-
29
- ---
30
-
31
- ## 1. Hard rules — RN specialization
32
-
33
- ### 1.0 Calls SDK login — only the STANDALONE/raw-SDK path needs it
34
-
35
- > ✅ **The additive UI-Kit path does NOT call `CometChatCalls.login`.** When calls are layered onto the RN UI Kit (the common case — `<CometChatIncomingCall>` at root + the auto call buttons in `CometChatMessageHeader`, calling extension enabled at `CometChatUIKit.init`), the kit chains the Calls-SDK auth off `CometChatUIKit.login` for you. **The canonical RN SampleApp wires calls end-to-end (incoming/outgoing/ongoing) with ZERO `CometChatCalls.login`** (verified across `examples/SampleApp` + `SampleAppWithPushNotifications`; the kit's `CometChatUIKit.login` only runs `CometChat.login`). Don't add it on the UI-Kit path — it's redundant.
36
-
37
- **`await CometChatCalls.login(uid, AUTH_KEY)` is required ONLY on the STANDALONE / raw-Calls-SDK path** (§4a/§4b — no UI Kit; you call `CometChatCalls.generateToken` / render a custom call surface directly). There the Calls SDK has its own auth state: after `CometChat.login(uid, AUTH_KEY)` succeeds, also call `await CometChatCalls.login(uid, AUTH_KEY)` — without it the first raw calls API throws **"auth token cannot be null"**. (No imperative `joinSession` on RN — see rule below.)
38
-
39
- ```ts
40
- import { CometChat } from "@cometchat/chat-sdk-react-native";
41
- import { CometChatCalls } from "@cometchat/calls-sdk-react-native";
42
-
43
- // ✓ RIGHT — chat login first, then calls login
44
- await CometChat.login(uid, AUTH_KEY);
45
- try {
46
- const callUser = await CometChatCalls.login(uid, AUTH_KEY); // dev mode
47
- // OR for production:
48
- // const callUser = await CometChatCalls.loginWithAuthToken(authToken);
49
- } catch (e) {
50
- // surface to user — common cause: typo in app id / auth key
51
- }
52
- ```
53
-
54
- **Surprises that bite on real devices:**
55
- - The Chat SDK persists login across launches via AsyncStorage; the **Calls SDK does NOT**. Even if `CometChat.getLoggedinUser()` returns a non-null user on cold start, call `CometChatCalls.login` again before any calls API works.
56
- - A single-arg `CometChatCalls.login(uid)` overload exists for re-login when the SDK has cached auth — default to the (uid, AUTH_KEY) form for dev to avoid foot-guns.
57
- - Login errors surface as Promise rejections — wrap in try/catch.
58
-
59
- ### 1.1 Dual-SDK contract
60
-
61
- Same shape as web. `@cometchat/chat-sdk-react-native` initiates ringing; `@cometchat/calls-sdk-react-native` runs the WebRTC session. Both packages.
62
-
63
- ```ts
64
- import { CometChat } from "@cometchat/chat-sdk-react-native";
65
- import { CometChatCalls } from "@cometchat/calls-sdk-react-native";
66
-
67
- // Chat SDK — initiate
68
- const outgoing = new CometChat.Call(receiverUid, CometChat.CALL_TYPE.VIDEO, CometChat.RECEIVER_TYPE.USER);
69
- const initiated = await CometChat.initiateCall(outgoing);
70
-
71
- // Calls SDK — generate the token (v5 takes only sessionId; auth is internal after login).
72
- const { token: callToken } = await CometChatCalls.generateToken(initiated.getSessionId());
73
-
74
- // On RN, session/join is rendered via the SDK's declarative Component.
75
- // There is NO imperative joinSession(token, settings, viewRef) on RN — the
76
- // Component IS the call surface. With the kit, <CometChatOngoingCall />
77
- // wraps this internally. For custom UI, render <CometChatCalls.Component
78
- // callToken={callToken} /> directly. See references/custom-ui.md.
79
- ```
80
-
81
- ### 1.2 VoIP push — react-native-callkeep + platform-specific push
82
-
83
- VoIP push on RN is the highest-effort piece. The standard production stack:
84
-
85
- - **`react-native-callkeep`** — bridges CallKit (iOS) + ConnectionService (Android). Single API for "report incoming call to OS"
86
- - **`react-native-voip-push-notification`** — iOS PushKit token registration + payload delivery
87
- - **`@react-native-firebase/messaging`** — Android FCM high-priority data messages
88
- - **Server side** — your push server must split iOS sends to PushKit (VoIP cert) and Android sends to FCM with `priority: "high"` and a `data` payload (NOT `notification`, which ConnectionService can't intercept)
89
-
90
- The skill scaffolds all four pieces in standalone mode. Additive mode prompts before adding (it's substantial).
91
-
92
- ### 1.3 Foreground service — same Android 14+ rules as native
93
-
94
- When the call is active on Android, an ongoing-call foreground service must run. `react-native-callkeep` handles registration but the app's `AndroidManifest.xml` must declare:
95
-
96
- ```xml
97
- <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
98
- <uses-permission android:name="android.permission.FOREGROUND_SERVICE_PHONE_CALL" />
99
- <uses-permission android:name="android.permission.FOREGROUND_SERVICE_MICROPHONE" />
100
- <uses-permission android:name="android.permission.FOREGROUND_SERVICE_CAMERA" />
101
- <uses-permission android:name="android.permission.MANAGE_OWN_CALLS" />
102
- <uses-permission android:name="android.permission.BIND_TELECOM_CONNECTION_SERVICE" />
103
- ```
104
-
105
- Same silent-crash failure mode as native Android (cf. `cometchat-android-v5-calls` rule 1.3).
106
-
107
- For Expo managed, these go into `app.json` `expo.android.permissions` AND require a config plugin (`react-native-callkeep`'s plugin) to merge into the generated `AndroidManifest.xml` during prebuild. Bare RN can edit the manifest directly.
108
-
109
- ### 1.4 Server-minted auth tokens
110
-
111
- Same — `cometchat-native-production` covers it.
112
-
113
- ### 1.5 Hangup cleanup — RTCPeerConnection + audio session
114
-
115
- Combined web + iOS rules. RN's WebRTC bridge wraps both:
116
-
117
- ```ts
118
- function endCall() {
119
- CometChatCalls.leaveSession(); // v5 canonical (endSession is a deprecated shim)
120
- RNCallKeep.endCall(callUUID); // tells CallKit/ConnectionService the call ended
121
-
122
- // iOS: matching audio session deactivation happens inside callkeep
123
- // Android: foreground service stop happens inside callkeep
124
- }
125
- ```
126
-
127
- Skipping `RNCallKeep.endCall` leaves the system call UI stuck (lock-screen card persists, OS thinks there's an active call). Common bug.
128
-
129
- ### 1.6 Permissions
130
-
131
- Required:
132
-
133
- - iOS `Info.plist` — `NSCameraUsageDescription`, `NSMicrophoneUsageDescription` (same as native)
134
- - Android — runtime requests via `PermissionsAndroid.requestMultiple` for `RECORD_AUDIO`, `CAMERA`, `POST_NOTIFICATIONS` (Android 13+)
135
- - Expo managed — declare in `app.json` `expo.ios.infoPlist` and `expo.android.permissions`; the prebuild merges into native manifests
136
-
137
- ### 1.7 IncomingCall + OutgoingCall + OngoingCall — full event-listener wiring
138
-
139
- `<CometChatIncomingCall />`, `<CometChatOutgoingCall />`, and `<CometChatOngoingCall />` are **NOT auto-mounted by each other**. The parent component must register both `CometChat.addCallListener` (SDK socket) and `CometChatUIEventHandler.addCallListener` (UI events fired by `<CometChatCallButtons>` / `<CometChatMessageHeader>`), then conditionally render whichever overlay matches current state. Validated 2026-05-26 on Pixel 3 + `@cometchat/chat-uikit-react-native@5.3.5`.
140
-
141
- Mount this wiring inside the root navigator OR in the App.tsx wrapper, ABOVE all stacks/tabs — calls only ring on screens where the listener exists.
142
-
143
- ```tsx
144
- import { CometChat } from "@cometchat/chat-sdk-react-native";
145
- import { CometChatCalls } from "@cometchat/calls-sdk-react-native";
146
- import {
147
- CometChatIncomingCall,
148
- CometChatOutgoingCall,
149
- CometChatOngoingCall,
150
- CometChatUIEventHandler,
151
- } from "@cometchat/chat-uikit-react-native";
152
- import { StyleSheet, View } from "react-native";
153
-
154
- const CALL_LISTENER_ID = "app-call-listener";
155
-
156
- function CallSurfaces() {
157
- const [outgoingCall, setOutgoingCall] = useState<CometChat.Call | null>(null);
158
- const [incomingCall, setIncomingCall] = useState<CometChat.Call | null>(null);
159
- const [ongoingCall, setOngoingCall] = useState<CometChat.Call | null>(null);
160
-
161
- useEffect(() => {
162
- // SDK socket — incoming + outgoing-rejected
163
- CometChat.addCallListener(
164
- CALL_LISTENER_ID,
165
- new CometChat.CallListener({
166
- onIncomingCallReceived: (call: CometChat.Call) => setIncomingCall(call),
167
- onIncomingCallCancelled: () => setIncomingCall(null),
168
- onOutgoingCallAccepted: () => {},
169
- onOutgoingCallRejected: () => setOutgoingCall(null),
170
- })
171
- );
172
- // UI events fired by the kit's CallButtons / MessageHeader on tap
173
- CometChatUIEventHandler.addCallListener(CALL_LISTENER_ID, {
174
- ccOutgoingCall: ({ call }) => setOutgoingCall(call),
175
- ccCallEnded: () => {
176
- setOutgoingCall(null);
177
- setIncomingCall(null);
178
- setOngoingCall(null);
179
- },
180
- ccShowOngoingCall: ({ call }) => setOngoingCall(call),
181
- });
182
- // Mid-call drops (peer left, network loss, server close) do NOT come through the
183
- // Chat-SDK/UI-Kit channels above — they fire on the Calls SDK session events (v5).
184
- // For a STANDALONE custom call surface, also register (clone skills/event-listeners):
185
- // const offLeft = CometChatCalls.addEventListener('onSessionLeft', () => { /* reset state */ });
186
- // const offClosed = CometChatCalls.addEventListener('onConnectionClosed', () => { /* reset state */ });
187
- // // addEventListener returns an unsubscribe fn — call offLeft()/offClosed() on cleanup.
188
- // (Additive mode using the kit's <CometChatOngoingCall> handles this internally.)
189
- return () => {
190
- CometChat.removeCallListener(CALL_LISTENER_ID);
191
- CometChatUIEventHandler.removeCallListener(CALL_LISTENER_ID);
192
- };
193
- }, []);
194
-
195
- return (
196
- <>
197
- {incomingCall && <View style={StyleSheet.absoluteFill}><CometChatIncomingCall call={incomingCall} onDecline={() => setIncomingCall(null)} /></View>}{/* onDecline is REQUIRED on the RN kit's CometChatIncomingCall (onAccept/onError optional) */}
198
- {outgoingCall && <View style={StyleSheet.absoluteFill}><CometChatOutgoingCall call={outgoingCall} /></View>}
199
- {/* CometChatOngoingCall has NO `call` prop — it takes sessionID (required) + callSettingsBuilder (required) + onError? (verified vs uikit-react-native-v5 CometChatOngoingCall.tsx). CometChatIncomingCall/OutgoingCall DO take `call`. */}
200
- {ongoingCall && <View style={StyleSheet.absoluteFill}><CometChatOngoingCall sessionID={ongoingCall.getSessionId()} callSettingsBuilder={new CometChatCalls.CallSettingsBuilder().setIsAudioOnlyCall(ongoingCall.getType() === "audio")} /></View>}
201
- </>
202
- );
203
- }
204
- ```
205
-
206
- > **Don't skip the `ccOutgoingCall` listener.** Without it, tapping the video/voice button in `<CometChatMessageHeader>` triggers the call at the SDK level (WebRTC, camera, audio init) but no overlay UI ever mounts — the user sees nothing change after the tap. This was [[project_v4_3_f75_rn_call_ui_missing]] — F75.
207
-
208
- In standalone mode, CallKit/ConnectionService own the foreground UI; `<CometChatIncomingCall />` is not used. Instead, a `react-native-callkeep` event listener at app root reports new calls to the OS.
209
-
210
- ### 1.8 Three canonical provider/scaffold patterns (non-negotiable)
211
-
212
- Validated across 4 RN cohorts on 2026-05-14. Each bug silently breaks integration in a different way; each fix is one line. Future scaffolds MUST emit all three.
213
-
214
- **1.8.a — `getLoggedInUser()` throws on no-session; always `.catch(() => null)`.**
215
-
216
- ```ts
217
- // ❌ Throws "User not found" on every fresh launch → init fails → app stuck
218
- const existing = await CometChatUIKit.getLoggedInUser();
219
- if (existing) return;
220
-
221
- // ✅
222
- const existing = await CometChatUIKit.getLoggedInUser().catch(() => null);
223
- if (existing) return;
224
- ```
225
-
226
- The RN SDK treats "no logged-in user" as a thrown error (not `null`), unlike the web SDK. Without the catch, every fresh launch aborts before reaching `login()`.
227
-
228
- **1.8.b — Render `e.message`, not `String(e)`.**
229
-
230
- ```ts
231
- // ❌ Most CometChat SDK errors are plain objects, not Error subclasses
232
- // → setError(String(e)) shows "[object Object]" on screen
233
- catch (e) {
234
- setError(String(e));
235
- }
236
-
237
- // ✅
238
- catch (e) {
239
- initialized = false; // let hot-reload retry
240
- const msg = e instanceof Error ? e.message : JSON.stringify(e);
241
- setError(msg);
242
- }
243
- ```
244
-
245
- Hiding the underlying error from the user is the single biggest debugging-time-sink in this stack. Always render `e.message` (or `JSON.stringify(e)` as fallback) so the actionable text reaches the screen.
246
-
247
- **1.8.c — DO NOT pass `onAccept` to `<CometChatIncomingCall>`.**
248
-
249
- ```tsx
250
- // ❌ Short-circuits the kit's internal acceptCall + OngoingCall transition.
251
- // Symptom: callee taps Accept; caller's outgoing screen stays on "Calling…"
252
- // indefinitely; the call connects at server level but UI never transitions.
253
- <CometChatIncomingCall call={call} onAccept={(c) => navigate('OngoingCall', ...)} ... />
254
-
255
- // ✅ Let the kit own the accept path; only handle decline + error
256
- <CometChatIncomingCall
257
- call={call}
258
- onDecline={() => setCallReceived(false)}
259
- onError={() => setCallReceived(false)}
260
- />
261
- ```
262
-
263
- The kit calls `CometChat.acceptCall` internally and pushes its own OngoingCall surface. Providing `onAccept` replaces that behavior with the caller's function — typically incomplete, never matches what the kit does.
264
-
265
- **Also recommended** — guard creds at init time so undefined `@env`/`process.env.EXPO_PUBLIC_*` values surface as actionable errors:
266
-
267
- ```ts
268
- if (!appId || !region) {
269
- throw new Error(
270
- `Missing CometChat credentials at init time: appId=${JSON.stringify(appId)}, region=${JSON.stringify(region)}. ` +
271
- `Check .env defines COMETCHAT_APP_ID/COMETCHAT_REGION/COMETCHAT_AUTH_KEY ` +
272
- `and restart Metro with cache wipe.`,
273
- );
274
- }
275
- ```
276
-
277
- Without this guard, undefined env values produce opaque `TypeError: undefined is not a function` from deep inside the SDK — the most expensive failure mode of a typo'd env name.
278
-
279
- ---
280
-
281
- ## 2. Setup
282
-
283
- ### Bare RN CLI
284
-
285
- ```bash
286
- npm install @cometchat/chat-sdk-react-native@^4 @cometchat/calls-sdk-react-native@^5
287
- npm install react-native-callkeep react-native-voip-push-notification @react-native-firebase/app @react-native-firebase/messaging
288
- npm install react-native-webrtc # Calls SDK peer dep
289
- npm install react-native-gesture-handler react-native-reanimated # already installed if using UI Kit
290
- ```
291
-
292
- **iOS — four hardening steps before `pod install`** (validated 2026-05-14 on Apple Silicon, iOS 26.5 sim):
293
-
294
- 1. **`USE_FRAMEWORKS=static pod install`** — required for WebRTC + CometChat pods. Default dynamic linkage silently produces a binary that can't load WebRTC at runtime. Set in shell rc or invoke every time:
295
-
296
- ```bash
297
- cd ios && USE_FRAMEWORKS=static pod install && cd ..
298
- # Subsequent builds:
299
- USE_FRAMEWORKS=static npx react-native run-ios
300
- ```
301
-
302
- 2. **Remove `EXCLUDED_ARCHS arm64 i386` from `ios/Podfile`** (Apple Silicon). RN templates often add this Intel-era workaround to the post-install hook; on Apple Silicon it blocks `react-native-webrtc`/`JitsiWebRTC` arm64 slices from linking against the simulator. Delete the line:
303
-
304
- ```ruby
305
- # ❌ Remove this from post_install on Apple Silicon
306
- config.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'arm64 i386'
307
- ```
308
-
309
- 3. **`ios/Info.plist`** — minimum set for calls:
310
-
311
- ```xml
312
- <key>NSCameraUsageDescription</key>
313
- <string>Camera access for video calls</string>
314
- <key>NSMicrophoneUsageDescription</key>
315
- <string>Microphone access for voice and video calls</string>
316
- <key>NSBluetoothAlwaysUsageDescription</key>
317
- <string>Bluetooth access for using headsets during calls</string>
318
- <key>UIBackgroundModes</key>
319
- <array>
320
- <string>audio</string>
321
- <string>voip</string>
322
- <string>remote-notification</string>
323
- </array>
324
- ```
325
-
326
- `UIBackgroundModes: audio` is the load-bearing one for call-audio survival when the app backgrounds; without it, audio cuts the instant the app loses foreground. `NSBluetoothAlways` prevents a crash when the user connects a Bluetooth headset mid-call.
327
-
328
- 4. **`ios/.xcode.env.local` NODE_BINARY** — point at a stable Homebrew Node path, not an nvm path that may have been cleaned up:
329
-
330
- ```bash
331
- # ios/.xcode.env.local
332
- export NODE_BINARY=/opt/homebrew/opt/node@20/bin/node
333
- ```
334
-
335
- nvm paths in `~/.nvm/versions/node/v20.x.y/bin/node` go stale when nvm prunes — Xcode build fails with `node: command not found`. Homebrew `/opt/homebrew/opt/node@20/bin/node` is symlinked to whatever node@20.x is currently installed; survives `brew upgrade`.
336
-
337
- **iOS-on-RN works even where iOS V5 NATIVE is blocked.** The native iOS V5 cohort is gated upstream by a Cloudsmith 404 on `cometchat-calls-ios`. The RN-on-iOS path links a different WebRTC surface (`react-native-webrtc` + `JitsiWebRTC` pod transitives), so customers on RN + iOS are NOT blocked by the native cohort's vendor issue.
338
-
339
- **Android — manifest permissions** (rule 1.3 + 1.6), Firebase config (`google-services.json` in `android/app/`), service registration:
340
-
341
- ```xml
342
- <service
343
- android:name="io.wazo.callkeep.RNCallKeepBackgroundMessagingService"
344
- android:foregroundServiceType="phoneCall|microphone|camera"
345
- android:exported="false" />
346
- ```
347
-
348
- ### Expo managed
349
-
350
- Calls SDK requires native modules — Expo managed CANNOT run it without a custom dev client. The skill detects the project mode:
351
-
352
- - **Managed + has `expo-dev-client`**: scaffolds config plugins for callkeep/firebase/voip-push, regenerates native projects, builds dev client
353
- - **Managed without dev client**: prompts the user — calls require either ejecting to bare or adding `expo-dev-client`
354
- - **EAS Build**: configures `eas.json` profiles + build commands
355
-
356
- Expo Go (the public dev client) cannot run calls. The skill states this clearly and refuses to scaffold without a dev client.
357
-
358
- #### ⚠️ Real build-time landmines on Expo SDK 54 + chat-uikit-react-native 5.3.x (validated 2026-05-14, 4 cohorts)
359
-
360
- A previous version of this doc listed three "Expo SDK 54 build traps" (document-picker removal, react-native-worklets install, NDK override). Re-validation on 2026-05-14 across **expo-new, expo-existing, rn-new, rn-existing** showed **none of those three fired** on the current combo (`chat-uikit-react-native@5.3.5` + `calls-sdk-react-native@5.0.0`/`4.4.1` + Expo SDK 54). Removed. The real landmines on this combo are different:
361
-
362
- 1. **`@cometchat/calls-lib-webrtc` is Cloudsmith-only, NOT on npm.** `npm install @cometchat/calls-lib-webrtc` returns 404. The package lives on CometChat's Cloudsmith registry. Use the tarball URL:
363
-
364
- ```bash
365
- npm install --legacy-peer-deps \
366
- 'https://dl.cloudsmith.io/public/cometchat/cometchat/raw/files/cometchat-calls-lib-webrtc-346a46ff.tgz'
367
- ```
368
-
369
- The exact revision hash may roll forward — check the Cloudsmith page for the current version. Without this, runtime fails when the WebRTC layer initializes.
370
-
371
- 2. **`--legacy-peer-deps` silently strips peer deps the kit needs at runtime.** chat-uikit-react-native does not declare all its transitive runtime peers in `peerDependencies` (kit + calls SDK together pull in `expo-linking`, `expo-constants`, `expo-asset`, `expo-font` via expo-router, plus `valibot`, `zustand`, `@xmldom/xmldom`, `abab`, `promise.allsettled`, `text-encoding`, `react-native-url-polyfill`, `react-native-performance`). With `--legacy-peer-deps`, npm skips them. Each one bites on first bundle as `Unable to resolve module ...`. Reinstall them explicitly:
372
-
373
- ```bash
374
- # Bare RN
375
- npm install --legacy-peer-deps \
376
- valibot zustand @xmldom/xmldom abab promise.allsettled text-encoding \
377
- react-native-url-polyfill react-native-performance
378
-
379
- # Expo (resolves to SDK-compatible versions)
380
- npx expo install \
381
- expo-linking expo-constants expo-asset expo-font \
382
- -- --legacy-peer-deps
383
- ```
384
-
385
- 3. **`expo.extra` (app.json) caches on the Expo dev client manifest.** Edits to `app.json → expo.extra` after `expo prebuild` do NOT reload to the device — `Constants.expoConfig.extra` keeps reading the prebuild-time snapshot. For dev iteration on credentials, EITHER hardcode in `src/config/*.ts` (Metro hot-bundles source changes) OR run `expo prebuild --clean && expo run:android` after every `app.json → extra` change.
386
-
387
- 4. **`react-native start` does NOT run `adb reverse` (bare RN only).** Only `react-native run-android` sets `adb reverse tcp:8081 tcp:8081`. When you restart Metro standalone (e.g. after `.env` changes), the device loses port-forwarding and shows "unable to load scripts." Fix:
388
-
389
- ```bash
390
- adb reverse tcp:8081 tcp:8081
391
- ```
392
-
393
- 5. **`react-native-dotenv` needs Metro `--reset-cache` after `.env` changes (bare RN only).** The babel plugin processes `.env` at compile time, not runtime. Workflow:
394
-
395
- ```bash
396
- pkill -9 -f "react-native start"
397
- npx react-native start --reset-cache
398
- adb reverse tcp:8081 tcp:8081
399
- adb shell am force-stop com.<package> && adb shell monkey -p com.<package> -c android.intent.category.LAUNCHER 1
400
- ```
401
-
402
- ### Init
403
-
404
- ```ts
405
- // cometchat/init.ts
406
- import { CometChat } from "@cometchat/chat-sdk-react-native";
407
- import { CometChatCalls } from "@cometchat/calls-sdk-react-native";
408
-
409
- let initialized = false;
410
-
411
- export async function initCometChat() {
412
- if (initialized) return;
413
-
414
- const appSettings = new CometChat.AppSettingsBuilder()
415
- .subscribePresenceForAllUsers()
416
- .setRegion(process.env.EXPO_PUBLIC_COMETCHAT_REGION!)
417
- .build();
418
-
419
- await CometChat.init(process.env.EXPO_PUBLIC_COMETCHAT_APP_ID!, appSettings);
420
-
421
- // Calls SDK init takes a FLAT object — there is no CallAppSettingsBuilder in v5 RN.
422
- await CometChatCalls.init({
423
- appId: process.env.EXPO_PUBLIC_COMETCHAT_APP_ID!,
424
- region: process.env.EXPO_PUBLIC_COMETCHAT_REGION!,
425
- authKey: process.env.EXPO_PUBLIC_COMETCHAT_AUTH_KEY!,
426
- });
427
-
428
- initialized = true;
429
- }
430
- ```
431
-
432
- (Bare RN uses `react-native-dotenv` and `@env` imports instead of `process.env.EXPO_PUBLIC_*` — see `cometchat-native-bare-patterns`.)
433
-
434
- ---
435
-
436
- ## 3. Components catalog
437
-
438
- ### Calls SDK primitives
439
-
440
- Same names + shapes as the JavaScript SDK (Section 3 of `cometchat-react-calls`). RN-relevant session helpers include `switchCamera()`, `setAudioMode(mode)`, `muteAudio()`/`unmuteAudio()`, `pauseVideo()`/`resumeVideo()` — see the SDK's custom-ui reference. (Web-only helpers like device enumeration and virtual background are not available on RN.)
441
-
442
- ### UI Kit views (additive mode — `@cometchat/chat-uikit-react-native`)
443
-
444
- | Component | Purpose |
445
- |---|---|
446
- | `<CometChatCallButtons user={u} group={g} />` | Voice + video icon row (typically inside `CometChatMessageHeader`). **Group + user semantics differ** — see callout below |
447
- | `<CometChatIncomingCall />` | Root-mounted; renders ringing UI for incoming call (controlled by parent state — see §1.7) |
448
- | `<CometChatOutgoingCall />` | Root-mounted; renders "Calling…" UI for outgoing call (controlled by parent state — see §1.7) |
449
- | `<CometChatOngoingCall />` | Root-mounted; renders active in-call view (controlled by parent state — see §1.7) |
450
- | `<CometChatCallLogs onItemClick={fn} />` | History |
451
-
452
- #### ⚠️ Group calls use message-based join, not the ringing channel (validated 2026-05-15)
453
-
454
- `<CometChatCallButtons group={group} />` does NOT call `CometChat.initiateCall` like the 1:1 user variant does. Source: `node_modules/@cometchat/chat-uikit-react-native/src/calls/CometChatCallButtons/CometChatCallButtons.tsx:138-201`.
455
-
456
- | Surface | What `<CometChatCallButtons>` does |
457
- |---|---|
458
- | `user={u}` | `CometChat.initiateCall(call)` → standard Ringing flow → `onIncomingCallReceived` fires on peer's `CallListener` |
459
- | `group={g}` | `CometChat.sendCustomMessage(meetingMessage)` → meeting-card message in the group; caller jumps straight to in-call surface |
460
-
461
- **Implication for receivers:**
462
- - **Other kit-based clients** (apps using `<CometChatMessageList />` to render group messages) — get the "Join meeting" card rendered automatically; tap to join. No additional plumbing.
463
- - **Custom-UI clients** (apps that render their own message list, or no list at all) — receive NOTHING on the `CallListener` channel for group calls. To handle group meetings, add a `CometChat.addMessageListener` and check for the custom meeting type:
464
-
465
- ```ts
466
- CometChat.addMessageListener('GROUP_MEETING_LISTENER', new CometChat.MessageListener({
467
- onCustomMessageReceived: (msg) => {
468
- if (msg.getCategory() === CometChat.CATEGORY_CUSTOM && msg.getType() === 'meeting') {
469
- const sessionId = (msg.getCustomData() as any)?.sessionId;
470
- const callType = (msg.getCustomData() as any)?.callType; // "audio" | "video"
471
- // Show your own "incoming group call" UI; tap to navigate to ongoing-call with sessionId
472
- }
473
- },
474
- }));
475
- ```
476
-
477
- This semantic is the same across all CometChat kits (React, Angular, native iOS, native Android, Flutter) — group calls broadcast via custom message, NOT the ringing channel. Document loudly because the symptom (group-call recipient sees nothing) looks like a bug but is by design.
478
-
479
- ---
480
-
481
- ## 4. Standalone integration
482
-
483
- When `product === "voice-video"` and there is no existing UI Kit.
484
-
485
- **Split by calling mode — these are two different shapes:**
486
-
487
- ### 4a. Standalone — Session mode (meeting-room UX, no ringing)
488
-
489
- Calls SDK ONLY. NO Chat SDK. Matches `calls-sdk-react-native-5/sample-apps/cometchat-calls-sample-app-react-native/`.
490
-
491
- > **⚠️ Idle timeout is in MILLISECONDS on React Native (the "instant exit on join" footgun).** Like the web SDK, the RN calls SDK's `SessionSettings` idle fields are **milliseconds, not seconds** (`calls-sdk-react-native/skills/session-settings`: `idleTimeoutPeriodBeforePrompt: 60000` ms). Setting `idleTimeoutPeriodBeforePrompt: 180` thinking "180s" means **180 ms** → the "Are you still there?" prompt fires and the session exits a fraction of a second after you join alone. Use ms: `{ idleTimeoutPeriodBeforePrompt: 180_000, idleTimeoutPeriodAfterPrompt: 60_000 }` (defaults 60_000 / 120_000). The timer only counts down when you're the **only** participant, so a solo test triggers it fastest. (Native Android/iOS/Flutter calls SDKs use **seconds** for `setIdleTimeoutPeriod`, default 300 — RN/web are the ms outliers.)
492
-
493
- **MANDATORY install set (MUST run BEFORE scaffolding files — bundle will fail with `Unable to resolve module <name>` for each one missing):**
494
-
495
- ```bash
496
- # Bare RN — session-only mode (all version pins are load-bearing, see notes below)
497
- npm install --legacy-peer-deps \
498
- '@cometchat/calls-sdk-react-native@^5.0.0' \
499
- 'https://dl.cloudsmith.io/public/cometchat/cometchat/raw/files/cometchat-calls-lib-webrtc-346a46ff.tgz' \
500
- 'react-native-webrtc@^124.0.0' \
501
- 'react-native-permissions@^5.0.0' \
502
- 'react-native-safe-area-context@^5.0.0' \
503
- '@react-native-async-storage/async-storage@^2.2.0' \
504
- '@xmldom/xmldom@^0.8.11' \
505
- 'react-native-svg@^15.0.0' \
506
- 'react-native-background-timer@^2.4.1' \
507
- 'react-native-performance@^5.1.0' \
508
- 'react-native-url-polyfill@^2.0.0' \
509
- 'valibot@^1.2.0' \
510
- 'zustand@^5.0.0' \
511
- 'text-encoding@^0.7.0' \
512
- 'abab@^2.0.6' \
513
- 'promise.allsettled@^1.0.7'
514
-
515
- # The Cloudsmith tarball sometimes silently skips on the same install line as
516
- # other packages — re-run it on its own if it's missing afterwards:
517
- [ -d node_modules/@cometchat/calls-lib-webrtc ] || \
518
- npm install --save --force \
519
- 'https://dl.cloudsmith.io/public/cometchat/cometchat/raw/files/cometchat-calls-lib-webrtc-346a46ff.tgz'
520
- ```
521
-
522
- **Critical version pins** — empirically validated 2026-05-15 (test #3, RN bare on Pixel 3 + RN 0.85):
523
-
524
- | Pin | Why |
525
- |---|---|
526
- | `@react-native-async-storage/async-storage@^2.2.0` | v3.x splits Android native code into a separate Maven artifact (`org.asyncstorage.shared_storage:storage-android:1.0.0`) that isn't widely published. Gradle fails with `Could not find org.asyncstorage.shared_storage:...`. Pin to ^2.2.0 (self-contained Android). |
527
- | `@xmldom/xmldom@^0.8.11` | The Calls SDK's polyfill (`dist/polyfills/browser.js`) assumes the xmldom 0.8 prototype shape. v0.9.x reorganized the prototype chain; runtime crashes with `Cannot set property 'innerHTML' of undefined` during polyfill init. Pin to ^0.8.11 (matches SDK's declared peer range). |
528
- | `react-native-webrtc@^124.0.0` | Older versions don't support React Native 0.74+ Fabric. |
529
- | `valibot@^1.2.0` / `zustand@^5.0.0` | SDK declares these specific majors; minor upgrades have been API-stable but pin to the declared range to avoid surprises. |
530
-
531
- **Metro config patch: route the calls SDK to its .mjs entry.** `@cometchat/calls-sdk-react-native@5.0.0` ships a broken CJS bundle at `dist/index.js` — line 1 is `import "./polyfills"` (ESM syntax inside a CJS file). Metro can't parse it; the import returns `undefined` and crashes at runtime as `Cannot read property 'CometChatCalls' of undefined` in your `init.ts`. The `dist/index.mjs` is correctly formed. Patch `metro.config.js`:
532
-
533
- ```js
534
- const { getDefaultConfig, mergeConfig } = require('@react-native/metro-config');
535
- const path = require('path');
536
-
537
- const config = {
538
- resolver: {
539
- resolveRequest: (context, moduleName, platform) => {
540
- if (moduleName === '@cometchat/calls-sdk-react-native') {
541
- return {
542
- filePath: path.resolve(
543
- __dirname,
544
- 'node_modules/@cometchat/calls-sdk-react-native/dist/index.mjs',
545
- ),
546
- type: 'sourceFile',
547
- };
548
- }
549
- return context.resolveRequest(context, moduleName, platform);
550
- },
551
- },
552
- };
553
-
554
- module.exports = mergeConfig(getDefaultConfig(__dirname), config);
555
- ```
556
-
557
- After patching, **`npx react-native start --reset-cache`** to clear Metro's resolver cache, then `run-android` / `run-ios`. Customer-found 2026-05-15 (test #3).
558
-
559
- **11 peer deps total** — derived empirically (test #3, 2026-05-15) by parsing the SDK's actual bundle imports (`node_modules/@cometchat/calls-sdk-react-native/dist/index.js` + `dist/polyfills/*.js`). Every one is a real bundle-time or runtime requirement. The npm CLI `--legacy-peer-deps` flag silently strips them, so they must be listed explicitly.
560
-
561
- **Failure-mode breakdown:**
562
-
563
- | Missing peer | Symptom |
564
- |---|---|
565
- | `@react-native-async-storage/async-storage` | `Unable to resolve module @react-native-async-storage/async-storage` at first bundle |
566
- | `react-native-svg` | `Unable to resolve module react-native-svg` at first bundle |
567
- | `react-native-background-timer` | `Unable to resolve module react-native-background-timer` (polyfills/browser.js) |
568
- | `valibot`, `zustand`, `react-native-webrtc` | Same — bundle-time imports in SDK index |
569
- | `@xmldom/xmldom`, `abab`, `promise.allsettled` | Same — polyfills/browser.js DOM + Promise polyfills |
570
- | `text-encoding`, `react-native-url-polyfill`, `react-native-performance` | Runtime — used inside SDK init code paths |
571
-
572
- **Also: DO NOT install `@cometchat/chat-sdk-react-native` in session-only mode.** Dead weight in source (never imported, never initialized) AND it transitively pulls async-storage which conflicts with our own peer-dep management.
573
-
574
- Verify checks: `rn_webrtc_peers` (11-peer presence) + `no_chat_sdk_in_session_only` (Chat SDK absence).
575
-
576
- The skill then scaffolds:
577
-
578
- 1. **`cometchat/init.ts`** — `CometChatCalls.init({ appId, region, authKey })` ONLY. No `CometChat.init`, no `CometChat.login`. Pass `authKey` at init so `CometChatCalls.login(uid)` needs no second arg.
579
- 2. **`screens/JoinSession.tsx`** — UID picker + Start/Join meeting + state machine (`inMeeting && callToken`).
580
- 3. **`screens/CallRoom.tsx`** — Renders `<CometChatCalls.Component callToken={callToken} />` inside `SafeAreaView`. `onConnectionClosed` listener resets state. See `references/call-session.md`.
581
- 4. **No VoIP push** — session mode is link-driven, not ringing-driven. No `react-native-callkeep`, no PushKit, no FCM data messages.
582
- 5. **Native config** — Camera + microphone permissions only.
583
-
584
- **Why no Chat SDK / no VoIP push:** session mode never initiates a call entity. Customers tap a meeting link, the app generates a token, joins the session. There's nothing to "ring." Initializing both SDKs + the VoIP-push stack adds substantial complexity for zero benefit.
585
-
586
- ### 4b. Standalone — Ringing mode (CallKeep + CallKit/ConnectionService + Incoming/Outgoing/Ongoing kit)
587
-
588
- Dual-SDK: Chat SDK signaling channel + Calls SDK media channel. The skill scaffolds:
589
-
590
- 1. **`cometchat/init.ts`** — Chat SDK + Calls SDK init (sequential).
591
- 2. **`cometchat/CometChatProvider.tsx`** — Provider with init+login gate.
592
- 3. **`hooks/useCallKeep.ts`** — Sets up `react-native-callkeep`, registers event listeners (didReceiveStartCallAction, answerCall, endCall).
593
- 4. **`services/voipPush.ts`** — Combines `react-native-voip-push-notification` (iOS) + `@react-native-firebase/messaging` (Android). Handles incoming-call payloads → `RNCallKeep.displayIncomingCall(...)`.
594
- 5. **`screens/ProfileScreen.tsx`** (or wherever the call trigger lives) — Voice + video buttons.
595
- 6. **`screens/OngoingCallScreen.tsx`** — Hosts call surface via `<CometChatCalls.Component />` OR custom UI overlay. Implements rule 1.5 cleanup (`CometChatCalls.leaveSession()` + `RNCallKeep.endCall(callUUID)`).
596
- 7. **`screens/CallLogsScreen.tsx`** — Paginated history.
597
- 8. **Native config** — Info.plist, AndroidManifest.xml, Firebase setup, capabilities.
598
- 9. **Server-side push docs** — describes the VoIP cert + FCM key requirements; cannot automate.
599
-
600
- ## 5. Additive integration
601
-
602
- When `cometchat-native-core` integration already exists. The skill:
603
-
604
- 1. Adds `@cometchat/calls-sdk-react-native` + the four push deps.
605
- 2. Patches `cometchat/init.ts` to add `CometChatCalls.init` after `CometChat.init`.
606
- 3. Mounts `<CometChatIncomingCall />` at app root (rule 1.7).
607
- 4. Wires `CometChatMessageHeader` call buttons (auto-rendered when `user` prop is set).
608
- 5. VoIP push: opt-in (asks user — substantial native config).
609
- 6. Adds a `CallLogsScreen` to the existing navigator if the user picked "dedicated screen".
610
-
611
- ## 6. Anti-patterns
612
-
613
- 1. **Using Expo Go for calls.** Calls require native modules that Expo Go can't load. Either eject or use a dev client. The skill refuses to scaffold against Expo Go.
614
- 2. **Skipping `cd ios && pod install`** after install. Symbols missing → "Native module CometChatCalls is null" runtime error. Bare RN only.
615
- 3. **Mounting `<CometChatIncomingCall />` inside a stack/tab navigator.** Loses the listener on stack push. Mount in App.tsx above the navigator (rule 1.7).
616
- 4. **Forgetting `RNCallKeep.endCall`** in the hangup path. CallKit/ConnectionService thinks the call is still active; lock-screen UI gets stuck.
617
- 5. **Sending Android push as `notification` instead of `data`.** ConnectionService cannot intercept `notification` payloads. Server must send `data: { type: "incoming_call", sessionId: "..." }` with `priority: "high"`.
618
- 6. **Missing Firebase `google-services.json`** for Android. Builds fail at compile time but the error is buried in Gradle output.
619
- 7. **Mixing `react-native-callkeep` v4 with RN <0.70.** Older RN versions need callkeep v3.x; the skill checks RN version.
620
- 8. **Passing `onAccept` to `<CometChatIncomingCall>`** (rule 1.8.c). Short-circuits the kit's internal `acceptCall` + OngoingCall transition — callee's UI moves but caller stays on "Calling…" indefinitely. Only handle `onDecline` + `onError`; let the kit own the accept path.
621
- 9. **`setError(String(e))` in catch blocks** (rule 1.8.b). Most SDK errors aren't `Error` subclasses → screen shows `[object Object]`. Use `e instanceof Error ? e.message : JSON.stringify(e)`.
622
- 10. **`await CometChatUIKit.getLoggedInUser()` without `.catch(() => null)`** (rule 1.8.a). RN SDK throws "User not found" on no-session — kills init before login can run.
623
- 11. **`pod install` without `USE_FRAMEWORKS=static`.** Default dynamic linkage produces a binary that can't load WebRTC at runtime. iOS only.
624
- 12. **`EXCLUDED_ARCHS = 'arm64 i386'` in Podfile post_install on Apple Silicon.** Intel-era workaround that breaks arm64 simulator linking for WebRTC pods. Remove on Apple Silicon hosts.
625
- 13. **`react-native start` followed by app reload without `adb reverse tcp:8081 tcp:8081`.** Only `run-android` sets the port forward; standalone Metro restart loses it. Symptom: "unable to load scripts." Bare RN only.
626
- 14. **Editing `.env` and expecting Metro hot-reload to pick it up.** `react-native-dotenv` is a babel-time plugin — `.env` changes need Metro `--reset-cache`. Bare RN only.
627
- 15. **Installing CometChat deps with `--legacy-peer-deps` and expecting all transitive peers to land.** npm silently skips peers — install `valibot`, `zustand`, `@xmldom/xmldom`, `abab`, `promise.allsettled`, `text-encoding`, `react-native-url-polyfill`, `react-native-performance`, plus Expo's `expo-linking`/`expo-constants`/`expo-asset`/`expo-font` explicitly. See §2 setup landmines.
628
- 16. **`npm install @cometchat/calls-lib-webrtc`.** Returns 404 — package is Cloudsmith-only. Use the `https://dl.cloudsmith.io/...` tarball URL.
629
-
630
- ## 7. Verification checklist
631
-
632
- **Static:**
633
-
634
- - [ ] All seven packages: chat-sdk-react-native, calls-sdk-react-native, callkeep, voip-push-notification, firebase/app, firebase/messaging, webrtc
635
- - [ ] `@cometchat/calls-lib-webrtc` installed via Cloudsmith tarball (not npm — npm returns 404)
636
- - [ ] iOS: `Info.plist` has UIBackgroundModes (audio + voip + remote-notification) + camera/mic/Bluetooth strings (rule 1.6 + §2 setup)
637
- - [ ] iOS: PushKit token registration in App.tsx (or a hook called from there)
638
- - [ ] iOS: `USE_FRAMEWORKS=static` used for `pod install`
639
- - [ ] iOS (Apple Silicon): no `EXCLUDED_ARCHS = 'arm64 i386'` in Podfile post_install
640
- - [ ] iOS: `.xcode.env.local` NODE_BINARY points at stable Homebrew node path
641
- - [ ] Android: manifest has all four FOREGROUND_SERVICE_* permissions + MANAGE_OWN_CALLS + BIND_TELECOM_CONNECTION_SERVICE
642
- - [ ] Android: `google-services.json` in `android/app/`
643
- - [ ] Android: callkeep service registered with correct `foregroundServiceType`
644
- - [ ] CometChatIncomingCall mounted at App.tsx (additive mode), no `onAccept` prop (rule 1.8.c)
645
- - [ ] CometChatUIKit.getLoggedInUser called with `.catch(() => null)` (rule 1.8.a)
646
- - [ ] Error rendering uses `e.message` not `String(e)` (rule 1.8.b)
647
- - [ ] Env-var guard: provider throws actionable error when appId/region undefined (rule 1.8.c "Also recommended")
648
- - [ ] Hangup path includes `leaveSession()` (v5-canonical; `endSession` is a deprecated shim) + `RNCallKeep.endCall`
649
- - [ ] Module-level `initialized` flag
650
-
651
- **Runtime (real devices, both platforms):**
652
-
653
- - [ ] iOS — terminated app, lock screen rings on incoming call
654
- - [ ] iOS — answer from lock screen → opens app, joins ongoing call
655
- - [ ] Android — terminated app, ConnectionService rings (full-screen heads-up) on incoming call
656
- - [ ] Android — answer from notification → opens app, joins ongoing call
657
- - [ ] Both — outgoing call connects, two-way audio + video
658
- - [ ] Both — hangup releases camera + mic, no lingering system call UI
659
- - [ ] Both — Android 14+: ongoing-call notification visible, doesn't get killed by swipe
660
- - [ ] Expo: only on dev client / standalone build, not Expo Go
661
-
662
- ## 8. Pointers
663
-
664
- - `cometchat-native-core` — provider, init, gesture handler peer deps
665
- - `cometchat-native-{expo,bare}-patterns` — pod install, gesture handler, dev client setup
666
- - `cometchat-native-components` — full UI Kit catalog (additive mode)
667
- - `cometchat-native-push` — APNs + FCM for chat (overlap with VoIP push but distinct paths — chat push is APNs/FCM standard, VoIP push is PushKit/FCM data-message)
668
- - `cometchat-native-production` — server-minted tokens
669
- - `cometchat-native-troubleshooting` — Metro cache, pod install failures, privacy manifest, gesture handler conflicts