@cometchat/skills 4.4.2 → 5.0.1

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 (518) hide show
  1. package/.claude-plugin/marketplace.json +55 -0
  2. package/.claude-plugin/plugin.json +14 -0
  3. package/CHANGELOG.md +44 -0
  4. package/LICENSE +21 -0
  5. package/MIGRATING.md +187 -0
  6. package/README.md +52 -156
  7. package/RULES.md +125 -0
  8. package/bin/cometchat-skills.mjs +1280 -0
  9. package/bin/legacy-skills.json +95 -0
  10. package/catalogs/android-v6.json +1646 -0
  11. package/catalogs/flutter-v6.json +651 -0
  12. package/catalogs/ios-v5.json +1383 -0
  13. package/catalogs/rn-calls-v5.json +134 -0
  14. package/catalogs/rn-calls-v5.symbols.txt +58 -0
  15. package/catalogs/rn-sdk-v4.json +672 -0
  16. package/catalogs/rn-v5.json +449 -0
  17. package/catalogs/rn-v5.symbols.txt +216 -0
  18. package/catalogs/sdk-android-v5.json +514 -0
  19. package/contracts.android-calls-v5.json +122 -0
  20. package/contracts.android-v6.json +135 -0
  21. package/contracts.angular-v5.json +694 -0
  22. package/contracts.flutter-calls-v5.json +77 -0
  23. package/contracts.flutter-v6.json +126 -0
  24. package/contracts.ios-calls-v5.json +67 -0
  25. package/contracts.ios-v5.json +436 -0
  26. package/contracts.json +82 -0
  27. package/contracts.rn-calls-v5.json +77 -0
  28. package/contracts.rn-v5.json +727 -0
  29. package/contracts.sdk-android-v5.json +15 -0
  30. package/contracts.web-calls-v5.json +45 -0
  31. package/features.android-calls-v5.json +246 -0
  32. package/features.android-v6.json +65 -0
  33. package/features.angular-v5.json +521 -0
  34. package/features.flutter-calls-v5.json +286 -0
  35. package/features.flutter-v6.json +484 -0
  36. package/features.ios-calls-v5.json +236 -0
  37. package/features.ios-v5.json +573 -0
  38. package/features.json +61 -0
  39. package/features.rn-calls-v5.json +187 -0
  40. package/features.rn-v5.json +614 -0
  41. package/features.sdk-android-v5.json +40 -0
  42. package/features.sdk-jsv4.json +24 -0
  43. package/features.web-calls-v5.json +108 -0
  44. package/package.json +156 -74
  45. package/peers.yaml +355 -0
  46. package/registry/README.md +31 -0
  47. package/registry/android-calls-v5.json +94 -0
  48. package/registry/android-v6.json +177 -0
  49. package/registry/angular-v5.json +154 -0
  50. package/registry/flutter-calls-v5.json +94 -0
  51. package/registry/flutter-v6.json +159 -0
  52. package/registry/ios-calls-v5.json +99 -0
  53. package/registry/ios-v5.json +152 -0
  54. package/registry/rn-calls-v5.json +99 -0
  55. package/registry/rn-v5.json +169 -0
  56. package/registry/sdk-android-v5.json +93 -0
  57. package/registry/sdk-jsv4.json +93 -0
  58. package/registry/web-calls-v5.json +94 -0
  59. package/registry/web-v7.json +154 -0
  60. package/skills/cometchat/SKILL.md +47 -2096
  61. package/skills/cometchat-a11y/SKILL.md +44 -472
  62. package/skills/cometchat-analytics/SKILL.md +61 -0
  63. package/skills/cometchat-android-v5-calls-sdk/SKILL.md +206 -0
  64. package/skills/cometchat-android-v5-calls-sdk/references/build-truth.md +63 -0
  65. package/skills/cometchat-android-v5-calls-sdk/references/docs-map.md +119 -0
  66. package/skills/cometchat-android-v5-calls-sdk/references/method-map.md +53 -0
  67. package/skills/cometchat-android-v5-calls-sdk/references/pitfalls.md +72 -0
  68. package/skills/cometchat-android-v5-calls-sdk/references/ringing.md +92 -0
  69. package/skills/cometchat-android-v5-calls-sdk/references/user-switch.md +90 -0
  70. package/skills/cometchat-android-v5-sdk/SKILL.md +127 -0
  71. package/skills/cometchat-android-v5-sdk/references/app-surface.md +88 -0
  72. package/skills/cometchat-android-v5-sdk/references/docs-map.md +91 -0
  73. package/skills/cometchat-android-v6-builder-settings/SKILL.md +51 -137
  74. package/skills/cometchat-android-v6-calls/SKILL.md +128 -413
  75. package/skills/cometchat-android-v6-compose-components/SKILL.md +84 -194
  76. package/skills/cometchat-android-v6-compose-customization/SKILL.md +66 -411
  77. package/skills/cometchat-android-v6-compose-placement/SKILL.md +154 -237
  78. package/skills/cometchat-android-v6-core/SKILL.md +236 -672
  79. package/skills/cometchat-android-v6-core/references/anti-patterns.md +31 -0
  80. package/skills/cometchat-android-v6-core/references/component-props.md +168 -0
  81. package/skills/cometchat-android-v6-core/references/docs-map.md +153 -0
  82. package/skills/cometchat-android-v6-core/references/layout.md +112 -0
  83. package/skills/cometchat-android-v6-core/references/lifecycle.md +75 -0
  84. package/skills/cometchat-android-v6-core/references/setup-credentials.md +105 -0
  85. package/skills/cometchat-android-v6-core/references/troubleshooting.md +36 -0
  86. package/skills/cometchat-android-v6-events/SKILL.md +46 -184
  87. package/skills/cometchat-android-v6-extensions/SKILL.md +39 -179
  88. package/skills/cometchat-android-v6-features/SKILL.md +74 -143
  89. package/skills/cometchat-android-v6-kotlin-components/SKILL.md +75 -193
  90. package/skills/cometchat-android-v6-kotlin-customization/SKILL.md +67 -419
  91. package/skills/cometchat-android-v6-kotlin-placement/SKILL.md +77 -223
  92. package/skills/cometchat-android-v6-migration/SKILL.md +67 -378
  93. package/skills/cometchat-android-v6-production/SKILL.md +41 -179
  94. package/skills/cometchat-android-v6-push/SKILL.md +39 -289
  95. package/skills/cometchat-android-v6-testing/SKILL.md +50 -265
  96. package/skills/cometchat-android-v6-troubleshooting/SKILL.md +70 -254
  97. package/skills/cometchat-angular-v5-calls/SKILL.md +193 -0
  98. package/skills/cometchat-angular-v5-components/SKILL.md +131 -0
  99. package/skills/cometchat-angular-v5-components/references/catalog.md +111 -0
  100. package/skills/cometchat-angular-v5-components/references/host-composed.md +46 -0
  101. package/skills/cometchat-angular-v5-core/SKILL.md +300 -0
  102. package/skills/cometchat-angular-v5-core/references/anti-patterns.md +49 -0
  103. package/skills/cometchat-angular-v5-core/references/component-props.md +55 -0
  104. package/skills/cometchat-angular-v5-core/references/dependencies.md +66 -0
  105. package/skills/cometchat-angular-v5-core/references/docs-map.md +132 -0
  106. package/skills/cometchat-angular-v5-core/references/layout.md +64 -0
  107. package/skills/cometchat-angular-v5-core/references/lifecycle.md +202 -0
  108. package/skills/cometchat-angular-v5-core/references/setup-credentials.md +137 -0
  109. package/skills/cometchat-angular-v5-core/references/theming.md +70 -0
  110. package/skills/cometchat-angular-v5-core/references/troubleshooting.md +27 -0
  111. package/skills/cometchat-angular-v5-customization/SKILL.md +94 -0
  112. package/skills/cometchat-angular-v5-features/SKILL.md +107 -0
  113. package/skills/cometchat-angular-v5-features/references/custom-messages.md +133 -0
  114. package/skills/cometchat-angular-v5-features/references/formatters.md +28 -0
  115. package/skills/cometchat-angular-v5-features/references/host-composed-extensions.md +85 -0
  116. package/skills/cometchat-angular-v5-migration/SKILL.md +40 -0
  117. package/skills/cometchat-angular-v5-migration/references/migration-guide.md +165 -0
  118. package/skills/cometchat-angular-v5-patterns/SKILL.md +107 -0
  119. package/skills/cometchat-angular-v5-placement/SKILL.md +133 -0
  120. package/skills/cometchat-angular-v5-placement/references/combined-app.md +174 -0
  121. package/skills/cometchat-angular-v5-placement/references/core-surface.md +199 -0
  122. package/skills/cometchat-angular-v5-production/SKILL.md +102 -0
  123. package/skills/cometchat-angular-v5-push/SKILL.md +61 -0
  124. package/skills/cometchat-angular-v5-testing/SKILL.md +112 -0
  125. package/skills/cometchat-angular-v5-troubleshooting/SKILL.md +96 -0
  126. package/skills/cometchat-audit/SKILL.md +61 -0
  127. package/skills/cometchat-compliance/SKILL.md +63 -0
  128. package/skills/cometchat-flutter-v5-sdk/SKILL.md +188 -0
  129. package/skills/cometchat-flutter-v5-sdk/references/doc-corrections.md +55 -0
  130. package/skills/cometchat-flutter-v5-sdk/references/docs-map.md +211 -0
  131. package/skills/cometchat-flutter-v5-sdk/references/platform-notes.md +48 -0
  132. package/skills/cometchat-flutter-v5-sdk/references/transcription.md +87 -0
  133. package/skills/cometchat-flutter-v6-calls/SKILL.md +75 -389
  134. package/skills/cometchat-flutter-v6-components/SKILL.md +88 -361
  135. package/skills/cometchat-flutter-v6-core/SKILL.md +154 -593
  136. package/skills/cometchat-flutter-v6-core/references/anti-patterns.md +55 -0
  137. package/skills/cometchat-flutter-v6-core/references/docs-map.md +143 -0
  138. package/skills/cometchat-flutter-v6-core/references/layout.md +45 -0
  139. package/skills/cometchat-flutter-v6-core/references/lifecycle.md +87 -0
  140. package/skills/cometchat-flutter-v6-core/references/setup-credentials.md +84 -0
  141. package/skills/cometchat-flutter-v6-core/references/troubleshooting.md +26 -0
  142. package/skills/cometchat-flutter-v6-customization/SKILL.md +70 -712
  143. package/skills/cometchat-flutter-v6-events/SKILL.md +79 -174
  144. package/skills/cometchat-flutter-v6-features/SKILL.md +55 -394
  145. package/skills/cometchat-flutter-v6-migration/SKILL.md +68 -367
  146. package/skills/cometchat-flutter-v6-migration/references/migration-guide.md +132 -0
  147. package/skills/cometchat-flutter-v6-patterns/SKILL.md +61 -0
  148. package/skills/cometchat-flutter-v6-placement/SKILL.md +94 -381
  149. package/skills/cometchat-flutter-v6-production/SKILL.md +59 -615
  150. package/skills/cometchat-flutter-v6-push/SKILL.md +46 -455
  151. package/skills/cometchat-flutter-v6-testing/SKILL.md +68 -299
  152. package/skills/cometchat-flutter-v6-troubleshooting/SKILL.md +54 -878
  153. package/skills/cometchat-i18n/SKILL.md +35 -404
  154. package/skills/cometchat-ios-calls/SKILL.md +112 -563
  155. package/skills/cometchat-ios-components/SKILL.md +44 -834
  156. package/skills/cometchat-ios-core/SKILL.md +182 -1068
  157. package/skills/cometchat-ios-core/references/anti-patterns.md +113 -0
  158. package/skills/cometchat-ios-core/references/docs-map.md +124 -0
  159. package/skills/cometchat-ios-core/references/install.md +23 -0
  160. package/skills/cometchat-ios-core/references/layout.md +219 -0
  161. package/skills/cometchat-ios-core/references/setup-credentials.md +197 -0
  162. package/skills/cometchat-ios-core/references/swiftui.md +91 -0
  163. package/skills/cometchat-ios-core/references/troubleshooting.md +100 -0
  164. package/skills/cometchat-ios-customization/SKILL.md +33 -968
  165. package/skills/cometchat-ios-features/SKILL.md +29 -738
  166. package/skills/cometchat-ios-migration/SKILL.md +39 -0
  167. package/skills/cometchat-ios-placement/SKILL.md +51 -729
  168. package/skills/cometchat-ios-production/SKILL.md +67 -723
  169. package/skills/cometchat-ios-push/SKILL.md +24 -602
  170. package/skills/cometchat-ios-testing/SKILL.md +36 -355
  171. package/skills/cometchat-ios-troubleshooting/SKILL.md +31 -989
  172. package/skills/cometchat-ios-v5-sdk/SKILL.md +161 -0
  173. package/skills/cometchat-ios-v5-sdk/references/docs-map.md +326 -0
  174. package/skills/cometchat-js-v5-sdk/SKILL.md +95 -0
  175. package/skills/cometchat-js-v5-sdk/references/docs-map.md +114 -0
  176. package/skills/cometchat-migrate-from-getstream/SKILL.md +65 -0
  177. package/skills/cometchat-migrate-from-getstream/references/concept-map.md +98 -0
  178. package/skills/cometchat-migrate-from-getstream/references/data-migration.md +74 -0
  179. package/skills/cometchat-migrate-from-getstream/references/feature-map.md +108 -0
  180. package/skills/cometchat-migrate-from-getstream/references/inventory.md +82 -0
  181. package/skills/cometchat-migrate-from-getstream/references/native-build.md +9 -0
  182. package/skills/cometchat-migrate-from-getstream/references/report-template.md +59 -0
  183. package/skills/cometchat-migrate-from-sendbird/SKILL.md +64 -0
  184. package/skills/cometchat-migrate-from-sendbird/references/concept-map.md +99 -0
  185. package/skills/cometchat-migrate-from-sendbird/references/data-migration.md +74 -0
  186. package/skills/cometchat-migrate-from-sendbird/references/feature-map.md +104 -0
  187. package/skills/cometchat-migrate-from-sendbird/references/inventory.md +86 -0
  188. package/skills/cometchat-migrate-from-sendbird/references/native-build.md +10 -0
  189. package/skills/cometchat-migrate-from-sendbird/references/report-template.md +59 -0
  190. package/skills/cometchat-migrate-from-twilio/SKILL.md +52 -0
  191. package/skills/cometchat-migrate-from-twilio/references/concept-map.md +49 -0
  192. package/skills/cometchat-migrate-from-twilio/references/data-migration.md +50 -0
  193. package/skills/cometchat-migrate-from-twilio/references/feature-map.md +27 -0
  194. package/skills/cometchat-migrate-from-twilio/references/inventory.md +53 -0
  195. package/skills/cometchat-migrate-from-twilio/references/report-template.md +52 -0
  196. package/skills/cometchat-moderation/SKILL.md +58 -0
  197. package/skills/cometchat-onboarding/SKILL.md +92 -0
  198. package/skills/cometchat-onboarding/references/archetypes.md +51 -0
  199. package/skills/cometchat-onboarding/references/calling-first.md +77 -0
  200. package/skills/cometchat-onboarding/references/not-in-this-pack.md +8 -0
  201. package/skills/cometchat-onboarding/references/plan-artifact.md +133 -0
  202. package/skills/cometchat-onboarding/references/platforms.md +105 -0
  203. package/skills/cometchat-react-native-bare-patterns/SKILL.md +120 -0
  204. package/skills/cometchat-react-native-calls/SKILL.md +200 -0
  205. package/skills/cometchat-react-native-components/SKILL.md +142 -0
  206. package/skills/cometchat-react-native-core/SKILL.md +335 -0
  207. package/skills/cometchat-react-native-core/references/anti-patterns.md +79 -0
  208. package/skills/cometchat-react-native-core/references/component-props.md +105 -0
  209. package/skills/cometchat-react-native-core/references/dependencies.md +62 -0
  210. package/skills/cometchat-react-native-core/references/docs-map.md +127 -0
  211. package/skills/cometchat-react-native-core/references/layout.md +61 -0
  212. package/skills/cometchat-react-native-core/references/lifecycle.md +64 -0
  213. package/skills/cometchat-react-native-core/references/setup-credentials.md +39 -0
  214. package/skills/cometchat-react-native-customization/SKILL.md +198 -0
  215. package/skills/cometchat-react-native-expo-patterns/SKILL.md +116 -0
  216. package/skills/cometchat-react-native-features/SKILL.md +122 -0
  217. package/skills/cometchat-react-native-migration/SKILL.md +103 -0
  218. package/skills/cometchat-react-native-placement/SKILL.md +158 -0
  219. package/skills/cometchat-react-native-production/SKILL.md +79 -0
  220. package/skills/cometchat-react-native-push/SKILL.md +88 -0
  221. package/skills/cometchat-react-native-sdk/SKILL.md +133 -0
  222. package/skills/cometchat-react-native-sdk/references/method-map.md +239 -0
  223. package/skills/cometchat-react-native-sdk/references/page-map.md +96 -0
  224. package/skills/cometchat-react-native-testing/SKILL.md +94 -0
  225. package/skills/cometchat-react-native-troubleshooting/SKILL.md +174 -0
  226. package/skills/cometchat-react-native-v5-sdk/SKILL.md +150 -0
  227. package/skills/cometchat-react-native-v5-sdk/references/docs-map.md +127 -0
  228. package/skills/cometchat-react-native-v5-sdk/references/ringing-voip.md +369 -0
  229. package/skills/cometchat-react-v7-calls/SKILL.md +75 -0
  230. package/skills/cometchat-react-v7-components/SKILL.md +72 -0
  231. package/skills/cometchat-react-v7-core/SKILL.md +101 -0
  232. package/skills/cometchat-react-v7-core/references/anti-patterns.md +19 -0
  233. package/skills/cometchat-react-v7-core/references/component-props.md +82 -0
  234. package/skills/cometchat-react-v7-core/references/dependencies.md +23 -0
  235. package/skills/cometchat-react-v7-core/references/docs-map.md +117 -0
  236. package/skills/cometchat-react-v7-core/references/layout.md +150 -0
  237. package/skills/cometchat-react-v7-core/references/lifecycle.md +74 -0
  238. package/skills/cometchat-react-v7-core/references/setup-credentials.md +58 -0
  239. package/skills/cometchat-react-v7-core/references/ssr.md +11 -0
  240. package/skills/cometchat-react-v7-core/references/theming.md +52 -0
  241. package/skills/cometchat-react-v7-customization/SKILL.md +84 -0
  242. package/skills/cometchat-react-v7-features/SKILL.md +92 -0
  243. package/skills/cometchat-react-v7-migration/SKILL.md +39 -0
  244. package/skills/cometchat-react-v7-migration/references/migration-guide.md +119 -0
  245. package/skills/cometchat-react-v7-patterns/SKILL.md +43 -0
  246. package/skills/cometchat-react-v7-placement/SKILL.md +106 -0
  247. package/skills/cometchat-react-v7-placement/references/recipes.md +354 -0
  248. package/skills/cometchat-react-v7-production/SKILL.md +84 -0
  249. package/skills/cometchat-react-v7-push/SKILL.md +53 -0
  250. package/skills/cometchat-react-v7-testing/SKILL.md +60 -0
  251. package/skills/cometchat-react-v7-troubleshooting/SKILL.md +47 -0
  252. package/skills/cometchat-security/SKILL.md +80 -0
  253. package/skills/cometchat-self-host/SKILL.md +56 -0
  254. package/test-suite/README.md +70 -0
  255. package/test-suite/catalogs/android-calls-v5.json +830 -0
  256. package/test-suite/catalogs/android-calls-v5.symbols.txt +499 -0
  257. package/test-suite/catalogs/android-v6.json +1646 -0
  258. package/test-suite/catalogs/android-v6.symbols.txt +298 -0
  259. package/test-suite/catalogs/angular-v5.json +7587 -0
  260. package/test-suite/catalogs/flutter-calls-v5.json +196 -0
  261. package/test-suite/catalogs/flutter-calls-v5.symbols.txt +59 -0
  262. package/test-suite/catalogs/flutter-v6.json +651 -0
  263. package/test-suite/catalogs/ios-calls-v5.json +158 -0
  264. package/test-suite/catalogs/ios-calls-v5.symbols.txt +70 -0
  265. package/test-suite/catalogs/ios-v5.json +1383 -0
  266. package/test-suite/catalogs/ios-v5.symbols.txt +699 -0
  267. package/test-suite/catalogs/rn-calls-v5.json +134 -0
  268. package/test-suite/catalogs/rn-sdk-v4.json +672 -0
  269. package/test-suite/catalogs/rn-v5.json +449 -0
  270. package/test-suite/catalogs/sdk-android-v5.json +514 -0
  271. package/test-suite/catalogs/sdk-android-v5.symbols.txt +254 -0
  272. package/test-suite/catalogs/sdk-jsv4.json +800 -0
  273. package/test-suite/catalogs/web-calls-v5.json +195 -0
  274. package/test-suite/catalogs/web-v7.json +1243 -0
  275. package/test-suite/scripts/build-registry.mjs +113 -0
  276. package/test-suite/scripts/catalog-refresh-dart.mjs +151 -0
  277. package/test-suite/scripts/catalog-refresh.mjs +100 -0
  278. package/test-suite/scripts/lint-skills.mjs +932 -0
  279. package/test-suite/scripts/measure-tokens.mjs +169 -0
  280. package/test-suite/scripts/typecheck-fences-dart.mjs +437 -0
  281. package/test-suite/scripts/typecheck-fences-kotlin.mjs +269 -0
  282. package/test-suite/scripts/typecheck-fences.mjs +206 -0
  283. package/test-suite/scripts/verify-catalog.mjs +242 -0
  284. package/test-suite/scripts/verify-contract-fences.mjs +94 -0
  285. package/test-suite/scripts/verify-detection.mjs +178 -0
  286. package/test-suite/scripts/verify-docs-base.mjs +91 -0
  287. package/test-suite/scripts/verify-family-agnostic.mjs +134 -0
  288. package/test-suite/scripts/verify-golden-path.mjs +138 -0
  289. package/test-suite/scripts/verify-oracle-components.mjs +133 -0
  290. package/test-suite/scripts/verify-template-bindings.mjs +148 -0
  291. package/test-suite/typecheck/angular-v5/package.json +21 -0
  292. package/test-suite/typecheck/angular-v5/tsconfig.json +21 -0
  293. package/test-suite/typecheck/flutter-v6/analysis_options.yaml +25 -0
  294. package/test-suite/typecheck/flutter-v6/pubspec.yaml +21 -0
  295. package/test-suite/typecheck/web-v7/package.json +18 -0
  296. package/test-suite/typecheck/web-v7/tsconfig.json +19 -0
  297. package/bin/install.js +0 -1003
  298. package/skills/.claude-plugin/marketplace.json +0 -86
  299. package/skills/cometchat/references/asking-questions.md +0 -48
  300. package/skills/cometchat-android-v5/SKILL.md +0 -121
  301. package/skills/cometchat-android-v5-calls/SKILL.md +0 -429
  302. package/skills/cometchat-android-v5-calls/references/README.md +0 -53
  303. package/skills/cometchat-android-v5-calls/references/add-calls-to-existing-chat.md +0 -197
  304. package/skills/cometchat-android-v5-calls/references/audio-controls.md +0 -91
  305. package/skills/cometchat-android-v5-calls/references/background-handling.md +0 -168
  306. package/skills/cometchat-android-v5-calls/references/call-layouts.md +0 -131
  307. package/skills/cometchat-android-v5-calls/references/call-logs.md +0 -113
  308. package/skills/cometchat-android-v5-calls/references/call-session.md +0 -274
  309. package/skills/cometchat-android-v5-calls/references/custom-ui.md +0 -150
  310. package/skills/cometchat-android-v5-calls/references/event-listeners.md +0 -123
  311. package/skills/cometchat-android-v5-calls/references/group-calls.md +0 -205
  312. package/skills/cometchat-android-v5-calls/references/idle-timeout.md +0 -117
  313. package/skills/cometchat-android-v5-calls/references/in-call-chat.md +0 -134
  314. package/skills/cometchat-android-v5-calls/references/join-session.md +0 -120
  315. package/skills/cometchat-android-v5-calls/references/migration-v4-to-v5.md +0 -222
  316. package/skills/cometchat-android-v5-calls/references/participant-management.md +0 -110
  317. package/skills/cometchat-android-v5-calls/references/picture-in-picture.md +0 -106
  318. package/skills/cometchat-android-v5-calls/references/raise-hand.md +0 -248
  319. package/skills/cometchat-android-v5-calls/references/recording.md +0 -101
  320. package/skills/cometchat-android-v5-calls/references/ringing-integration.md +0 -152
  321. package/skills/cometchat-android-v5-calls/references/screen-sharing.md +0 -78
  322. package/skills/cometchat-android-v5-calls/references/server-fcm-voip.md +0 -215
  323. package/skills/cometchat-android-v5-calls/references/session-settings.md +0 -121
  324. package/skills/cometchat-android-v5-calls/references/setup.md +0 -137
  325. package/skills/cometchat-android-v5-calls/references/share-invite.md +0 -156
  326. package/skills/cometchat-android-v5-calls/references/video-controls.md +0 -87
  327. package/skills/cometchat-android-v5-calls/references/voip-calling.md +0 -526
  328. package/skills/cometchat-android-v5-components/SKILL.md +0 -431
  329. package/skills/cometchat-android-v5-core/SKILL.md +0 -486
  330. package/skills/cometchat-android-v5-customization/SKILL.md +0 -469
  331. package/skills/cometchat-android-v5-extensions/SKILL.md +0 -127
  332. package/skills/cometchat-android-v5-features/SKILL.md +0 -131
  333. package/skills/cometchat-android-v5-placement/SKILL.md +0 -277
  334. package/skills/cometchat-android-v5-production/SKILL.md +0 -95
  335. package/skills/cometchat-android-v5-push/SKILL.md +0 -619
  336. package/skills/cometchat-android-v5-testing/SKILL.md +0 -188
  337. package/skills/cometchat-android-v5-theming/SKILL.md +0 -167
  338. package/skills/cometchat-android-v5-troubleshooting/SKILL.md +0 -74
  339. package/skills/cometchat-android-v6/SKILL.md +0 -108
  340. package/skills/cometchat-android-v6-calls/references/add-calls-to-existing-chat.md +0 -97
  341. package/skills/cometchat-android-v6-calls/references/advanced-features.md +0 -87
  342. package/skills/cometchat-android-v6-calls/references/call-layouts.md +0 -100
  343. package/skills/cometchat-android-v6-calls/references/call-session.md +0 -163
  344. package/skills/cometchat-android-v6-calls/references/device-management.md +0 -172
  345. package/skills/cometchat-android-v6-calls/references/group-calls.md +0 -191
  346. package/skills/cometchat-android-v6-calls/references/idle-timeout.md +0 -110
  347. package/skills/cometchat-android-v6-calls/references/in-call-chat.md +0 -141
  348. package/skills/cometchat-android-v6-calls/references/raise-hand.md +0 -188
  349. package/skills/cometchat-android-v6-calls/references/ringing-integration.md +0 -176
  350. package/skills/cometchat-android-v6-calls/references/server-fcm-voip.md +0 -127
  351. package/skills/cometchat-android-v6-calls/references/share-invite.md +0 -105
  352. package/skills/cometchat-android-v6-compose-theming/SKILL.md +0 -250
  353. package/skills/cometchat-android-v6-kotlin-theming/SKILL.md +0 -233
  354. package/skills/cometchat-angular-calls/SKILL.md +0 -380
  355. package/skills/cometchat-angular-calls/references/add-calls-to-existing-chat.md +0 -96
  356. package/skills/cometchat-angular-calls/references/call-layouts.md +0 -123
  357. package/skills/cometchat-angular-calls/references/call-session.md +0 -167
  358. package/skills/cometchat-angular-calls/references/custom-ui.md +0 -239
  359. package/skills/cometchat-angular-calls/references/device-management.md +0 -154
  360. package/skills/cometchat-angular-calls/references/group-calls.md +0 -433
  361. package/skills/cometchat-angular-calls/references/idle-timeout.md +0 -161
  362. package/skills/cometchat-angular-calls/references/in-call-chat.md +0 -148
  363. package/skills/cometchat-angular-calls/references/lazy-loading-pitfalls.md +0 -205
  364. package/skills/cometchat-angular-calls/references/migration-v4-to-v5.md +0 -53
  365. package/skills/cometchat-angular-calls/references/ngzone-and-async-callbacks.md +0 -184
  366. package/skills/cometchat-angular-calls/references/picture-in-picture.md +0 -285
  367. package/skills/cometchat-angular-calls/references/raise-hand.md +0 -172
  368. package/skills/cometchat-angular-calls/references/recording-screen-share.md +0 -260
  369. package/skills/cometchat-angular-calls/references/ringing-integration.md +0 -133
  370. package/skills/cometchat-angular-calls/references/server-web-push-vapid.md +0 -100
  371. package/skills/cometchat-angular-calls/references/share-invite.md +0 -122
  372. package/skills/cometchat-angular-calls/references/virtual-background.md +0 -29
  373. package/skills/cometchat-angular-components/SKILL.md +0 -235
  374. package/skills/cometchat-angular-core/SKILL.md +0 -386
  375. package/skills/cometchat-angular-customization/SKILL.md +0 -616
  376. package/skills/cometchat-angular-features/SKILL.md +0 -329
  377. package/skills/cometchat-angular-patterns/SKILL.md +0 -256
  378. package/skills/cometchat-angular-placement/SKILL.md +0 -314
  379. package/skills/cometchat-angular-production/SKILL.md +0 -564
  380. package/skills/cometchat-angular-push/SKILL.md +0 -389
  381. package/skills/cometchat-angular-testing/SKILL.md +0 -605
  382. package/skills/cometchat-angular-theming/SKILL.md +0 -290
  383. package/skills/cometchat-angular-troubleshooting/SKILL.md +0 -364
  384. package/skills/cometchat-astro-patterns/SKILL.md +0 -708
  385. package/skills/cometchat-calls/SKILL.md +0 -364
  386. package/skills/cometchat-calls/references/use-case-broadcast.md +0 -199
  387. package/skills/cometchat-calls/references/use-case-marketplace.md +0 -157
  388. package/skills/cometchat-calls/references/use-case-support.md +0 -189
  389. package/skills/cometchat-calls/references/use-case-team.md +0 -180
  390. package/skills/cometchat-calls/references/use-case-telehealth.md +0 -153
  391. package/skills/cometchat-components/SKILL.md +0 -1142
  392. package/skills/cometchat-core/SKILL.md +0 -1048
  393. package/skills/cometchat-customization/SKILL.md +0 -580
  394. package/skills/cometchat-customization/references/component-catalog.md +0 -236
  395. package/skills/cometchat-features/SKILL.md +0 -861
  396. package/skills/cometchat-flutter-v5/SKILL.md +0 -173
  397. package/skills/cometchat-flutter-v5-calls/SKILL.md +0 -455
  398. package/skills/cometchat-flutter-v5-calls/references/add-calls-to-existing-chat.md +0 -193
  399. package/skills/cometchat-flutter-v5-calls/references/call-layouts.md +0 -103
  400. package/skills/cometchat-flutter-v5-calls/references/call-session.md +0 -285
  401. package/skills/cometchat-flutter-v5-calls/references/device-management.md +0 -124
  402. package/skills/cometchat-flutter-v5-calls/references/group-calls.md +0 -181
  403. package/skills/cometchat-flutter-v5-calls/references/idle-timeout.md +0 -99
  404. package/skills/cometchat-flutter-v5-calls/references/in-call-chat.md +0 -135
  405. package/skills/cometchat-flutter-v5-calls/references/migration-v4-to-v5.md +0 -210
  406. package/skills/cometchat-flutter-v5-calls/references/raise-hand.md +0 -255
  407. package/skills/cometchat-flutter-v5-calls/references/ringing-integration.md +0 -196
  408. package/skills/cometchat-flutter-v5-calls/references/server-push-bridge.md +0 -101
  409. package/skills/cometchat-flutter-v5-calls/references/share-invite.md +0 -148
  410. package/skills/cometchat-flutter-v5-conversations/SKILL.md +0 -118
  411. package/skills/cometchat-flutter-v5-core/SKILL.md +0 -239
  412. package/skills/cometchat-flutter-v5-customization/SKILL.md +0 -358
  413. package/skills/cometchat-flutter-v5-events/SKILL.md +0 -156
  414. package/skills/cometchat-flutter-v5-messages/SKILL.md +0 -259
  415. package/skills/cometchat-flutter-v5-production/SKILL.md +0 -216
  416. package/skills/cometchat-flutter-v5-push/SKILL.md +0 -285
  417. package/skills/cometchat-flutter-v5-testing/SKILL.md +0 -401
  418. package/skills/cometchat-flutter-v5-theming/SKILL.md +0 -161
  419. package/skills/cometchat-flutter-v5-troubleshooting/SKILL.md +0 -130
  420. package/skills/cometchat-flutter-v5-users-groups/SKILL.md +0 -152
  421. package/skills/cometchat-flutter-v6/SKILL.md +0 -446
  422. package/skills/cometchat-flutter-v6-calls/references/add-calls-to-existing-chat.md +0 -136
  423. package/skills/cometchat-flutter-v6-calls/references/advanced-features.md +0 -89
  424. package/skills/cometchat-flutter-v6-calls/references/call-layouts.md +0 -105
  425. package/skills/cometchat-flutter-v6-calls/references/call-session.md +0 -229
  426. package/skills/cometchat-flutter-v6-calls/references/device-management.md +0 -105
  427. package/skills/cometchat-flutter-v6-calls/references/group-calls.md +0 -190
  428. package/skills/cometchat-flutter-v6-calls/references/idle-timeout.md +0 -88
  429. package/skills/cometchat-flutter-v6-calls/references/in-call-chat.md +0 -125
  430. package/skills/cometchat-flutter-v6-calls/references/raise-hand.md +0 -275
  431. package/skills/cometchat-flutter-v6-calls/references/ringing-integration.md +0 -171
  432. package/skills/cometchat-flutter-v6-calls/references/server-push-bridge.md +0 -93
  433. package/skills/cometchat-flutter-v6-calls/references/share-invite.md +0 -102
  434. package/skills/cometchat-flutter-v6-conversations/SKILL.md +0 -238
  435. package/skills/cometchat-flutter-v6-messages/SKILL.md +0 -384
  436. package/skills/cometchat-flutter-v6-theming/SKILL.md +0 -293
  437. package/skills/cometchat-flutter-v6-users-groups/SKILL.md +0 -224
  438. package/skills/cometchat-ios/SKILL.md +0 -325
  439. package/skills/cometchat-ios-calls/references/add-calls-to-existing-chat.md +0 -181
  440. package/skills/cometchat-ios-calls/references/audio-modes-and-controls.md +0 -45
  441. package/skills/cometchat-ios-calls/references/avaudiosession-routing.md +0 -188
  442. package/skills/cometchat-ios-calls/references/call-layouts.md +0 -76
  443. package/skills/cometchat-ios-calls/references/call-session.md +0 -218
  444. package/skills/cometchat-ios-calls/references/callkit-and-pushkit.md +0 -357
  445. package/skills/cometchat-ios-calls/references/custom-ui.md +0 -322
  446. package/skills/cometchat-ios-calls/references/device-management.md +0 -171
  447. package/skills/cometchat-ios-calls/references/group-calls.md +0 -359
  448. package/skills/cometchat-ios-calls/references/idle-timeout.md +0 -184
  449. package/skills/cometchat-ios-calls/references/in-call-chat.md +0 -179
  450. package/skills/cometchat-ios-calls/references/migration-v4-to-v5.md +0 -196
  451. package/skills/cometchat-ios-calls/references/picture-in-picture.md +0 -246
  452. package/skills/cometchat-ios-calls/references/raise-hand.md +0 -26
  453. package/skills/cometchat-ios-calls/references/recording-screen-share.md +0 -252
  454. package/skills/cometchat-ios-calls/references/ringing-integration.md +0 -143
  455. package/skills/cometchat-ios-calls/references/server-apns-pushkit.md +0 -267
  456. package/skills/cometchat-ios-calls/references/share-invite.md +0 -148
  457. package/skills/cometchat-ios-calls/references/swiftui-uikit-hosting.md +0 -246
  458. package/skills/cometchat-ios-calls/references/voip-cert-setup.md +0 -166
  459. package/skills/cometchat-ios-theming/SKILL.md +0 -667
  460. package/skills/cometchat-native-bare-patterns/SKILL.md +0 -550
  461. package/skills/cometchat-native-calls/SKILL.md +0 -671
  462. package/skills/cometchat-native-calls/references/add-calls-to-existing-chat.md +0 -203
  463. package/skills/cometchat-native-calls/references/call-layouts.md +0 -125
  464. package/skills/cometchat-native-calls/references/call-session.md +0 -182
  465. package/skills/cometchat-native-calls/references/custom-ui.md +0 -254
  466. package/skills/cometchat-native-calls/references/device-management.md +0 -158
  467. package/skills/cometchat-native-calls/references/expo-vs-bare.md +0 -179
  468. package/skills/cometchat-native-calls/references/group-calls.md +0 -296
  469. package/skills/cometchat-native-calls/references/idle-timeout.md +0 -128
  470. package/skills/cometchat-native-calls/references/in-call-chat.md +0 -145
  471. package/skills/cometchat-native-calls/references/migration-v4-to-v5.md +0 -72
  472. package/skills/cometchat-native-calls/references/picture-in-picture.md +0 -276
  473. package/skills/cometchat-native-calls/references/raise-hand.md +0 -205
  474. package/skills/cometchat-native-calls/references/recording-screen-share.md +0 -169
  475. package/skills/cometchat-native-calls/references/ringing-integration.md +0 -118
  476. package/skills/cometchat-native-calls/references/server-push-bridge.md +0 -135
  477. package/skills/cometchat-native-calls/references/server-push-payloads.md +0 -193
  478. package/skills/cometchat-native-calls/references/share-invite.md +0 -146
  479. package/skills/cometchat-native-calls/references/voip-push-end-to-end.md +0 -319
  480. package/skills/cometchat-native-components/SKILL.md +0 -628
  481. package/skills/cometchat-native-core/SKILL.md +0 -679
  482. package/skills/cometchat-native-customization/SKILL.md +0 -716
  483. package/skills/cometchat-native-expo-patterns/SKILL.md +0 -552
  484. package/skills/cometchat-native-features/SKILL.md +0 -638
  485. package/skills/cometchat-native-placement/SKILL.md +0 -509
  486. package/skills/cometchat-native-production/SKILL.md +0 -700
  487. package/skills/cometchat-native-push/SKILL.md +0 -594
  488. package/skills/cometchat-native-testing/SKILL.md +0 -582
  489. package/skills/cometchat-native-theming/SKILL.md +0 -681
  490. package/skills/cometchat-native-troubleshooting/SKILL.md +0 -501
  491. package/skills/cometchat-nextjs-patterns/SKILL.md +0 -899
  492. package/skills/cometchat-placement/SKILL.md +0 -1360
  493. package/skills/cometchat-production/SKILL.md +0 -1027
  494. package/skills/cometchat-react-calls/SKILL.md +0 -752
  495. package/skills/cometchat-react-calls/references/add-calls-to-existing-chat.md +0 -146
  496. package/skills/cometchat-react-calls/references/call-layouts.md +0 -160
  497. package/skills/cometchat-react-calls/references/call-session.md +0 -235
  498. package/skills/cometchat-react-calls/references/custom-ui.md +0 -247
  499. package/skills/cometchat-react-calls/references/device-management.md +0 -210
  500. package/skills/cometchat-react-calls/references/group-calls.md +0 -257
  501. package/skills/cometchat-react-calls/references/idle-timeout.md +0 -188
  502. package/skills/cometchat-react-calls/references/in-call-chat.md +0 -212
  503. package/skills/cometchat-react-calls/references/migration-v4-to-v5.md +0 -170
  504. package/skills/cometchat-react-calls/references/picture-in-picture.md +0 -245
  505. package/skills/cometchat-react-calls/references/raise-hand.md +0 -238
  506. package/skills/cometchat-react-calls/references/recording-screen-share.md +0 -144
  507. package/skills/cometchat-react-calls/references/ringing-integration.md +0 -255
  508. package/skills/cometchat-react-calls/references/server-web-push-vapid.md +0 -241
  509. package/skills/cometchat-react-calls/references/share-invite.md +0 -175
  510. package/skills/cometchat-react-calls/references/testing-calls-on-web.md +0 -216
  511. package/skills/cometchat-react-calls/references/virtual-background.md +0 -32
  512. package/skills/cometchat-react-calls/references/voip-and-web-push.md +0 -165
  513. package/skills/cometchat-react-patterns/SKILL.md +0 -628
  514. package/skills/cometchat-react-push/SKILL.md +0 -634
  515. package/skills/cometchat-react-router-patterns/SKILL.md +0 -758
  516. package/skills/cometchat-react-testing/SKILL.md +0 -413
  517. package/skills/cometchat-theming/SKILL.md +0 -498
  518. package/skills/cometchat-troubleshooting/SKILL.md +0 -294
@@ -0,0 +1,206 @@
1
+ ---
2
+ name: cometchat-android-v5-calls-sdk
3
+ description: "Add voice & video calling to any Android app FROM SCRATCH with the headless CometChat Calls SDK v5 (`com.cometchat:calls-sdk-android:5.0.4`) — no UI Kit. Kotlin: initFromSettings→login→generateToken→joinSession into a RelativeLayout, lifecycle-bound listeners, meet-style session rooms AND 1:1 ringing (Chat SDK v5 signaling + Calls SDK media), call logs, layouts, audio modes, recording, PiP, background service. Triggers: 'add calling from scratch android', 'standalone video call kotlin', 'headless calls sdk android', 'build my own call UI android', 'meeting room join by session id android', 'one-on-one ringing call without uikit android'."
4
+ license: "MIT"
5
+ compatibility: "Android minSdk >=26 (TRUE transitive floor of calls-sdk-android 5.0.x — react-native-svg declares 26; docs now agree); compileSdk >=35 (androidx.core 1.15.0 fails checkDebugAarMetadata at 34; match your androidx); Kotlin >=1.9 / AGP >=8; JVM target 11; com.cometchat:calls-sdk-android ^5 (5.0.x, verified 5.0.4). 1:1 ringing also needs com.cometchat:chat-sdk-android ^5 (5.0.5) for signaling. Kotlin (XML Views or Compose host via AndroidView)."
6
+ metadata:
7
+ author: "CometChat"
8
+ version: "1.0.0"
9
+ tags: "cometchat calls sdk v5 headless voice video android kotlin calling standalone"
10
+ ---
11
+
12
+ > **Ground truth:** `com.cometchat:calls-sdk-android:5.0.4` + catalog `android-calls-v5.json` (the CLOSED list, `javap`-verified on the installed AAR). Docs: `/calls/android/**` = **v5** · Docs MCP. Fetch builder options, callback lists and filters from the docs (`references/docs-map.md`) — never memory. ⚠️ Where docs and AAR disagree, **the AAR wins** (drift list in `references/pitfalls.md`). **APPEND to the user's app — additive wiring only** (`RULES.md`). HEADLESS path (no UI Kit); for the prebuilt call UI use `cometchat-android-v6-calls`.
13
+
14
+ ## Companion skills (read first)
15
+ - **Standalone/headless entry** — owns its own artifact (the Calls SDK), no `-core` sibling.
16
+ - **1:1 RINGING only** also drives the **Chat SDK** (`com.cometchat:chat-sdk-android:5.0.5`) for signaling — `references/ringing.md`; deeper Chat-SDK usage: `cometchat-android-v5-sdk`.
17
+ - **Prefer the UI Kit?** Chat + a prebuilt call UI ⇒ `cometchat-android-v6-core` + `cometchat-android-v6-calls`, not this skill.
18
+
19
+ ## Use this skill when
20
+ "add calling from scratch / without the UI Kit", "standalone voice/video on Android", "build my own call screen", "headless calls SDK", "meeting room join by session id", "one-on-one ringing call". Precondition: the caller chose the **from-scratch / standalone** path (prebuilt call UI ⇒ see Companion skills).
21
+
22
+ ## Prerequisites & install
23
+ ```kotlin
24
+ // settings.gradle(.kts) → dependencyResolutionManagement.repositories
25
+ maven("https://dl.cloudsmith.io/public/cometchat/cometchat/maven/")
26
+ // app/build.gradle.kts
27
+ implementation("com.cometchat:calls-sdk-android:5.0.4") // meet-style needs ONLY this (+ the two RN lines below)
28
+ implementation("com.cometchat:chat-sdk-android:5.0.5") // + this for 1:1 RINGING (signaling)
29
+ implementation("com.facebook.react:react-android:0.77.2") // the SDK's embedded RN runtime — see "SoLoader" below
30
+ implementation("com.facebook.soloader:soloader:0.12.1") // (versions = what calls-sdk-android 5.0.4 pulls)
31
+ ```
32
+ ```properties
33
+ # gradle.properties — REQUIRED for the 1:1 RINGING path (chat-sdk-android 5.0.5 still pulls android.arch.lifecycle:extensions:1.1.1 → support-compat 26.1.0)
34
+ android.useAndroidX=true
35
+ android.enableJetifier=true
36
+ org.gradle.jvmargs=-Xmx4096m # REQUIRED: Jetifier transforms the embedded react-android AAR — the AS-default -Xmx2048m OOMs (AUDIT-225)
37
+ ```
38
+ ```xml
39
+ <!-- AndroidManifest.xml, inside <application> — REQUIRED for background handling: the AAR declares NO <service> -->
40
+ <service android:name="com.cometchat.calls.services.CometChatOngoingCallService"
41
+ android:exported="false"
42
+ android:foregroundServiceType="camera|microphone|mediaPlayback" />
43
+ ```
44
+ > Full error-text evidence for the four build gates below (minSdk, `<service>`, Jetifier, heap): **`references/build-truth.md`.**
45
+ - **minSdk 26 — the manifest merge is the floor.** `calls-sdk-android:5.0.4` pulls `react-native-svg` at `minSdkVersion 26`; a 24/25 app fails `process*MainManifest`. Docs now agree (AUDIT-229) — raise `minSdk` first.
46
+ - **The `<service>` above is REQUIRED.** The 5.0.4 AAR merges permissions only; without YOUR declaration `CometChatOngoingCallService.launch(activity)` fails **silently** (call dies on Home). Docs ship the `<service>` block (corrected upstream, verified 2026-09-09).
47
+ - **Jetifier (ringing only).** Without `android.enableJetifier=true`, an AndroidX app + `chat-sdk-android` fails `checkDebugDuplicateClasses`. Meet-style needs none.
48
+ - **⚠️ Gradle heap `-Xmx4096m` (MANDATORY — the FIRST build OOMs, meet-style too, AUDIT-225).** The AS-default `-Xmx2048m` OOMs Jetifier transforming the embedded `react-android` AAR; the `gradle.properties` line above fixes it.
49
+ - **⚠️ SoLoader (MANDATORY on 5.0.x; a REQUIRED skill step — the SDK doesn't self-init on the `joinSession` path).** The call surface is an embedded React Native 0.77; without the merged-mapping init `joinSession` **crashes the process** (`UnsatisfiedLinkError: … "libhermes_executor.so" not found`). Add ONCE, first in `Application.onCreate()` (hence the two RN artifacts on YOUR compile classpath):
50
+ ```kotlin
51
+ import com.cometchat.calls.core.CometChatCalls
52
+ import com.facebook.react.soloader.OpenSourceMergedSoMapping
53
+ import com.facebook.soloader.SoLoader
54
+
55
+ SoLoader.init(this, OpenSourceMergedSoMapping) // Application.onCreate(), BEFORE CometChatCalls.initFromSettings — idempotent
56
+ ```
57
+ - **Manifest:** the AAR merges the call permissions (INTERNET, CAMERA, RECORD_AUDIO, FOREGROUND_SERVICE_*, POST_NOTIFICATIONS, …) — but NOT the `<service>` above. Java 11 `compileOptions`.
58
+ - **Runtime permissions are YOURS to request** (API 23+): `CAMERA` + `RECORD_AUDIO` (video) / `RECORD_AUDIO` (voice) **before** `joinSession`. Denied ⇒ tell the user; never join silently muted.
59
+ - **Credentials:** App ID · Region · Auth Key (dev only) live in the **gitignored** `app/src/main/assets/cometchat-settings.json` (same file the chat core uses; shape → `references/docs-map.md` § DOCS-GAP). Fetch via the CLI — `npx @cometchat/skills-cli@3 auth login` → `provision use --app-id <id> --json` (`@3` pins the CLI major that matches the v5 skills) — or paste from Dashboard → Credentials. Mint **auth tokens server-side** for production; never ship the Auth Key.
60
+
61
+ ## Init & login ordering (BAKED — invariant)
62
+ `CometChatCalls.initFromSettings(context, listener)` resolves (`onSuccess`) → `CometChatCalls.login(uid, authKey, …)` (dev) **or** `login(authToken, …)` (prod) resolves → then `generateToken` / `joinSession` / listeners. Nothing joins before init+login resolve; before init every call fails with `ERROR_COMETCHAT_CALLS_SDK_INIT`.
63
+ - **DEFAULT to `initFromSettings`** — the ai-agent/telemetry-attributed path (`integrationSource="ai-agent"`, parallel to `CometChat.initFromSettings`; RULES §5, AUDIT-175). It reads `assets/cometchat-settings.json` (`appId`, `region`, optional `callsSDK` hosts). **Intentionally undocumented** (`@nodoc`); the documented `CometChatCalls.init(context, CallAppSettings.CallAppSettingBuilder(...).build(), listener)` is the FALLBACK only.
64
+ - **`authKey`** is read back out of the same asset (`credentials.authKey`) — never a second copy. Skip `login` only when `getLoggedInUser()?.uid == uid` — a DIFFERENT uid ⇒ **logout → RE-INIT → login** (`references/user-switch.md`); `!= null` alone calls as the PREVIOUS user. Init ONCE, in `Application.onCreate()`.
65
+ ```kotlin
66
+ import com.cometchat.calls.core.CometChatCalls
67
+ import com.cometchat.calls.exceptions.CometChatException
68
+ import com.cometchat.calls.model.CallUser
69
+ import org.json.JSONObject
70
+
71
+ // Call from Application.onCreate(); it re-enters itself after a user-switch logout.
72
+ fun initThenLogin(uid: String) {
73
+ CometChatCalls.initFromSettings(this, object : CometChatCalls.CallbackListener<String>() { // telemetry default; init(context, CallAppSettings, …) is the doc fallback
74
+ override fun onSuccess(result: String) {
75
+ val current = CometChatCalls.getLoggedInUser()
76
+ if (current?.uid == uid) return // SAME user — already logged in
77
+ if (current != null) { // DIFFERENT user — NOT `!= null` → login (that calls as the PREVIOUS user)
78
+ CometChatCalls.logout(object : CometChatCalls.CallbackListener<String>() {
79
+ // logout leaves isInitialized()==false → RE-INIT before login (ringing: CometChat.logout too — references/user-switch.md)
80
+ override fun onSuccess(msg: String) = initThenLogin(uid)
81
+ override fun onError(e: CometChatException) { /* surface e.code — never continue as the old user */ }
82
+ })
83
+ return
84
+ }
85
+ // dev: login(uid, authKey, l) — authKey from the SAME asset; prod: login(authToken, l), token minted server-side.
86
+ val authKey = JSONObject(assets.open("cometchat-settings.json").bufferedReader().readText())
87
+ .getJSONObject("credentials").getString("authKey")
88
+ CometChatCalls.login(uid, authKey, object : CometChatCalls.CallbackListener<CallUser>() {
89
+ override fun onSuccess(callUser: CallUser) { /* unlock calling */ }
90
+ override fun onError(e: CometChatException) { /* surface e.code + e.message */ }
91
+ })
92
+ }
93
+ override fun onError(e: CometChatException) { /* ERROR_SETTINGS_FILE_NOT_FOUND ⇒ the asset is missing */ }
94
+ })
95
+ }
96
+ initThenLogin(uid)
97
+ ```
98
+
99
+ ## Two build modes (BAKED — the router picks one)
100
+ - **Meet-style (session room)** — Calls SDK ONLY: `generateToken(sessionId)` → `joinSession(token, sessionSettings, relativeLayout, …)` (or the `joinSession(sessionId, …)` overload); everyone on the same `sessionId` shares the call. No ringing.
101
+ - **1:1 ringing** — Chat SDK signals, Calls SDK carries media (§ 1:1 ringing below — FOREGROUND-only without VoIP push).
102
+
103
+ ## SDK method map (BAKED closed list — from the catalog; signatures → FETCH from docs)
104
+ - **Lifecycle (`CometChatCalls` statics):** `initFromSettings` · `init` · `isInitialized` · `login(uid, authKey, l)` / `login(authToken, l)` · `logout` · `getLoggedInUser` · `getUserAuthToken`
105
+ - **Session:** `generateToken(sessionId, l)` → `GenerateToken.token` · `joinSession(token | sessionId, SessionSettings, RelativeLayout, l)` → `CallSession` (`startSession`/`CallSettingsBuilder` = **v4 path, do not use**) · builder `CometChatCalls.SessionSettingsBuilder()` (`setSessionType`/`setLayout`/`setAudioMode`/…, full list in the reference).
106
+ - **Active call (`CallSession.getInstance()`):** `isSessionActive` · `leaveSession` · lifecycle-bound listeners (`addSessionStatusListener(owner, …)` + siblings) · `clearAllListeners`.
107
+ - **Also (full enumeration → `references/method-map.md`):** In-call actions (CUSTOM controls only) · Call logs (`CallLogRequest`) · Transcription & closed captions (v5.0.4+, plan-gated) · Background (`CometChatOngoingCallService`) · Constants/enums (`SessionType`/`LayoutType`/`AudioMode`/`CometChatCallsConstants.*`).
108
+ > A **curated highlight, NOT the full surface** — the AUTHORITATIVE closed list is the **`android-calls-v5.json` catalog** (also transcription/streaming, `CometChatCallsEventsListener`, the v4-era `CallSettingsBuilder`). A symbol is real **iff it's in the catalog**; then fetch its page via `references/docs-map.md`. **Full method map: `references/method-map.md`.**
109
+
110
+ ## Listener lifecycle (BAKED)
111
+ Every `CallSession` listener takes a **`LifecycleOwner`** and is removed with it — register from `joinSession`'s `onSuccess` with the Activity/Fragment as owner; no manual remove (`clearAllListeners()` for hard resets). Still yours by hand: `CallSession.getInstance().leaveSession()` on teardown, and for ringing `CometChat.removeCallListener(ID)`.
112
+
113
+ ## Least-code recipe (meet-style, Kotlin Activity)
114
+ ```kotlin
115
+ import android.Manifest
116
+ import android.os.Bundle
117
+ import android.view.ViewGroup
118
+ import android.widget.RelativeLayout
119
+ import androidx.activity.result.contract.ActivityResultContracts
120
+ import androidx.appcompat.app.AppCompatActivity
121
+ import com.cometchat.calls.core.CallSession
122
+ import com.cometchat.calls.core.CometChatCalls
123
+ import com.cometchat.calls.exceptions.CometChatException
124
+ import com.cometchat.calls.listeners.SessionStatusListener
125
+ import com.cometchat.calls.model.GenerateToken
126
+ import com.cometchat.calls.model.LayoutType
127
+ import com.cometchat.calls.model.SessionType
128
+
129
+ class MeetCallActivity : AppCompatActivity() { // init + login already resolved (Application)
130
+ private lateinit var callContainer: RelativeLayout
131
+ private val permissions = registerForActivityResult(ActivityResultContracts.RequestMultiplePermissions()) { granted ->
132
+ if (granted.values.all { it }) joinRoom(intent.getStringExtra("SESSION_ID") ?: "team-room")
133
+ else finish() // tell the user — a call without mic/camera cannot start
134
+ }
135
+
136
+ override fun onCreate(savedInstanceState: Bundle?) {
137
+ super.onCreate(savedInstanceState)
138
+ // The SDK renders its ENTIRE call UI into this view — a RelativeLayout with REAL size. No external controls.
139
+ callContainer = RelativeLayout(this).apply {
140
+ layoutParams = ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)
141
+ }
142
+ setContentView(callContainer)
143
+ permissions.launch(arrayOf(Manifest.permission.CAMERA, Manifest.permission.RECORD_AUDIO))
144
+ }
145
+
146
+ private fun joinRoom(sessionId: String) {
147
+ val sessionSettings = CometChatCalls.SessionSettingsBuilder() // fetch more options from /calls/android/session-settings
148
+ .setSessionType(SessionType.VIDEO) // ⚠️ setSessionType — the docs' setType() does not exist here
149
+ .setLayout(LayoutType.TILE)
150
+ .setDisplayName("Me")
151
+ .setIdleTimeoutPeriod(120) // alone for 2 min ⇒ onSessionTimedOut
152
+ .build()
153
+ CometChatCalls.generateToken(sessionId, object : CometChatCalls.CallbackListener<GenerateToken>() {
154
+ override fun onSuccess(token: GenerateToken) {
155
+ CometChatCalls.joinSession(token, sessionSettings, callContainer, object : CometChatCalls.CallbackListener<CallSession>() {
156
+ override fun onSuccess(callSession: CallSession) {
157
+ // Listeners are LIFECYCLE-BOUND (owner = this Activity) — register here, after join.
158
+ callSession.addSessionStatusListener(this@MeetCallActivity, object : SessionStatusListener() {
159
+ override fun onSessionLeft() { finish() }
160
+ override fun onSessionTimedOut() { finish() }
161
+ override fun onConnectionClosed() { finish() }
162
+ })
163
+ }
164
+ override fun onError(e: CometChatException) { /* show e.code + e.message, then finish() */ }
165
+ })
166
+ }
167
+ override fun onError(e: CometChatException) { /* ERROR_AUTH_TOKEN ⇒ not logged in; show it */ }
168
+ })
169
+ }
170
+
171
+ override fun onDestroy() {
172
+ if (CallSession.getInstance().isSessionActive) CallSession.getInstance().leaveSession() // never leak a live session
173
+ // If you called CometChatOngoingCallService.launch(...), ALSO CometChatOngoingCallService.abort(this) here —
174
+ // onSessionLeft is NOT delivered on Activity destroy (BACK), so callback-only abort leaks the FGS (AUDIT-227).
175
+ super.onDestroy()
176
+ }
177
+ }
178
+ ```
179
+ Compose host: the same code inside `AndroidView(factory = { RelativeLayout(it) })` filling `Modifier.fillMaxSize()`; declare the Activity with `configChanges` (Rotation pitfall, `references/pitfalls.md`).
180
+
181
+ ## 1:1 ringing (Chat SDK signaling + Calls SDK media)
182
+ Register the `CallListener` **once, globally** (`Application.onCreate`, after `CometChat.initFromSettings` + `CometChat.login` — the `cometchat-android-v5-sdk` recipe) so the callee rings from any screen **of a FOREGROUND app**. Full recipe (both roles, Kotlin) + the ringing prerequisites: **`references/ringing.md`** — `initiateCall` → peer `onIncomingCallReceived` → `acceptCall`/`rejectCall` → `joinSession(call.sessionId)` on BOTH sides → hang-up = `leaveSession` **and** `CometChat.endCall`.
183
+ - **Foreground-only (verified live).** In auto socket mode the Chat SDK **drops its WebSocket the instant the app is backgrounded** — a backgrounded callee never gets `onIncomingCallReceived` and a backgrounded caller never gets `onOutgoingCallAccepted` (not replayed on return). Background / killed-app ringing = the VoIP push path (`/calls/android/voip-calling`). Never promise it from this recipe. Full evidence + the caller-side reconcile (dismiss on timeout, `onResume` re-check): **`references/ringing.md`.**
184
+
185
+ ## Common pitfalls (BAKED)
186
+ > One-liners here; **full evidence + reasoning for every one — see `references/pitfalls.md`.** minSdk-26 floor + missing `<service>` are in Prerequisites (evidence: `references/build-truth.md`).
187
+ - **Don't duplicate the built-in call controls (the #1 mistake).** `joinSession` renders a COMPLETE call UI (mute, camera, switch, audio mode, layout, participants, raise hand, recording, invite, timer, red leave) into your `RelativeLayout` — no custom control row unless the ask is "replace the controls" (then `hideControlPanel(true)` FIRST).
188
+ - **Docs ≠ AAR (verified vs 5.0.4):** `setType`→`setSessionType` · `unMuteAudio`→`unmuteAudio` · `unPinParticipant`→`unpinParticipant` · `pinParticipant(uid)`→`(uid, pid)` · `MediaEventsListener.onScreenShareStarted/Stopped` don't exist (they're on `ParticipantEventListener`) · `raiseHand`/`setLayout`/`startRecording` are no-ops. Per-page notes: `references/docs-map.md`.
189
+ - **Wrong container** — `joinSession` needs a real-sized `RelativeLayout`; `wrap_content`/zero size renders invisibly (`ERROR_CALLING_VIEW_REF_NULL` if null).
190
+ - **`joinSession` crashes `libhermes_executor.so not found`** — SoLoader merged-mapping init missing; see Prerequisites § SoLoader.
191
+ - **Joining before init+login resolve** — `ERROR_COMETCHAT_CALLS_SDK_INIT` / `ERROR_AUTH_TOKEN`; chain off the callbacks.
192
+ - **`ERROR_COMETCHAT_CALLS_SDK_INIT` after a user switch is MISLEADING** (AUDIT-194) — re-init between logout and login: `references/user-switch.md`.
193
+ - **No runtime permissions** — the call joins with a dead mic/camera; request `CAMERA` + `RECORD_AUDIO` first.
194
+ - **Listeners registered before join** — register in `joinSession`'s `onSuccess` with a `LifecycleOwner`.
195
+ - **Hang-up on one SDK only (ringing)** — `leaveSession` without `CometChat.endCall` leaves the peer in-call; do both.
196
+ - **Android can't START screen share** (receive-only), and has **no virtual-background page** — don't promise either.
197
+ - **Rotation / Home kill the call** — `configChanges` (+ `supportsPictureInPicture`); keep alive with `CometChatOngoingCallService.launch(activity)` (needs the `<service>`).
198
+ - **Ongoing-call service LEAKS if you only `.abort` in `onSessionLeft` (AUDIT-227)** — also `CometChatOngoingCallService.abort(this)` in `onDestroy`; abort on EVERY teardown path.
199
+ - **No-op in-call actions (5.0.4 SDK bug, AUDIT-187):** `raiseHand`/`lowerHand`, mid-call `setLayout`, `startRecording`/`stopRecording` — no effect/callback/error; prefer the SDK's own buttons.
200
+ - **Backgrounded apps do not ring and do not hear the accept** — foreground only; VoIP push for the rest (§ 1:1 ringing).
201
+ - **Mixing majors** — Calls SDK is **5.x** (`joinSession`); `startSession`/`CallSettingsBuilder` + `/calls/v4/android` are the OLD tree.
202
+
203
+ ## Verify it works
204
+ - **Tier-1 catalog:** every emitted symbol is in `android-calls-v5.json` (`node test-suite/scripts/verify-catalog.mjs`).
205
+ - **Tier-2 fences:** the Kotlin compiles against the installed `calls-sdk-android:5.0.4` (`npm run verify:fences:android-v6`); your app builds at `minSdk 26` (the manifest merge is the floor check).
206
+ - **Tier-3 device:** `./gradlew :app:assembleDebug` (at `minSdk 26`), then on an emulator/device: grant mic+camera → `joinSession` shows the SDK call surface with its own controls → a second device on the same `sessionId` appears as a tile → Home shows the ongoing-call notification (the `<service>` works) → leave ends cleanly (`onSessionLeft`). Ringing: two devices/users, BOTH apps FOREGROUND — accept joins both, hang-up ends both; then background the callee and confirm your outgoing UI times out cleanly (no callback comes). The pack's reviewer proves the round-trip via `CallsSmokeTests`.
@@ -0,0 +1,63 @@
1
+ # Build-truth prerequisites — the evidence behind `SKILL.md` § Prerequisites (calls-sdk-android 5.0.4)
2
+
3
+ > Every floor and manifest line in `SKILL.md` was MEASURED on a real build/run (2026-09-07, emulator-5554, AGP 8.9.1,
4
+ > Gradle 8.11.1, Kotlin 2.1.20), not copied from the docs (`RULES.md` §2 build-truth). This file keeps the full error
5
+ > texts so a failing build is searchable; `SKILL.md` keeps the one-liners.
6
+
7
+ ## minSdk 26 — the manifest merge decides (AUDIT-183 · DOCS-BACKLOG C11)
8
+ - `/calls/android/overview` says "Minimum SDK: API Level 24". A 24 app fails at `:app:processDebugMainManifest`:
9
+ `uses-sdk:minSdkVersion 24 cannot be smaller than version 26 declared in library
10
+ [com.facebook.react:react-native-svg:15.11.2-cometchat-21164567]` — pulled transitively by `calls-sdk-android:5.0.4`.
11
+ - Fix: `minSdk = 26` in `app/build.gradle(.kts)`. Verified: BUILD SUCCESSFUL, resolved `calls-sdk-android 5.0.4`,
12
+ `react-android 0.77.2`, `soloader 0.12.1`.
13
+
14
+ ## `<service>` for `CometChatOngoingCallService` — the AAR declares none (AUDIT-184 · DOCS-BACKLOG C12)
15
+ - The 5.0.4 AAR `AndroidManifest.xml` carries permissions only (`INTERNET`, `CAMERA`, `RECORD_AUDIO`,
16
+ `MODIFY_AUDIO_SETTINGS`, `BLUETOOTH`, `FOREGROUND_SERVICE`, `FOREGROUND_SERVICE_MEDIA_PLAYBACK|MICROPHONE|CAMERA`,
17
+ `POST_NOTIFICATIONS`). `/calls/android/background-handling` says "add the required permissions and service
18
+ declaration" but its XML block has NO `<service>` element.
19
+ - Without it `CometChatOngoingCallService.launch(activity)` in `onSessionJoined` logs
20
+ `ActivityManager: Unable to start service Intent { cmp=<app>/com.cometchat.calls.services.CometChatOngoingCallService } : not found`
21
+ — no exception, no callback, no foreground service, no ongoing notification; the call is unprotected on Home.
22
+ - Fix (inside `<application>`):
23
+ ```xml
24
+ <service android:name="com.cometchat.calls.services.CometChatOngoingCallService"
25
+ android:exported="false"
26
+ android:foregroundServiceType="camera|microphone|mediaPlayback" />
27
+ ```
28
+ `foregroundServiceType` matches what the SDK passes to `startForeground(id, n, 194)` on API 34+
29
+ (`javap`: `194 = camera|microphone|mediaPlayback`). Verified live: `dumpsys activity services` →
30
+ `ServiceRecord{… CometChatOngoingCallService} isForeground=true types=0xC2` + the ongoing notification on channel
31
+ `CometChat_Call_Ongoing_Conference` (category call, ONGOING|NO_CLEAR); ActivityManager "Background started FGS: Allowed".
32
+
33
+ ## Jetifier for the ringing path (`chat-sdk-android`) (AUDIT-185)
34
+ - `chat-sdk-android:5.0.5 → android.arch.lifecycle:extensions:1.1.1 → com.android.support:support-compat/support-fragment
35
+ 26.1.0` (`./gradlew :app:dependencyInsight --dependency support-compat`). An AndroidX app then fails
36
+ `checkDebugDuplicateClasses`: `Duplicate class android.support.v4.app.INotificationSideChannel … found in modules
37
+ androidx.core:core:1.15.0 and com.android.support:support-compat:26.1.0` (×10).
38
+ - Fix: `gradle.properties` → `android.useAndroidX=true` + `android.enableJetifier=true` (or an `exclude` of
39
+ `android.arch.lifecycle`). Verified: removing the line reproduces the failure; with it, chat-sdk 5.0.5 + calls-sdk 5.0.4
40
+ build together. Meet-style (Calls SDK only) does not need it.
41
+
42
+ ## SoLoader merged mapping (AUDIT-179 · DOCS-BACKLOG C10)
43
+ - The SDK's call surface is an embedded React Native 0.77.2 whose merged `libreactnative.so` resolves `hermes_executor`
44
+ only through `SoLoader.init(ctx, OpenSourceMergedSoMapping)`; the published 5.0.4 classes never call it. First
45
+ `joinSession` → `UnsatisfiedLinkError: dlopen failed: library "libhermes_executor.so" not found` (process dies).
46
+ - Fix: `SoLoader.init(this, OpenSourceMergedSoMapping)` first in `Application.onCreate()` with
47
+ `com.facebook.react:react-android:0.77.2` + `com.facebook.soloader:soloader:0.12.1` on the compile classpath.
48
+
49
+ ## How to re-measure on the next SDK bump
50
+ `./gradlew :app:processDebugMainManifest` at the claimed `minSdk` (floor) · unzip the AAR and read its
51
+ `AndroidManifest.xml` (undeclared components) · `dependencyInsight --dependency support-compat` (legacy transitives) ·
52
+ join a session, press Home, `dumpsys activity services` (the service is real) · two clients for peer-visible actions.
53
+
54
+ ## Gradle heap `-Xmx4096m` — Jetifier OOMs the AS default (AUDIT-225)
55
+ - A brand-new project ships `org.gradle.jvmargs=-Xmx2048m`. Jetifier transforming the embedded
56
+ `react-android:0.77.2` AAR (pulled by `calls-sdk-android` for the RN call surface) exceeds 2 GB →
57
+ the FIRST `assembleDebug` fails: `Failed to transform react-android-0.77.2-debug.aar
58
+ (com.facebook.react:react-android:0.77.2) … Execution failed for JetifyTransform … Java heap space`.
59
+ - Applies to the MEET-STYLE path too (the RN AAR is on the classpath regardless of ringing). This is
60
+ NOT a docs bug — no docs page ships a from-scratch Gradle file — so the skill carries it.
61
+ - Fix: `org.gradle.jvmargs=-Xmx4096m` in `gradle.properties` (the pack's own harness uses this;
62
+ `android.nonTransitiveRClass=true` also helps). Verified: `-Xmx2048m` reproduces the OOM,
63
+ `-Xmx4096m` builds. compileSdk floor is 35 (androidx.core 1.15.0 fails `checkDebugAarMetadata` at 34, AUDIT-226).
@@ -0,0 +1,119 @@
1
+ # docs-map — CometChat Calls SDK v5 (Android, headless): intent → the exact docs page to fetch
2
+
3
+ ## Reaching docs — PREFER the CometChat docs MCP; fetch is the fallback
4
+ The canonical doc channel is the **first-party CometChat docs MCP** — tools `search_cometchat_docs`,
5
+ `fetch_cometchat_doc_page`, and `get_cometchat_implementation_bundle`. **If those tools are connected,
6
+ use them instead of a raw web fetch:**
7
+ - **Find the page** → `search_cometchat_docs(query)` — e.g. `search_cometchat_docs("calls android join session")`.
8
+ - **Read the page** → `fetch_cometchat_doc_page(path)` — pass the SAME `<path>` the tables below list; the MCP
9
+ resolves the `.md` twin and returns raw Markdown (read the **Kotlin** tab). A full `https://…/<path>` URL also works.
10
+ - **A whole feature/recipe** → `get_cometchat_implementation_bundle(...)` is **NON-AUTHORITATIVE** — curated
11
+ STATIC recipes that can lag the live docs. Treat any bundle as a hint only: RECONCILE it against the
12
+ `fetch_cometchat_doc_page` result + the catalog; never emit bundle code verbatim.
13
+
14
+ **If the MCP tools are NOT connected:** add it (`claude mcp add --transport http cometchat-docs https://mcp.cometchat.com/mcp`, or reinstall/enable the plugin) and retry; only if it still will not connect, fall back to a plain fetch via `DOCS_BASE` (defined next).
15
+ Either way the `<path>` catalog in this file is the source of truth for WHICH page — MCP-vs-fetch is only HOW.
16
+
17
+ ## DOCS_BASE — the fetch FALLBACK entry point (⚠️ SWAP HERE to change environments)
18
+ ```
19
+ DOCS_BASE = https://www.cometchat.com/docs
20
+ ```
21
+ > Production docs (`https://www.cometchat.com/docs`). **Fetch rule:** build a URL as `DOCS_BASE` + the path shown,
22
+ > then append `.md`. Never hardcode a host anywhere else; never decompile the AAR for signatures (the pack's
23
+ > catalog already did — `android-calls-v5.json` is the closed list).
24
+
25
+ ## The convention — Calls v5 lives at the UNVERSIONED root `/calls/android/`
26
+ ```
27
+ Fetch: {DOCS_BASE}/calls/android/overview.md
28
+ ```
29
+ > **⚠️ VERSION TRAP.** The **unversioned** `/calls/android/**` tree IS **v5** (matches the installed
30
+ > `calls-sdk-android:5.0.x`). `/calls/v4/android/**` is the OLD v4 SDK (`startSession` / `CallSettingsBuilder`) —
31
+ > never fetch it for a v5 build. The UI-Kit calling pages (`/ui-kit/android/calling-integration`, `call-buttons`,
32
+ > `incoming-call`…) belong to `cometchat-android-v6-calls`, not this skill.
33
+ > **⚠️ MISSING PAGES return the docs HOME page, not a 404**: `/calls/android/permissions` and
34
+ > `/calls/android/virtual-background` do NOT exist — a fetched page whose first heading is `# Home` is a miss.
35
+
36
+ ## Scoped index (prefer over the global llms.txt)
37
+ ```
38
+ {DOCS_BASE}/llms.txt
39
+ ```
40
+ Use it to discover any page not listed below (search for `/calls/android/`).
41
+
42
+ ## Path catalog — intent → page (all under `/calls/android/`)
43
+ | Intent | Path |
44
+ |---|---|
45
+ | SDK overview · architecture · call-flow · feature cards | `/calls/android/overview` — now correctly states minSdk **26** (`react-native-svg` transitive floor), matching the manifest merge (DOCS-BACKLOG C11 RESOLVED, AUDIT-229) |
46
+ | Install (Gradle repo + dependency) · manifest permissions · `init` · **SoLoader Step 4** | `/calls/android/setup` — now states minSdk 26 AND documents the SoLoader `OpenSourceMergedSoMapping` init (C10 RESOLVED); documents ONLY `init(context, CallAppSettings, l)`, the skills' `initFromSettings` default is the DOCS-GAP note below. ⚠️ Its `compileOptions` shows Java **8**; the skill uses JVM 11 (both compile). NO `<service>` (C12) and NO from-scratch Gradle heap line (`-Xmx4096m`, AUDIT-225) — those stay skill-owned |
47
+ | Login (uid + API key dev / auth token prod) · `getLoggedInUser` · `logout` · error codes | `/calls/android/authentication` |
48
+ | `generateToken` + `joinSession` (meet-style) · container setup · error codes | `/calls/android/join-session` — ⚠️ its `SessionSettingsBuilder().setType(...)` is `setSessionType(...)` in the AAR |
49
+ | **1:1 RINGING** — `initiateCall` · `CallListener` · accept/reject/cancel · join · **end call on BOTH SDKs** | `/calls/android/ringing` — ⚠️ FOREGROUND-only in auto socket mode (`/sdk/android/v5/connection-behaviour`: backgrounded ⇒ WebSocket dropped, no incoming/accept callbacks, no replay); background ringing = `/calls/android/voip-calling`; recipe + caller-side reconcile in `references/ringing.md` |
50
+ | `SessionSettingsBuilder` — every option (`setSessionType`, `setLayout`, `setAudioMode`, `hide*Button`, `hideControlPanel`, `setIdleTimeoutPeriod`, `enableAutoStartRecording`, `setInitialCameraFacing`, …) | `/calls/android/session-settings` |
51
+ | Listeners (`SessionStatus` / `ParticipantEvent` / `MediaEvents` / `ButtonClick` / `Layout`) — full callback lists | `/calls/android/events` — ⚠️ `MediaEventsListener` has NO `onScreenShareStarted/Stopped`; screen-share callbacks are on `ParticipantEventListener` |
52
+ | In-call actions on `CallSession` (mute/pause/switch camera/layout/audio mode/record/raise hand/pin/leave) | `/calls/android/actions` — ⚠️ `unMuteAudio`/`unPinParticipant` are `unmuteAudio`/`unpinParticipant`; `pinParticipant` takes `(uid, pid)` |
53
+ | Call layouts (TILE / SIDEBAR / SPOTLIGHT) + `LayoutListener` | `/calls/android/call-layouts` — `SessionSettingsBuilder.setLayout` at join works; ⚠️ `CallSession.setLayout()` mid-call was a NO-OP in 5.0.4 (no `onCallLayoutChanged`) |
54
+ | Audio modes (SPEAKER / EARPIECE / BLUETOOTH / HEADPHONES) | `/calls/android/audio-modes` |
55
+ | Recording (start/stop, auto-start, indicators, recordings on `CallLog`) | `/calls/android/recording` — ⚠️ `startRecording()` from code gave no callback and no error in 5.0.4; recording is plan-gated ("must be enabled for your app") with NO error signal on refusal |
56
+ | **Transcription & closed captions** (auto-start, manual `startTranscription`/`stopTranscription`, `hideTranscriptionButton`/`hideClosedCaptionButton`/`setCaptionLanguage`, retrieve via `TranscriptRequest`) | `/calls/android/transcription` — **v5.0.4+**; PLAN-GATED ("must be enabled for your app"). `TranscriptRequest.TranscriptRequestBuilder().setSessionId(REQUIRED).setLimit(n).build()` → `fetchNext`/`fetchPrevious` → `List<Transcript>`; `Transcript.transcriptUrl` is a pointer to a downloadable JSON (download it yourself). A session with no transcript delivers an **empty list, not an error** (verified live, AUDIT-228) |
57
+ | Call logs (`CallLogRequest.CallLogRequestBuilder` + filters + pagination + recordings) | `/calls/android/call-logs` |
58
+ | Participant management (mute / pause video / pin / `Participant` fields) | `/calls/android/participant-management` |
59
+ | Screen sharing — **receive-only on Android** (web initiates) | `/calls/android/screen-sharing` |
60
+ | Raise hand | `/calls/android/raise-hand` — ⚠️ `CallSession.raiseHand()`/`lowerHand()` from code were a NO-OP in 5.0.4 (no `onParticipantHandRaised`, no error) — the surface's own button works (SKILL.md pitfalls) |
61
+ | Idle timeout (`setIdleTimeoutPeriod`, `onSessionTimedOut`) | `/calls/android/idle-timeout` |
62
+ | Share invite (`hideShareInviteButton(false)` + `onShareInviteButtonClicked` → share sheet; deep links) | `/calls/android/share-invite` |
63
+ | Picture-in-picture (Activity PiP + `enablePictureInPictureLayout`) | `/calls/android/picture-in-picture` |
64
+ | Background handling (`CometChatOngoingCallService.launch/abort`, `OngoingNotification`) | `/calls/android/background-handling` — the AAR declares no `<service>`, so without YOUR `<service android:name="com.cometchat.calls.services.CometChatOngoingCallService" android:exported="false" android:foregroundServiceType="camera|microphone|mediaPlayback"/>` `launch()` fails silently (SKILL.md Prerequisites). ⚠️ The docs manifest block now ships this exact `<service>` (corrected upstream, verified 2026-09-09) · its "Complete Example" uses a `RelativeLayout` container matching the real `joinSession(sessionId, SessionSettings, RelativeLayout, l)` signature |
65
+ | Custom control panel (`hideControlPanel(true)` + your buttons → `CallSession` actions) — **explicit request only** | `/calls/android/custom-control-panel` |
66
+ | VoIP push / receiving calls when the app is killed | `/calls/android/voip-calling` — pair with `cometchat-android-v6-push` posture: docs-first, delivery is a manual device check |
67
+
68
+ ## DOCS-GAP — `initFromSettings` is NOT on the live docs (bake it here)
69
+ > **Referenced by `SKILL.md` (Init & login ordering).** `/calls/android/setup` documents ONLY
70
+ > `CometChatCalls.init(context, CallAppSettings, listener)` — it does **not** document
71
+ > `CometChatCalls.initFromSettings(context, CallbackListener<String>)`, even though the method is real and shipped
72
+ > (`javap` of the installed 5.0.4 AAR: `public static void initFromSettings(Context, CallbackListener<String>)`).
73
+ > It reads **`app/src/main/assets/cometchat-settings.json`** — the SAME gitignored file `CometChat.initFromSettings` /
74
+ > `CometChatUIKit.initFromSettings` read, so one asset serves chat AND calls:
75
+ > ```json
76
+ > {
77
+ > "appId": "APP_ID",
78
+ > "region": "us",
79
+ > "credentials": { "authKey": "AUTH_KEY" },
80
+ > "callsSDK": { "host": null, "adminHost": null, "clientHost": null, "callsHost": null },
81
+ > "chatSDK": {},
82
+ > "uiKit": {}
83
+ > }
84
+ > ```
85
+ > `appId` + `region` are REQUIRED (`ERROR_SETTINGS_FILE_MISSING_APPID` / `…_MISSING_REGION`); a missing asset is
86
+ > `ERROR_SETTINGS_FILE_NOT_FOUND`; the `callsSDK` block is optional host overrides (on-prem). The skills
87
+ > **DEFAULT to `initFromSettings`** — the **ai-agent-only telemetry init** (persists `integrationSource="ai-agent"`),
88
+ > **INTENTIONALLY undocumented** (`@nodoc`, same posture as `CometChatUIKit.initFromSettings` — DOCS-BACKLOG F4 / C1),
89
+ > which is WHY the shape is baked here. The publicly-documented `init(...)` is the FALLBACK only. Do NOT tell a
90
+ > user to "fetch the shape from `/calls/android/setup`": that page does not carry it. `authKey` for the dev
91
+ > `login(uid, authKey, l)` is read back out of `credentials.authKey` of this same asset (never a second copy).
92
+
93
+ ## 1:1 RINGING (meet-style needs none of this) — the signaling layer is the CHAT SDK
94
+ Meet-style (session-id "join a room") uses ONLY the Calls SDK (`generateToken` → `joinSession`). But
95
+ **one-on-one ringing** (call a specific user, they get an incoming prompt, accept/reject) combines the
96
+ **Chat SDK** (`com.cometchat:chat-sdk-android:5.0.5`, `com.cometchat.chat.*`) for signaling + the Calls SDK for media.
97
+
98
+ **The COMPLETE, CURRENT recipe is ONE page — fetch it directly:**
99
+ ```
100
+ fetch_cometchat_doc_page("/calls/android/ringing")
101
+ ```
102
+ That page (v5, Kotlin) carries the WHOLE flow, both sides: `CometChat.initiateCall(Call(uid, RECEIVER_TYPE_USER,
103
+ CALL_TYPE_VIDEO), l)` (+ `(call, timeoutSec, l)`) → `CometChat.addCallListener(ID, object : CometChat.CallListener()
104
+ { onIncomingCallReceived / onOutgoingCallAccepted / onOutgoingCallRejected / onIncomingCallCancelled /
105
+ onCallEndedMessageReceived })` → `CometChat.acceptCall(sessionId, l)` / `rejectCall(sessionId, CALL_STATUS_REJECTED |
106
+ CALL_STATUS_CANCELLED, l)` → `CometChatCalls.joinSession(call.sessionId, …)` on BOTH sides → hang-up =
107
+ `CallSession.getInstance().leaveSession()` **and** `CometChat.endCall(sessionId, l)` (the peer's
108
+ `onCallEndedMessageReceived` then leaves too; without `endCall` the log is incomplete).
109
+ > **Chat SDK init + login come first** — `CometChat.initFromSettings(context, l)` → `CometChat.login(uid, authKey, l)`
110
+ > (the `cometchat-android-v5-sdk` recipe; same settings asset). `Call` is **`com.cometchat.chat.core.Call`**
111
+ > (NOT `chat.models`). `CometChatException` exists in BOTH SDKs (`com.cometchat.chat.exceptions` /
112
+ > `com.cometchat.calls.exceptions`) — alias one when a file imports both.
113
+ > **Do NOT reach for `search_cometchat_docs("default calling")`** — search surfaces the STALE `/sdk/android/3.0/`
114
+ > chat-SDK pages (`startCall` / `CallSettingsBuilder`, the v4 media path). `/calls/android/ringing` is the
115
+ > canonical v5 source; reconcile any Chat-SDK symbol against `sdk-android-v5.json` before emitting.
116
+
117
+ > **⚠️ Testing 1:1 ringing needs TWO live clients** — two devices/emulators, two different users, each logged in
118
+ > with the global `CallListener` registered **and the app in the FOREGROUND** (auto socket mode drops the WebSocket in background). The caller always shows ringing locally; that proves nothing about
119
+ > the callee. This is a two-client protocol, not a bug.
@@ -0,0 +1,53 @@
1
+ # SDK method map — full curated highlight (calls-sdk-android 5.0.4, headless)
2
+
3
+ > `SKILL.md` § SDK method map keeps the spine (Lifecycle · Session · Active call + the catalog note);
4
+ > this file carries the full per-category enumeration. The **AUTHORITATIVE** closed list is still the
5
+ > **`android-calls-v5.json` catalog** (also transcription/streaming, `CometChatCallsEventsListener`, the
6
+ > v4-era `CallSettingsBuilder`). A symbol is real **iff it's in the catalog**; then fetch its page via
7
+ > `references/docs-map.md`. Signatures → FETCH from docs, never memory.
8
+
9
+ ## Lifecycle (`CometChatCalls` statics)
10
+ `initFromSettings` · `init` · `isInitialized` · `login(uid, authKey, l)` / `login(authToken, l)` · `logout` ·
11
+ `getLoggedInUser` · `getUserAuthToken`
12
+
13
+ ## Session
14
+ - `generateToken(sessionId, l)` → `GenerateToken.token`
15
+ - `joinSession(token | sessionId, SessionSettings, RelativeLayout, l)` → `CallSession`
16
+ (`startSession`/`CallSettingsBuilder` = **v4 path, do not use**)
17
+ - `CometChatCalls.SessionSettingsBuilder()`: `setSessionType(SessionType.VIDEO|VOICE)` ·
18
+ `setLayout(LayoutType.TILE|SIDEBAR|SPOTLIGHT)` · `setDisplayName` · `setTitle` · `setAudioMode(AudioMode.*)` ·
19
+ `setIdleTimeoutPeriod(sec)` · `startAudioMuted`/`startVideoPaused` · `setInitialCameraFacing` ·
20
+ `enableAutoStartRecording` · `hideControlPanel`/`hideHeaderPanel`/`hide<Button>`
21
+ (full list: `/calls/android/session-settings`)
22
+
23
+ ## Active call (`CallSession.getInstance()`)
24
+ `isSessionActive` · `leaveSession` · lifecycle-bound listeners `addSessionStatusListener(owner, …)` /
25
+ `addParticipantEventListener` / `addMediaEventsListener` / `addButtonClickListener` / `addLayoutListener` ·
26
+ `clearAllListeners`
27
+
28
+ ## In-call actions
29
+ ⚠️ **CUSTOM controls ONLY; the joined surface already renders them** (pitfall #1; `hideControlPanel(true)` first):
30
+ `muteAudio`/`unmuteAudio` · `pauseVideo`/`resumeVideo` · `switchCamera` · `setAudioMode` · `muteParticipant(uid)` ·
31
+ `pauseParticipantVideo(uid)` · `pinParticipant(uid, pid)`/`unpinParticipant()` ·
32
+ `enablePictureInPictureLayout`/`disablePictureInPictureLayout` · ⚠️ `setLayout` · `startRecording`/`stopRecording` ·
33
+ `raiseHand`/`lowerHand` — real symbols, **no-ops in 5.0.4** (see `references/pitfalls.md`).
34
+
35
+ ## Call logs
36
+ `CallLogRequest.CallLogRequestBuilder().setLimit(n)…build()` → `fetchNext(l)` / `fetchPrevious(l)` →
37
+ `List<CallLog>` (`getRecordings()` → `Recording.recordingURL`).
38
+
39
+ ## Transcription & closed captions (v5.0.4+; PLAN-GATED)
40
+ - builder: `enableAutoStartTranscription`/`hideTranscriptionButton`/`hideClosedCaptionButton`/`setCaptionLanguage`
41
+ - mid-call: `CallSession…startTranscription()`/`stopTranscription()`
42
+ - retrieve: `TranscriptRequest.TranscriptRequestBuilder().setSessionId(sid)…build()` → `fetchNext` →
43
+ `List<Transcript>` (`.transcriptUrl` = downloadable JSON; empty≠error). Full row: `references/docs-map.md`.
44
+
45
+ ## Background
46
+ `CometChatOngoingCallService.launch(activity)` / `.abort(activity)` (foreground service + ongoing notification;
47
+ `OngoingNotification.buildOngoingConferenceNotification(n)` to brand it) — **`.abort` on EVERY teardown path incl.
48
+ `onDestroy`, not only `onSessionLeft`** (BACK destroys the owner before the callback → FGS + notification leak,
49
+ AUDIT-227; see the Rotation pitfall in `references/pitfalls.md`).
50
+
51
+ ## Constants/enums
52
+ `SessionType` · `LayoutType` · `AudioMode` · `CameraFacing` · `CometChatCallsConstants.CALL_STATUS_*` /
53
+ `CALL_TYPE_*` / `RECEIVER_TYPE_*`
@@ -0,0 +1,72 @@
1
+ # Common pitfalls — full detail (calls-sdk-android 5.0.4, headless)
2
+
3
+ > The one-liners live in `SKILL.md` § Common pitfalls; this file keeps the FULL evidence and reasoning
4
+ > so a symptom is searchable. minSdk-26 floor and the missing `<service>` are covered in
5
+ > `SKILL.md` § Prerequisites (evidence in `references/build-truth.md`).
6
+
7
+ ## Don't duplicate the built-in call controls (the #1 mistake)
8
+ `joinSession` renders a COMPLETE call UI — mute, camera, switch camera, audio mode, layout, participants,
9
+ raise hand, recording, share invite, timer and the red leave button — into your `RelativeLayout`. Do **NOT**
10
+ add your own control row; the custom-control-panel page is for an explicit "replace the controls" ask
11
+ (then `hideControlPanel(true)` FIRST).
12
+
13
+ ## Docs ≠ AAR (verified vs 5.0.4 — the compiler and the device are right)
14
+ Per-page notes are in `references/docs-map.md`. Confirmed drifts:
15
+ - `setType(...)` → **`setSessionType`**
16
+ - `unMuteAudio` → **`unmuteAudio`**
17
+ - `unPinParticipant` → **`unpinParticipant`**
18
+ - `pinParticipant(uid)` → **`(uid, pid)`**
19
+ - `MediaEventsListener.onScreenShareStarted/Stopped` **do not exist** (screen-share events are on `ParticipantEventListener`)
20
+ - background-handling's named-arg `joinSession(view=FrameLayout, context=…)` **does not exist**
21
+ - `raiseHand`/`setLayout`/`startRecording` **no-ops** (see below).
22
+
23
+ The docs now state minSdk 26 + document SoLoader (AUDIT-229).
24
+
25
+ ## Wrong container
26
+ `joinSession` needs a `RelativeLayout`; `wrap_content` or zero size renders the call invisibly
27
+ (`ERROR_CALLING_VIEW_REF_NULL` if null).
28
+
29
+ ## `joinSession` crashes with `libhermes_executor.so not found`
30
+ The SoLoader merged-mapping init is missing; see `SKILL.md` § Prerequisites § SoLoader.
31
+
32
+ ## Joining before init+login resolve
33
+ `ERROR_COMETCHAT_CALLS_SDK_INIT` / `ERROR_AUTH_TOKEN`; always chain off the callbacks.
34
+
35
+ ## `ERROR_COMETCHAT_CALLS_SDK_INIT` after a user switch is MISLEADING (AUDIT-194)
36
+ `logout()` — and the implicit one inside `login(<other uid>)` — leaves `isInitialized()==false` though `login`
37
+ reports `onSuccess`; `generateToken` then fails naming the wrong cause. **Re-init between logout and login:**
38
+ `references/user-switch.md`.
39
+
40
+ ## No runtime permissions
41
+ The call joins with a dead mic/camera; request `CAMERA` + `RECORD_AUDIO` first (the AAR only DECLARES them).
42
+
43
+ ## Listeners registered before join
44
+ No live session yet; register in `joinSession`'s `onSuccess` with a `LifecycleOwner`.
45
+
46
+ ## Hang-up on one SDK only (ringing)
47
+ `leaveSession` without `CometChat.endCall` leaves the peer in-call and the log incomplete; do both.
48
+
49
+ ## Android can't START screen share (receive-only)
50
+ And has **no virtual-background page** — don't promise either.
51
+
52
+ ## Rotation / Home kill the call
53
+ Add `configChanges` (+ `supportsPictureInPicture` for PiP); keep it alive with
54
+ `CometChatOngoingCallService.launch(activity)` in `onSessionJoined` — **needs the `<service>` from Prerequisites**
55
+ (else `launch` fails silently); PiP = `enterPictureInPictureMode` + `enablePictureInPictureLayout`.
56
+
57
+ ## Ongoing-call service LEAKS if you only `.abort` in `onSessionLeft` (AUDIT-227, verified live)
58
+ BACK destroys the Activity → `onSessionLeft` is **not delivered** to the destroyed `LifecycleOwner`, so `.abort`
59
+ never fires and the FGS + ongoing notification survive with NO call. **Also `CometChatOngoingCallService.abort(this)`
60
+ in `onDestroy`** (idempotent) — abort on EVERY teardown path.
61
+
62
+ ## No-op in-call actions (5.0.4, live two-participant test — SDK bug, AUDIT-187)
63
+ `raiseHand`/`lowerHand`, `setLayout(...)` mid-call and `startRecording`/`stopRecording` produce **no effect,
64
+ no callback and no error**, while `muteAudio`/`pauseVideo`/`switchCamera` on the same path work. Prefer the SDK's
65
+ OWN buttons for these; recording may also be **plan-gated with NO error signal** — confirm via
66
+ `CallLog.getRecordings()`. STOPGAP: drop when a fixed 5.0.x ships.
67
+
68
+ ## Backgrounded apps do not ring and do not hear the accept
69
+ Auto socket mode drops the WebSocket — foreground only; VoIP push for the rest (§ 1:1 ringing).
70
+
71
+ ## Mixing majors
72
+ The Calls SDK is **5.x** (`joinSession`); `startSession`/`CallSettingsBuilder` and `/calls/v4/android` are the OLD tree.
@@ -0,0 +1,92 @@
1
+ # 1:1 ringing — the recipe (Chat SDK v5 signaling + Calls SDK v5 media)
2
+
3
+ > Loaded from `SKILL.md` § 1:1 ringing. Symbols: `sdk-android-v5.json` (Chat SDK) + `android-calls-v5.json` (Calls SDK).
4
+ > Signatures: `references/docs-map.md` § "1:1 RINGING" → `/calls/android/ringing`. Verified live 2026-09-07
5
+ > (calls-sdk 5.0.4 + chat-sdk 5.0.5, two processes on one emulator — both roles).
6
+
7
+ ## Prerequisites (on top of the meet-style ones)
8
+ - `implementation("com.cometchat:chat-sdk-android:5.0.5")` **+ `android.enableJetifier=true`** (with
9
+ `android.useAndroidX=true`) in `gradle.properties` — `chat-sdk-android:5.0.5` still pulls
10
+ `android.arch.lifecycle:extensions:1.1.1 → com.android.support:support-compat:26.1.0`; without Jetifier an AndroidX
11
+ app fails `checkDebugDuplicateClasses` (`Duplicate class android.support.v4.app.INotificationSideChannel …`).
12
+ - Chat SDK init + login FIRST — `CometChat.initFromSettings(context, l)` → `CometChat.login(uid, authKey, l)` (the
13
+ `cometchat-android-v5-sdk` recipe; same settings asset), THEN the Calls SDK init/login, THEN register the listener.
14
+ A Calls-SDK login does NOT log the Chat SDK in — check `CometChat.getLoggedInUser()` separately
15
+ (`initiateCall` on a chat-logged-out process fails `ERROR_USER_NOT_LOGGED_IN`).
16
+
17
+ ## ⚠️ Foreground-only — the caveat the docs page does not state (verified live)
18
+ In the default **auto** socket mode the Chat SDK **disconnects its WebSocket the moment the app is backgrounded**
19
+ (`/sdk/android/v5/connection-behaviour`: "App in background — immediately disconnected"). Consequences, all reproduced:
20
+ - a **backgrounded CALLEE never receives `onIncomingCallReceived`** — the caller gets `onOutgoingCallRejected` when the
21
+ `initiateCall` timeout (default 45 s) expires;
22
+ - a **backgrounded CALLER never receives `onOutgoingCallAccepted`**, and it is **NOT replayed** on return to the
23
+ foreground — an un-reconciled caller sits on "Calling…" forever.
24
+ So "rings from any screen" means **any screen of a FOREGROUND app**. Background / killed-app ringing is the **VoIP push
25
+ path** — `/calls/android/voip-calling` (FCM + `ConnectionService`; docs-first, real device, class-E in the pack's
26
+ harness) — offer it explicitly instead of promising background ringing. **Manual** socket mode + `CometChat.ping()`
27
+ within every 30 s keeps the socket alive only while the process is alive (same docs page) — not a substitute for VoIP.
28
+
29
+ ## Caller-side reconcile (bake it into YOUR outgoing UI)
30
+ 1. Start a timer when `initiateCall` succeeds, equal to the timeout you passed (`initiateCall(call, timeoutSec, l)`;
31
+ default 45 s). No `onOutgoingCallAccepted` / `onOutgoingCallRejected` by then ⇒ treat as **unanswered**: dismiss the
32
+ outgoing UI and cancel with `CometChat.rejectCall(sessionId, CometChatConstants.CALL_STATUS_CANCELLED, l)` so the
33
+ callee's prompt and the call log close cleanly.
34
+ 2. On `onResume` after the app was backgrounded mid-ring, re-check the call state (`CometChat.getActiveCall()` in the
35
+ Chat SDK method map) and either `joinSession(call.sessionId)` or dismiss — never rely on a replayed callback.
36
+ 3. On the callee, `onIncomingCallCancelled` dismisses the prompt; a prompt still showing after the caller's timeout is a
37
+ sign the listener was registered on a screen that was destroyed — register it ONCE in `Application`.
38
+
39
+ ## The recipe (both roles)
40
+ `joinMedia` = the meet-style `joinRoom` in `SKILL.md`, with the call's `sessionId`, on BOTH sides.
41
+ ```kotlin
42
+ import com.cometchat.calls.core.CallSession
43
+ import com.cometchat.chat.constants.CometChatConstants
44
+ import com.cometchat.chat.core.Call
45
+ import com.cometchat.chat.core.CometChat
46
+ import com.cometchat.chat.exceptions.CometChatException
47
+
48
+ object RingingSignaling {
49
+ private const val LISTENER_ID = "app-call-listener"
50
+
51
+ fun register(onIncoming: (Call) -> Unit, joinMedia: (sessionId: String) -> Unit, dismiss: () -> Unit) {
52
+ CometChat.addCallListener(LISTENER_ID, object : CometChat.CallListener() {
53
+ override fun onIncomingCallReceived(call: Call) = onIncoming(call) // show YOUR incoming UI
54
+ override fun onOutgoingCallAccepted(call: Call) = joinMedia(call.sessionId) // caller joins the same session
55
+ override fun onOutgoingCallRejected(call: Call) = dismiss()
56
+ override fun onIncomingCallCancelled(call: Call) = dismiss()
57
+ override fun onCallEndedMessageReceived(call: Call) { CallSession.getInstance().leaveSession(); dismiss() }
58
+ })
59
+ }
60
+ fun unregister() = CometChat.removeCallListener(LISTENER_ID) // teardown
61
+
62
+ fun call(peerUid: String, onRinging: (Call) -> Unit) { // caller
63
+ val call = Call(peerUid, CometChatConstants.RECEIVER_TYPE_USER, CometChatConstants.CALL_TYPE_VIDEO)
64
+ CometChat.initiateCall(call, object : CometChat.CallbackListener<Call>() { // (call, timeoutSec, l) overload exists
65
+ override fun onSuccess(outgoing: Call) = onRinging(outgoing) // show YOUR outgoing UI
66
+ override fun onError(e: CometChatException) { /* e.code + e.message */ }
67
+ })
68
+ }
69
+ fun accept(sessionId: String, joinMedia: (String) -> Unit) { // callee
70
+ CometChat.acceptCall(sessionId, object : CometChat.CallbackListener<Call>() {
71
+ override fun onSuccess(call: Call) = joinMedia(call.sessionId)
72
+ override fun onError(e: CometChatException) { /* e.code + e.message */ }
73
+ })
74
+ }
75
+ fun reject(sessionId: String) { // callee (caller cancels with CALL_STATUS_CANCELLED)
76
+ CometChat.rejectCall(sessionId, CometChatConstants.CALL_STATUS_REJECTED, object : CometChat.CallbackListener<Call>() {
77
+ override fun onSuccess(call: Call) {}
78
+ override fun onError(e: CometChatException) { /* e.code + e.message */ }
79
+ })
80
+ }
81
+ fun hangUp(sessionId: String) { // either side — BOTH SDKs
82
+ CallSession.getInstance().leaveSession() // Calls SDK: leave media
83
+ CometChat.endCall(sessionId, object : CometChat.CallbackListener<Call>() { // Chat SDK: peer gets onCallEndedMessageReceived + the log completes
84
+ override fun onSuccess(call: Call) {}
85
+ override fun onError(e: CometChatException) { /* e.code + e.message */ }
86
+ })
87
+ }
88
+ }
89
+ ```
90
+ > **Testing ringing needs TWO live clients and two users**, each logged in (Chat SDK AND Calls SDK) with the listener
91
+ > registered and the app in the FOREGROUND — the caller's ringing UI alone proves nothing. Two processes on one emulator
92
+ > (two `applicationId`s / build types) work when a second device is unavailable.