@cometchat/skills 4.1.0 → 4.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (257) hide show
  1. package/bin/install.js +298 -41
  2. package/package.json +1 -1
  3. package/skills/cometchat/SKILL.md +146 -27
  4. package/skills/cometchat-a11y/SKILL.md +476 -0
  5. package/skills/cometchat-android-v5/SKILL.md +1 -1
  6. package/skills/cometchat-android-v5-calls/SKILL.md +413 -0
  7. package/skills/cometchat-android-v5-calls/references/README.md +53 -0
  8. package/skills/cometchat-android-v5-calls/references/add-calls-to-existing-chat.md +195 -0
  9. package/skills/cometchat-android-v5-calls/references/audio-controls.md +91 -0
  10. package/skills/cometchat-android-v5-calls/references/background-handling.md +168 -0
  11. package/skills/cometchat-android-v5-calls/references/call-layouts.md +123 -0
  12. package/skills/cometchat-android-v5-calls/references/call-logs.md +113 -0
  13. package/skills/cometchat-android-v5-calls/references/call-session.md +274 -0
  14. package/skills/cometchat-android-v5-calls/references/custom-ui.md +150 -0
  15. package/skills/cometchat-android-v5-calls/references/event-listeners.md +123 -0
  16. package/skills/cometchat-android-v5-calls/references/group-calls.md +205 -0
  17. package/skills/cometchat-android-v5-calls/references/idle-timeout.md +111 -0
  18. package/skills/cometchat-android-v5-calls/references/in-call-chat.md +134 -0
  19. package/skills/cometchat-android-v5-calls/references/join-session.md +120 -0
  20. package/skills/cometchat-android-v5-calls/references/migration-v4-to-v5.md +206 -0
  21. package/skills/cometchat-android-v5-calls/references/participant-management.md +110 -0
  22. package/skills/cometchat-android-v5-calls/references/picture-in-picture.md +106 -0
  23. package/skills/cometchat-android-v5-calls/references/raise-hand.md +242 -0
  24. package/skills/cometchat-android-v5-calls/references/recording.md +101 -0
  25. package/skills/cometchat-android-v5-calls/references/ringing-integration.md +152 -0
  26. package/skills/cometchat-android-v5-calls/references/screen-sharing.md +82 -0
  27. package/skills/cometchat-android-v5-calls/references/server-fcm-voip.md +215 -0
  28. package/skills/cometchat-android-v5-calls/references/session-settings.md +121 -0
  29. package/skills/cometchat-android-v5-calls/references/setup.md +137 -0
  30. package/skills/cometchat-android-v5-calls/references/share-invite.md +151 -0
  31. package/skills/cometchat-android-v5-calls/references/video-controls.md +87 -0
  32. package/skills/cometchat-android-v5-calls/references/voip-calling.md +526 -0
  33. package/skills/cometchat-android-v5-components/SKILL.md +1 -1
  34. package/skills/cometchat-android-v5-core/SKILL.md +1 -1
  35. package/skills/cometchat-android-v5-customization/SKILL.md +1 -1
  36. package/skills/cometchat-android-v5-extensions/SKILL.md +1 -1
  37. package/skills/cometchat-android-v5-features/SKILL.md +1 -1
  38. package/skills/cometchat-android-v5-placement/SKILL.md +1 -1
  39. package/skills/cometchat-android-v5-production/SKILL.md +1 -1
  40. package/skills/cometchat-android-v5-push/SKILL.md +1 -1
  41. package/skills/cometchat-android-v5-testing/SKILL.md +1 -1
  42. package/skills/cometchat-android-v5-theming/SKILL.md +1 -1
  43. package/skills/cometchat-android-v5-troubleshooting/SKILL.md +1 -1
  44. package/skills/cometchat-android-v6/SKILL.md +1 -1
  45. package/skills/cometchat-android-v6-builder-settings/SKILL.md +1 -1
  46. package/skills/cometchat-android-v6-calls/SKILL.md +375 -0
  47. package/skills/cometchat-android-v6-calls/references/add-calls-to-existing-chat.md +97 -0
  48. package/skills/cometchat-android-v6-calls/references/call-layouts.md +91 -0
  49. package/skills/cometchat-android-v6-calls/references/call-session.md +163 -0
  50. package/skills/cometchat-android-v6-calls/references/device-management.md +171 -0
  51. package/skills/cometchat-android-v6-calls/references/group-calls.md +191 -0
  52. package/skills/cometchat-android-v6-calls/references/idle-timeout.md +107 -0
  53. package/skills/cometchat-android-v6-calls/references/in-call-chat.md +136 -0
  54. package/skills/cometchat-android-v6-calls/references/raise-hand.md +186 -0
  55. package/skills/cometchat-android-v6-calls/references/ringing-integration.md +176 -0
  56. package/skills/cometchat-android-v6-calls/references/server-fcm-voip.md +127 -0
  57. package/skills/cometchat-android-v6-calls/references/share-invite.md +105 -0
  58. package/skills/cometchat-android-v6-compose-components/SKILL.md +2 -2
  59. package/skills/cometchat-android-v6-compose-customization/SKILL.md +1 -1
  60. package/skills/cometchat-android-v6-compose-placement/SKILL.md +1 -1
  61. package/skills/cometchat-android-v6-compose-theming/SKILL.md +1 -1
  62. package/skills/cometchat-android-v6-core/SKILL.md +1 -1
  63. package/skills/cometchat-android-v6-events/SKILL.md +1 -1
  64. package/skills/cometchat-android-v6-extensions/SKILL.md +1 -1
  65. package/skills/cometchat-android-v6-features/SKILL.md +1 -1
  66. package/skills/cometchat-android-v6-kotlin-components/SKILL.md +1 -1
  67. package/skills/cometchat-android-v6-kotlin-customization/SKILL.md +1 -1
  68. package/skills/cometchat-android-v6-kotlin-placement/SKILL.md +1 -1
  69. package/skills/cometchat-android-v6-kotlin-theming/SKILL.md +1 -1
  70. package/skills/cometchat-android-v6-migration/SKILL.md +398 -0
  71. package/skills/cometchat-android-v6-production/SKILL.md +1 -1
  72. package/skills/cometchat-android-v6-push/SKILL.md +1 -1
  73. package/skills/cometchat-android-v6-testing/SKILL.md +1 -1
  74. package/skills/cometchat-android-v6-troubleshooting/SKILL.md +1 -1
  75. package/skills/cometchat-angular-calls/SKILL.md +511 -0
  76. package/skills/cometchat-angular-calls/references/add-calls-to-existing-chat.md +95 -0
  77. package/skills/cometchat-angular-calls/references/call-layouts.md +106 -0
  78. package/skills/cometchat-angular-calls/references/call-session.md +167 -0
  79. package/skills/cometchat-angular-calls/references/custom-ui.md +231 -0
  80. package/skills/cometchat-angular-calls/references/device-management.md +135 -0
  81. package/skills/cometchat-angular-calls/references/group-calls.md +412 -0
  82. package/skills/cometchat-angular-calls/references/idle-timeout.md +145 -0
  83. package/skills/cometchat-angular-calls/references/in-call-chat.md +148 -0
  84. package/skills/cometchat-angular-calls/references/lazy-loading-pitfalls.md +205 -0
  85. package/skills/cometchat-angular-calls/references/migration-v4-to-v5.md +53 -0
  86. package/skills/cometchat-angular-calls/references/ngzone-and-async-callbacks.md +183 -0
  87. package/skills/cometchat-angular-calls/references/picture-in-picture.md +285 -0
  88. package/skills/cometchat-angular-calls/references/raise-hand.md +167 -0
  89. package/skills/cometchat-angular-calls/references/recording-screen-share.md +267 -0
  90. package/skills/cometchat-angular-calls/references/ringing-integration.md +131 -0
  91. package/skills/cometchat-angular-calls/references/server-web-push-vapid.md +100 -0
  92. package/skills/cometchat-angular-calls/references/share-invite.md +116 -0
  93. package/skills/cometchat-angular-components/SKILL.md +1 -1
  94. package/skills/cometchat-angular-core/SKILL.md +1 -1
  95. package/skills/cometchat-angular-customization/SKILL.md +1 -1
  96. package/skills/cometchat-angular-features/SKILL.md +1 -1
  97. package/skills/cometchat-angular-patterns/SKILL.md +1 -1
  98. package/skills/cometchat-angular-placement/SKILL.md +1 -1
  99. package/skills/cometchat-angular-production/SKILL.md +1 -1
  100. package/skills/cometchat-angular-push/SKILL.md +403 -0
  101. package/skills/cometchat-angular-testing/SKILL.md +333 -0
  102. package/skills/cometchat-angular-theming/SKILL.md +1 -1
  103. package/skills/cometchat-angular-troubleshooting/SKILL.md +1 -1
  104. package/skills/cometchat-astro-patterns/SKILL.md +1 -1
  105. package/skills/cometchat-calls/SKILL.md +358 -0
  106. package/skills/cometchat-calls/references/use-case-broadcast.md +194 -0
  107. package/skills/cometchat-calls/references/use-case-marketplace.md +158 -0
  108. package/skills/cometchat-calls/references/use-case-support.md +190 -0
  109. package/skills/cometchat-calls/references/use-case-team.md +169 -0
  110. package/skills/cometchat-calls/references/use-case-telehealth.md +154 -0
  111. package/skills/cometchat-components/SKILL.md +1 -1
  112. package/skills/cometchat-core/SKILL.md +1 -1
  113. package/skills/cometchat-customization/SKILL.md +2 -2
  114. package/skills/cometchat-features/SKILL.md +2 -2
  115. package/skills/cometchat-flutter-v5/SKILL.md +1 -1
  116. package/skills/cometchat-flutter-v5-calls/SKILL.md +325 -94
  117. package/skills/cometchat-flutter-v5-calls/references/add-calls-to-existing-chat.md +169 -0
  118. package/skills/cometchat-flutter-v5-calls/references/call-layouts.md +98 -0
  119. package/skills/cometchat-flutter-v5-calls/references/call-session.md +330 -0
  120. package/skills/cometchat-flutter-v5-calls/references/device-management.md +120 -0
  121. package/skills/cometchat-flutter-v5-calls/references/group-calls.md +187 -0
  122. package/skills/cometchat-flutter-v5-calls/references/idle-timeout.md +97 -0
  123. package/skills/cometchat-flutter-v5-calls/references/in-call-chat.md +132 -0
  124. package/skills/cometchat-flutter-v5-calls/references/migration-v4-to-v5.md +160 -0
  125. package/skills/cometchat-flutter-v5-calls/references/raise-hand.md +244 -0
  126. package/skills/cometchat-flutter-v5-calls/references/ringing-integration.md +193 -0
  127. package/skills/cometchat-flutter-v5-calls/references/server-push-bridge.md +101 -0
  128. package/skills/cometchat-flutter-v5-calls/references/share-invite.md +142 -0
  129. package/skills/cometchat-flutter-v5-conversations/SKILL.md +1 -1
  130. package/skills/cometchat-flutter-v5-core/SKILL.md +1 -1
  131. package/skills/cometchat-flutter-v5-customization/SKILL.md +1 -1
  132. package/skills/cometchat-flutter-v5-events/SKILL.md +1 -1
  133. package/skills/cometchat-flutter-v5-messages/SKILL.md +1 -1
  134. package/skills/cometchat-flutter-v5-production/SKILL.md +1 -1
  135. package/skills/cometchat-flutter-v5-push/SKILL.md +1 -1
  136. package/skills/cometchat-flutter-v5-testing/SKILL.md +390 -0
  137. package/skills/cometchat-flutter-v5-theming/SKILL.md +1 -1
  138. package/skills/cometchat-flutter-v5-troubleshooting/SKILL.md +1 -1
  139. package/skills/cometchat-flutter-v5-users-groups/SKILL.md +1 -1
  140. package/skills/cometchat-flutter-v6/SKILL.md +1 -1
  141. package/skills/cometchat-flutter-v6-calls/SKILL.md +308 -243
  142. package/skills/cometchat-flutter-v6-calls/references/add-calls-to-existing-chat.md +134 -0
  143. package/skills/cometchat-flutter-v6-calls/references/call-layouts.md +102 -0
  144. package/skills/cometchat-flutter-v6-calls/references/call-session.md +229 -0
  145. package/skills/cometchat-flutter-v6-calls/references/device-management.md +99 -0
  146. package/skills/cometchat-flutter-v6-calls/references/group-calls.md +190 -0
  147. package/skills/cometchat-flutter-v6-calls/references/idle-timeout.md +80 -0
  148. package/skills/cometchat-flutter-v6-calls/references/in-call-chat.md +122 -0
  149. package/skills/cometchat-flutter-v6-calls/references/raise-hand.md +268 -0
  150. package/skills/cometchat-flutter-v6-calls/references/ringing-integration.md +171 -0
  151. package/skills/cometchat-flutter-v6-calls/references/server-push-bridge.md +93 -0
  152. package/skills/cometchat-flutter-v6-calls/references/share-invite.md +102 -0
  153. package/skills/cometchat-flutter-v6-components/SKILL.md +1 -1
  154. package/skills/cometchat-flutter-v6-conversations/SKILL.md +1 -1
  155. package/skills/cometchat-flutter-v6-core/SKILL.md +1 -1
  156. package/skills/cometchat-flutter-v6-customization/SKILL.md +1 -1
  157. package/skills/cometchat-flutter-v6-events/SKILL.md +1 -1
  158. package/skills/cometchat-flutter-v6-features/SKILL.md +1 -1
  159. package/skills/cometchat-flutter-v6-messages/SKILL.md +1 -1
  160. package/skills/cometchat-flutter-v6-migration/SKILL.md +1 -1
  161. package/skills/cometchat-flutter-v6-placement/SKILL.md +1 -1
  162. package/skills/cometchat-flutter-v6-production/SKILL.md +1 -1
  163. package/skills/cometchat-flutter-v6-push/SKILL.md +452 -0
  164. package/skills/cometchat-flutter-v6-testing/SKILL.md +319 -0
  165. package/skills/cometchat-flutter-v6-theming/SKILL.md +1 -1
  166. package/skills/cometchat-flutter-v6-troubleshooting/SKILL.md +1 -1
  167. package/skills/cometchat-flutter-v6-users-groups/SKILL.md +1 -1
  168. package/skills/cometchat-i18n/SKILL.md +358 -0
  169. package/skills/cometchat-ios/SKILL.md +5 -5
  170. package/skills/cometchat-ios-calls/SKILL.md +409 -0
  171. package/skills/cometchat-ios-calls/references/add-calls-to-existing-chat.md +172 -0
  172. package/skills/cometchat-ios-calls/references/avaudiosession-routing.md +189 -0
  173. package/skills/cometchat-ios-calls/references/call-layouts.md +136 -0
  174. package/skills/cometchat-ios-calls/references/call-session.md +221 -0
  175. package/skills/cometchat-ios-calls/references/callkit-and-pushkit.md +353 -0
  176. package/skills/cometchat-ios-calls/references/custom-ui.md +322 -0
  177. package/skills/cometchat-ios-calls/references/device-management.md +171 -0
  178. package/skills/cometchat-ios-calls/references/group-calls.md +396 -0
  179. package/skills/cometchat-ios-calls/references/idle-timeout.md +185 -0
  180. package/skills/cometchat-ios-calls/references/in-call-chat.md +183 -0
  181. package/skills/cometchat-ios-calls/references/migration-v4-to-v5.md +138 -0
  182. package/skills/cometchat-ios-calls/references/picture-in-picture.md +246 -0
  183. package/skills/cometchat-ios-calls/references/raise-hand.md +239 -0
  184. package/skills/cometchat-ios-calls/references/recording-screen-share.md +339 -0
  185. package/skills/cometchat-ios-calls/references/ringing-integration.md +142 -0
  186. package/skills/cometchat-ios-calls/references/server-apns-pushkit.md +267 -0
  187. package/skills/cometchat-ios-calls/references/share-invite.md +152 -0
  188. package/skills/cometchat-ios-calls/references/swiftui-uikit-hosting.md +246 -0
  189. package/skills/cometchat-ios-calls/references/voip-cert-setup.md +166 -0
  190. package/skills/cometchat-ios-components/SKILL.md +1 -1
  191. package/skills/cometchat-ios-core/SKILL.md +1 -1
  192. package/skills/cometchat-ios-customization/SKILL.md +1 -1
  193. package/skills/cometchat-ios-features/SKILL.md +1 -1
  194. package/skills/cometchat-ios-placement/SKILL.md +1 -1
  195. package/skills/cometchat-ios-production/SKILL.md +1 -1
  196. package/skills/cometchat-ios-push/SKILL.md +1 -1
  197. package/skills/cometchat-ios-testing/SKILL.md +371 -0
  198. package/skills/cometchat-ios-theming/SKILL.md +1 -1
  199. package/skills/cometchat-ios-troubleshooting/SKILL.md +1 -1
  200. package/skills/cometchat-native-bare-patterns/SKILL.md +45 -3
  201. package/skills/cometchat-native-calls/SKILL.md +599 -0
  202. package/skills/cometchat-native-calls/references/add-calls-to-existing-chat.md +203 -0
  203. package/skills/cometchat-native-calls/references/call-layouts.md +124 -0
  204. package/skills/cometchat-native-calls/references/call-session.md +182 -0
  205. package/skills/cometchat-native-calls/references/custom-ui.md +250 -0
  206. package/skills/cometchat-native-calls/references/device-management.md +135 -0
  207. package/skills/cometchat-native-calls/references/expo-vs-bare.md +179 -0
  208. package/skills/cometchat-native-calls/references/group-calls.md +291 -0
  209. package/skills/cometchat-native-calls/references/idle-timeout.md +128 -0
  210. package/skills/cometchat-native-calls/references/in-call-chat.md +143 -0
  211. package/skills/cometchat-native-calls/references/migration-v4-to-v5.md +72 -0
  212. package/skills/cometchat-native-calls/references/picture-in-picture.md +276 -0
  213. package/skills/cometchat-native-calls/references/raise-hand.md +203 -0
  214. package/skills/cometchat-native-calls/references/recording-screen-share.md +290 -0
  215. package/skills/cometchat-native-calls/references/ringing-integration.md +118 -0
  216. package/skills/cometchat-native-calls/references/server-push-bridge.md +135 -0
  217. package/skills/cometchat-native-calls/references/server-push-payloads.md +193 -0
  218. package/skills/cometchat-native-calls/references/share-invite.md +144 -0
  219. package/skills/cometchat-native-calls/references/voip-push-end-to-end.md +317 -0
  220. package/skills/cometchat-native-components/SKILL.md +1 -1
  221. package/skills/cometchat-native-core/SKILL.md +1 -1
  222. package/skills/cometchat-native-customization/SKILL.md +1 -1
  223. package/skills/cometchat-native-expo-patterns/SKILL.md +18 -1
  224. package/skills/cometchat-native-features/SKILL.md +1 -1
  225. package/skills/cometchat-native-placement/SKILL.md +1 -1
  226. package/skills/cometchat-native-production/SKILL.md +1 -1
  227. package/skills/cometchat-native-push/SKILL.md +1 -1
  228. package/skills/cometchat-native-testing/SKILL.md +1 -1
  229. package/skills/cometchat-native-theming/SKILL.md +1 -1
  230. package/skills/cometchat-native-troubleshooting/SKILL.md +1 -1
  231. package/skills/cometchat-nextjs-patterns/SKILL.md +1 -1
  232. package/skills/cometchat-placement/SKILL.md +1 -1
  233. package/skills/cometchat-production/SKILL.md +1 -1
  234. package/skills/cometchat-react-calls/SKILL.md +539 -0
  235. package/skills/cometchat-react-calls/references/add-calls-to-existing-chat.md +145 -0
  236. package/skills/cometchat-react-calls/references/call-layouts.md +161 -0
  237. package/skills/cometchat-react-calls/references/call-session.md +235 -0
  238. package/skills/cometchat-react-calls/references/custom-ui.md +201 -0
  239. package/skills/cometchat-react-calls/references/device-management.md +206 -0
  240. package/skills/cometchat-react-calls/references/group-calls.md +262 -0
  241. package/skills/cometchat-react-calls/references/idle-timeout.md +175 -0
  242. package/skills/cometchat-react-calls/references/in-call-chat.md +212 -0
  243. package/skills/cometchat-react-calls/references/migration-v4-to-v5.md +172 -0
  244. package/skills/cometchat-react-calls/references/picture-in-picture.md +245 -0
  245. package/skills/cometchat-react-calls/references/raise-hand.md +238 -0
  246. package/skills/cometchat-react-calls/references/recording-screen-share.md +143 -0
  247. package/skills/cometchat-react-calls/references/ringing-integration.md +255 -0
  248. package/skills/cometchat-react-calls/references/server-web-push-vapid.md +241 -0
  249. package/skills/cometchat-react-calls/references/share-invite.md +176 -0
  250. package/skills/cometchat-react-calls/references/testing-calls-on-web.md +198 -0
  251. package/skills/cometchat-react-calls/references/voip-and-web-push.md +165 -0
  252. package/skills/cometchat-react-patterns/SKILL.md +1 -1
  253. package/skills/cometchat-react-push/SKILL.md +448 -0
  254. package/skills/cometchat-react-router-patterns/SKILL.md +1 -1
  255. package/skills/cometchat-react-testing/SKILL.md +404 -0
  256. package/skills/cometchat-theming/SKILL.md +3 -3
  257. package/skills/cometchat-troubleshooting/SKILL.md +2 -2
@@ -0,0 +1,375 @@
1
+ ---
2
+ name: cometchat-android-v6-calls
3
+ description: CometChat Calls v6 integration for native Android (V6 beta — Compose + Kotlin Views). Works end-to-end on chatuikit-compose-android:6.0.0 (validated 2026-05-12 against web peer) — but only with FIVE non-obvious workarounds the kit itself doesn't ship: (1) explicit `calls-sdk-android:5.0.+` peer dep, (2) `annotations-java5` exclude, (3) stub classes for legacy `com.cometchat.calls.{CometChatRTCView, model.RTCUser, model.RTCReceiver, model.RTCCallback}` to satisfy chat-sdk's CallManager bytecode, (4) AVOID `CometChatCallButtons` (broken — captures first-rendered user globally; ignores per-row prop) — instead wire your own button → `CometChat.initiateCall` → `CometChatCallActivity.Companion.launchOutgoingCallScreen(context, call, null)`, (5) `Call` constructor arg order CHANGED in chat-sdk 5.x: `(receiverUid, receiverType, type)` not `(receiverUid, type, receiverType)`. Covers UIKitSettings calling configuration, surface-aware Compose+Views routing, foreground service correctness on Android 14+, ConnectionService + FCM VoIP push.
4
+ license: "MIT"
5
+ compatibility: "Android Studio Hedgehog+, JDK 17, Gradle 8+, AGP 8+, minSdk 28+ (V6 raised the floor); chatuikit-compose-android:6.0.+ OR chatuikit-kotlin-android:6.0.+ PAIRED with com.cometchat:calls-sdk-android:5.0.+ (peer dep required despite the V6 marketing — see §1.0)"
6
+ allowed-tools: "shell, file-read, file-search, file-list, ask-user"
7
+ metadata:
8
+ author: "CometChat"
9
+ version: "4.0.0"
10
+ tags: "cometchat android v6 calls voice video webrtc compose kotlin-views uikitsettings calling-configuration foreground-service voip fcm connectionservice beta"
11
+ ---
12
+
13
+ ## ⚠️ Five required workarounds for chatuikit-compose-android:6.0.0
14
+
15
+ Validated end-to-end on Pixel 3 (Android 12) ↔ Next.js peer on 2026-05-12. **All five must be applied** — the V6 beta artifacts ship without them and the app crashes on first call attempt without one of them in place.
16
+
17
+ ### W1 — `calls-sdk-android:5.0.+` is a REQUIRED peer dep
18
+
19
+ The V6 chatuikit advertises bundled calling, but its compose AAR references `com.cometchat.calls.core.CometChatCalls$SessionSettingsBuilder` at bytecode level — that class lives in `calls-sdk-android:5.0.0`, not in the chatuikit AAR. Without this dep, `Application.onCreate` crashes with `ClassNotFoundException`.
20
+
21
+ ```kotlin
22
+ implementation("com.cometchat:chatuikit-compose-android:6.0.+")
23
+ implementation("com.cometchat:calls-sdk-android:5.0.+") // REQUIRED
24
+ ```
25
+
26
+ ### W2 — `annotations-java5` duplicate-class exclude
27
+
28
+ Build fails with `Duplicate class org.jetbrains.annotations.*` from a transitive legacy dep.
29
+
30
+ ```kotlin
31
+ configurations.all {
32
+ exclude(group = "org.jetbrains", module = "annotations-java5")
33
+ }
34
+ ```
35
+
36
+ ### W3 — Stub classes for chat-sdk's legacy CallManager references
37
+
38
+ chat-sdk-android's `CallManager` bytecode references legacy `com.cometchat.calls.{CometChatRTCView, model.RTCUser, model.RTCReceiver, model.RTCCallback}` (V3-era paths). calls-sdk-android:5.0.0 moved everything to `com.cometchat.calls.core.*` and dropped these. Without stubs in your source tree, the first call attempt fires `E/CallManager: CometChat Calling module not found`.
39
+
40
+ Create empty stubs at the legacy paths:
41
+
42
+ ```java
43
+ // app/src/main/java/com/cometchat/calls/CometChatRTCView.java
44
+ package com.cometchat.calls;
45
+ public class CometChatRTCView {}
46
+
47
+ // app/src/main/java/com/cometchat/calls/model/RTCUser.java
48
+ package com.cometchat.calls.model;
49
+ public class RTCUser {
50
+ public RTCUser(String uid, String name, String avatar) {}
51
+ }
52
+
53
+ // app/src/main/java/com/cometchat/calls/model/RTCReceiver.java
54
+ package com.cometchat.calls.model;
55
+ public class RTCReceiver {
56
+ public RTCReceiver(String uid, String name, String type) {}
57
+ }
58
+
59
+ // app/src/main/java/com/cometchat/calls/model/RTCCallback.java
60
+ package com.cometchat.calls.model;
61
+ public interface RTCCallback<T> { void onSuccess(T result); }
62
+ ```
63
+
64
+ Class verification finds these locally and lets CallManager load. They're never actually invoked at runtime because the V6 chatuikit uses `com.cometchat.calls.core.CometChatCalls.startSession` (a different code path) for the real call surface.
65
+
66
+ ### W4 — Do NOT use `CometChatCallButtons` — wire your own
67
+
68
+ The kit's `CometChatCallButtons(user = user)` composable IGNORES the per-row `user` prop and dials whichever user was first rendered (it captures global state on first composition). Symptom: every call regardless of which row you tap rings the same person. Workaround:
69
+
70
+ ```kotlin
71
+ @Composable
72
+ fun UserRow(user: User) {
73
+ val context = LocalContext.current
74
+ Row(...) {
75
+ Text(user.name ?: user.uid)
76
+ IconButton(onClick = {
77
+ val outgoing = Call(
78
+ user.uid,
79
+ CometChatConstants.RECEIVER_TYPE_USER, // see W5 — order matters
80
+ CometChatConstants.CALL_TYPE_VIDEO,
81
+ )
82
+ CometChat.initiateCall(outgoing, object : CometChat.CallbackListener<Call>() {
83
+ override fun onSuccess(call: Call) {
84
+ // Hand off to the kit's outgoing-call screen — this part works correctly
85
+ CometChatCallActivity.Companion.launchOutgoingCallScreen(context, call, null)
86
+ }
87
+ override fun onError(e: CometChatException) { /* surface */ }
88
+ })
89
+ }) { Text("📹") }
90
+ }
91
+ }
92
+ ```
93
+
94
+ `CometChatCallActivity.launchOutgoingCallScreen` handles the full lifecycle (ringing UI, token mint, joinSession, transition to in-call surface) correctly — only the button composable is broken.
95
+
96
+ ### W5 — `Call` constructor arg order CHANGED in chat-sdk 5.x
97
+
98
+ ```kotlin
99
+ // ❌ v4 style — server returns ERR_BAD_REQUEST: "Failed to validate the data sent with the request"
100
+ Call(receiverUid, CALL_TYPE_VIDEO, RECEIVER_TYPE_USER)
101
+
102
+ // ✅ v5 (what chatuikit-compose:6.0.0 pulls in transitively as chat-sdk-android:5.0.1)
103
+ Call(receiverUid, RECEIVER_TYPE_USER, CALL_TYPE_VIDEO)
104
+ ```
105
+
106
+ Bytecode-confirmed against chat-sdk-android:5.0.1: `arg1 → receiverUid`, `arg2 → receiverType`, `arg3 → type`.
107
+
108
+ ---
109
+
110
+ ## Purpose
111
+
112
+ Production-grade voice + video calling for native Android v6 (beta). Loaded by `cometchat-calls` when `android_version === "v6"`. Routes to the **Compose** or **Kotlin Views** sub-flow based on the surface the project uses (already determined by `cometchat-android-v6-core` from the presence of `androidx.compose.ui:ui` / `compose.material3` in the dependency graph).
113
+
114
+ **⚠️ Important — V6 still needs `calls-sdk-android` on the classpath despite marketing claims.** The V6 chatuikit packages advertise "bundled calling," but at runtime `CometChatUIKit.init` references `com.cometchat.calls.core.CometChatCalls$SessionSettingsBuilder` — a class that lives in `com.cometchat:calls-sdk-android`, NOT in the chatuikit AAR. Without the peer dep, the app crashes on `Application.onCreate` with `ClassNotFoundException`. Always add:
115
+
116
+ ```kotlin
117
+ dependencies {
118
+ implementation("com.cometchat:chatuikit-compose-android:6.0.+") // or chatuikit-kotlin-android
119
+ implementation("com.cometchat:calls-sdk-android:5.0.+") // REQUIRED — not optional
120
+ }
121
+ ```
122
+
123
+ The `UIKitSettings` builder must still call `.setEnableCalling(true)` to register the calling extension at init time.
124
+
125
+ **Read these other skills first:**
126
+ - `cometchat-calls` — dispatcher (modes, hard rules, anti-patterns)
127
+ - `cometchat-android-v6-core` — UIKitSettings shape, Compose vs Views detection, init order
128
+ - `cometchat-android-v6-builder-settings` — every option on `UIKitSettings` including the calling block
129
+ - `cometchat-android-v6-{compose,kotlin}-components` — surface-specific component catalogs
130
+
131
+ **Ground truth:**
132
+ - SDK source — installed `chatuikit-{compose,kotlin}-android@6.0.0-beta2` artifacts under `~/.gradle/caches/`
133
+ - V5 sibling skill — `cometchat-android-v5-calls` (different module shape, same hard rules)
134
+ - Public docs — https://www.cometchat.com/docs/calls/android/overview (note: V6 docs may still reference V5 module split)
135
+
136
+ ---
137
+
138
+ ## 1. The seven hard rules — Android v6 specialization
139
+
140
+ The same seven non-negotiables from the dispatcher; v6 changes the *how* but not the *what*.
141
+
142
+ ### 1.0 Calls SDK login is its own step (v5+)
143
+
144
+ Same as v5 cohort — the v5 Calls SDK has its own auth state, separate from the Chat SDK. After `CometChat.login(uid, AUTH_KEY)` succeeds, you MUST also call `CometChatCalls.login(uid, AUTH_KEY, ...)` — without it, the FIRST calls API call throws **"auth token cannot be null"**.
145
+
146
+ ```kotlin
147
+ import com.cometchat.calls.core.CometChatCalls
148
+ import com.cometchat.calls.exceptions.CometChatException as CallsException
149
+ import com.cometchat.calls.model.CallUser // ← callback type, NOT chat User
150
+
151
+ // ✓ RIGHT — chat login first, then calls login
152
+ CometChat.login(uid, AUTH_KEY, object : CometChat.CallbackListener<User>() {
153
+ override fun onSuccess(user: User) {
154
+ CometChatCalls.login(uid, AUTH_KEY,
155
+ object : CometChatCalls.CallbackListener<CallUser>() {
156
+ override fun onSuccess(callUser: CallUser) { /* both ready */ }
157
+ override fun onError(e: CallsException) { /* surface */ }
158
+ })
159
+ }
160
+ override fun onError(e: CometChatException) { /* surface */ }
161
+ })
162
+ ```
163
+
164
+ **Surprises (verified on real hardware, Android 12 + 14):**
165
+ - `com.cometchat.chat.models.User` does **NOT** expose `authToken` on Android — don't try `user.authToken`. Use the `(uid, apiKey)` overload for dev or fetch the auth token from your backend for production.
166
+ - The Calls SDK callback returns `com.cometchat.calls.model.CallUser`, NOT `com.cometchat.chat.models.User`. Importing the wrong type gives "Type mismatch" at compile time.
167
+ - The Calls SDK does NOT persist login across launches like the Chat SDK does. Re-login on every cold start where `CometChat.getLoggedInUser()` returns a non-null user.
168
+
169
+ ### 1.1 Dual-SDK contract — same shape, simpler imports
170
+
171
+ V6 still routes ringing through Chat SDK (`CometChat.initiateCall`) and the WebRTC session through the Calls SDK — but both are accessed via the unified V6 facade. The two-`Call`-classes problem from V5 still exists internally; the V6 components hide it but custom code that imports `com.cometchat.chat.core.Call` directly must still pick the right one.
172
+
173
+ ```kotlin
174
+ // ⚠️ DO NOT USE — broken at chatuikit-compose:6.0.0 (see W4 above).
175
+ // Captures first-rendered user globally; every row dials the same person.
176
+ // CometChatCallButtons(user = user, group = null)
177
+
178
+ // ✓ RIGHT — wire your own button + use the kit's outgoing-call Activity directly.
179
+ // See §"Five required workarounds" W4 for the full pattern.
180
+ IconButton(onClick = {
181
+ val call = Call(user.uid, RECEIVER_TYPE_USER, CALL_TYPE_VIDEO) // see W5 — arg order
182
+ CometChat.initiateCall(call, object : CometChat.CallbackListener<Call>() {
183
+ override fun onSuccess(c: Call) {
184
+ CometChatCallActivity.Companion.launchOutgoingCallScreen(context, c, null)
185
+ }
186
+ override fun onError(e: CometChatException) { /* surface */ }
187
+ })
188
+ }) { Text("📹") }
189
+ ```
190
+
191
+ ### 1.2 VoIP push — same architecture, ConnectionService + FCM
192
+
193
+ Identical to V5 (rule 1.2 in `cometchat-android-v5-calls`). The V6 UIKit doesn't ship its own ConnectionService — you write one. Reference implementation in `cometchat-android-v5-calls/references/voip-calling.md` works unchanged for V6 (the FCM payload shape and ConnectionService API are platform-level, not SDK-version-specific).
194
+
195
+ ### 1.3 Build prerequisite — annotations-java5 duplicate-class conflict
196
+
197
+ **⚠️ Mandatory exclude.** A transitive dep of `chatuikit-compose-android:6.0.+` pulls in the legacy `org.jetbrains:annotations-java5:17.0.0`, which conflicts with the modern `org.jetbrains:annotations:23.0.0` brought in by Kotlin 2.0+. AGP fails the build with dozens of `Duplicate class org.jetbrains.annotations.*` lines. Add to `app/build.gradle.kts`:
198
+
199
+ ```kotlin
200
+ configurations.all {
201
+ exclude(group = "org.jetbrains", module = "annotations-java5")
202
+ }
203
+ ```
204
+
205
+ The exclude must be on `configurations.all` (not on a specific configuration) because the legacy artifact leaks into runtime, compile, and androidTest classpaths.
206
+
207
+ ### 1.4 Foreground service type — UIKit-managed in V6
208
+
209
+ V6 ships its own `CometChatOngoingCallService` registered automatically via the kit's manifest merge. You still must declare the Android 14+ `FOREGROUND_SERVICE_PHONE_CALL` / `FOREGROUND_SERVICE_MICROPHONE` / `FOREGROUND_SERVICE_CAMERA` permissions in your app's manifest — manifest merge does NOT pull permissions across module boundaries.
210
+
211
+ ```xml
212
+ <!-- AndroidManifest.xml — required even though the service is kit-provided -->
213
+ <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
214
+ <uses-permission android:name="android.permission.FOREGROUND_SERVICE_PHONE_CALL" />
215
+ <uses-permission android:name="android.permission.FOREGROUND_SERVICE_MICROPHONE" />
216
+ <uses-permission android:name="android.permission.FOREGROUND_SERVICE_CAMERA" />
217
+ ```
218
+
219
+ ### 1.5 Server-minted auth tokens
220
+
221
+ Unchanged from V5 / chat dispatcher — see `cometchat-android-v6-production` for the token-endpoint pattern.
222
+
223
+ ### 1.6 Hangup cleanup — V6 components handle it
224
+
225
+ The V6 `CometChatOngoingCall` composable / Kotlin View handles the camera-light / mic-release cleanup via its own `DisposableEffect` (Compose) or `onDetachedFromWindow` (Views). Custom OngoingCall surfaces (Section 5) must replicate this — the hard rule still applies, just the canonical implementation is in the kit.
226
+
227
+ ### 1.7 Permissions with rationale
228
+
229
+ Same set as V5, plus V6's `minSdk = 28` floor means `POST_NOTIFICATIONS` runtime prompt (Android 13+) is always required. The V6 kit ships a `CallPermissionsHandler` that runs the standard request flow with rationale strings.
230
+
231
+ ### 1.8 IncomingCall mounted at app root
232
+
233
+ V6 exposes `CometChatIncomingCall` as a top-level composable / View. In standalone mode, mount it inside `setContent { ... }` at the root of your `MainActivity`, OUTSIDE the navigation graph, so it survives screen transitions.
234
+
235
+ ```kotlin
236
+ // MainActivity.kt — Compose, standalone mode
237
+ class MainActivity : ComponentActivity() {
238
+ override fun onCreate(savedInstanceState: Bundle?) {
239
+ super.onCreate(savedInstanceState)
240
+ setContent {
241
+ CometChatTheme {
242
+ Box(modifier = Modifier.fillMaxSize()) {
243
+ AppNavigation() // Your nav graph (calls or otherwise)
244
+ CometChatIncomingCall(modifier = Modifier.fillMaxSize()) // overlays everything
245
+ }
246
+ }
247
+ }
248
+ }
249
+ }
250
+ ```
251
+
252
+ In Kotlin Views, the equivalent is a top-level `FrameLayout` in the Activity's layout XML containing both the host `<fragment>` and `<com.cometchat.chatuikit.calling.CometChatIncomingCall>`.
253
+
254
+ ---
255
+
256
+ ## 2. Setup — the V6 difference
257
+
258
+ V6 has no separate calls module. If `chatuikit-{compose,kotlin}-android` is already in `app/build.gradle.kts` from `cometchat-android-v6-core`, calls are already on the classpath. The skill only:
259
+
260
+ 1. Adds calling configuration to `UIKitSettings`:
261
+ ```kotlin
262
+ val settings = UIKitSettings.Builder()
263
+ .setAppId(BuildConfig.COMETCHAT_APP_ID)
264
+ .setRegion(BuildConfig.COMETCHAT_REGION)
265
+ .setAuthKey(BuildConfig.COMETCHAT_AUTH_KEY)
266
+ .subscribePresenceForAllUsers()
267
+ .enableCalling() // ← v6 flips calling on here
268
+ .build()
269
+ ```
270
+ 2. Ensures the four FOREGROUND_SERVICE permissions and the four call permissions are in `AndroidManifest.xml`.
271
+ 3. Adds the V6 Kotlin Views theme parent rule from `cometchat-android-v6-troubleshooting`: Activity themes hosting V6 Views must inherit from `CometChatTheme.DayNight` (V6 components extend `MaterialCardView` and reference kit-specific theme attrs that aren't in `Theme.AppCompat.*` or `Theme.MaterialComponents.*`). Compose surfaces are immune.
272
+
273
+ Detailed V6 init order: `cometchat-android-v6-core`. UIKitSettings option-by-option: `cometchat-android-v6-builder-settings`.
274
+
275
+ ---
276
+
277
+ ## 3. Components — Compose vs Kotlin Views
278
+
279
+ Both surfaces ship the same five call components with the same parameter names. Surface determines which import you use.
280
+
281
+ ### Compose (`com.cometchat.chatuikit.calling.compose.*`)
282
+
283
+ | Composable | Purpose |
284
+ |---|---|
285
+ | `CometChatCallButtons(user, group)` | Voice + video buttons — typically in a top-bar trailing slot or contact card |
286
+ | `CometChatIncomingCall(modifier)` | Root-mounted overlay; renders nothing when no call active |
287
+ | `CometChatOutgoingCall(call, user, group)` | Pushed when local user initiates; auto-dismisses on accept/reject |
288
+ | `CometChatOngoingCall(callSettingsBuilder, sessionId)` | WebRTC view — handles camera/mic/end controls |
289
+ | `CometChatCallLogs(onItemClick)` | Paginated history; integrates with Compose Navigation |
290
+
291
+ ### Kotlin Views (`com.cometchat.chatuikit.calling.views.*`)
292
+
293
+ Same names, different package. Inflate via XML or programmatically:
294
+
295
+ ```xml
296
+ <com.cometchat.chatuikit.calling.views.CometChatCallButtons
297
+ android:id="@+id/callButtons"
298
+ android:layout_width="wrap_content"
299
+ android:layout_height="wrap_content" />
300
+ ```
301
+
302
+ Then in code: `binding.callButtons.setUser(user)`.
303
+
304
+ Full component-by-component catalogs live in the existing `cometchat-android-v6-compose-components` and `cometchat-android-v6-kotlin-components` skills — read whichever matches the project's surface.
305
+
306
+ ---
307
+
308
+ ## 4. Standalone integration
309
+
310
+ When `product === "voice-video"` and there is no V6 chat integration yet.
311
+
312
+ **Split by calling mode:**
313
+
314
+ ### 4a. Standalone — Session mode (meeting-room UX, no ringing)
315
+
316
+ Calls SDK ONLY. NO chatuikit-android, NO ConnectionService, NO FCM-for-VoIP. Same SDK as V5 (`com.cometchat.calls-sdk-android`). Scaffold:
317
+
318
+ 1. **`Application` class** — `CometChatCalls.init(...)` ONLY. No chatuikit, no Chat SDK init.
319
+ 2. **`MainActivity` (Compose)** — `setContent` with `NavHost` for `/`, `/meet/{sessionId}`.
320
+ 3. **`CallRoom` composable** — `AndroidView` factory wrapping `RelativeLayout` (remember-stable), `LaunchedEffect(sessionId)` fires `CometChatCalls.joinSession(sessionId, settings, container, CallbackListener)`, `DisposableEffect` cleanup. See `references/call-session.md`.
321
+ 4. **`AndroidManifest.xml`** — Camera + microphone permissions + `FOREGROUND_SERVICE_MICROPHONE/CAMERA` + `CometChatOngoingCallService` registration. NO ConnectionService.
322
+ 5. **App Links** — `https://yourapp.com/meet/<sessionId>` deep-link routing.
323
+
324
+ **Why no chatuikit / no ConnectionService:** session mode never touches kit components or push. The W1–W5 V6 workarounds (which are for chatuikit's broken integration with the Calls SDK) DO NOT apply to standalone session-only — they're only relevant when the V6 kit is loaded.
325
+
326
+ ### 4b. Standalone — Ringing mode (kit-driven with W1–W5 workarounds)
327
+
328
+ Dual-SDK + telecom + push + V6 chatuikit:
329
+
330
+ - **Compose path:** A `MainActivity` with `setContent` that holds: nav graph (with `/profile`, `/calls`, `/ongoing-call/{sessionId}` routes), `CometChatIncomingCall` overlay (rule 1.7), top-level theme with `CometChatTheme`. Profile screen has `CometChatCallButtons` next to the user's name.
331
+ - **Kotlin Views path:** `MainActivity` extending `AppCompatActivity` with theme `CometChatTheme.DayNight`, a `FragmentContainerView` for nav + a sibling `CometChatIncomingCall` view in the same `FrameLayout`. Profile fragment hosts `CometChatCallButtons`.
332
+ - VoIP push: ConnectionService + FCM (rule 1.2 — implementation copied from V5 references/voip-calling.md, unchanged on V6).
333
+ - Manifest permissions, foreground service permissions, ProGuard rules (`-keep class com.cometchat.** { *; }`).
334
+ - **W1–W5 workarounds apply** (see "Five required workarounds" above).
335
+
336
+ ## 5. Additive integration
337
+
338
+ When chat is already integrated via V6. The skill:
339
+
340
+ - Adds `.enableCalling()` to the existing `UIKitSettings.Builder()` chain.
341
+ - Adds the four `FOREGROUND_SERVICE_*` permissions to manifest.
342
+ - Mounts `CometChatIncomingCall` at the root of the existing Activity (Compose: in `setContent`; Views: in the root layout XML).
343
+ - Wires call buttons inline — `CometChatMessageHeader` (V6) already renders them; the kit calls `initiateCall` automatically when calling is enabled.
344
+ - VoIP push: opt-in (asks user).
345
+
346
+ ## 6. Anti-patterns
347
+
348
+ 1. **Treating V6 calls as a separate module.** No `com.cometchat:calls-sdk-android` dependency on V6 — adding it pulls a V5 module that conflicts at runtime. The setup is just `.enableCalling()`.
349
+ 2. **Mounting `CometChatIncomingCall` inside the navigation graph.** Disappears on navigation events. Mount at root (rule 1.7).
350
+ 3. **Activity theme not inheriting `CometChatTheme.DayNight` for V6 Kotlin Views.** Calls components extend `MaterialCardView` and crash with `Failed to resolve attribute at index N` if hosted in `Theme.AppCompat.*`. Compose surfaces are not affected. Already documented in `cometchat-android-v6-troubleshooting`; surfaced here because calls components are the canary that exposes the bug.
351
+ 4. **Skipping the four `FOREGROUND_SERVICE_*` permissions** because the kit "already" registers the service. Manifest merge does not pull permissions — your app must declare them.
352
+ 5. **Mixing V5 and V6 call types.** The V5 `SessionType.VOICE` and the V6 `CallType.AUDIO` are not interchangeable enums. If you import from `com.cometchat.calls.types.SessionType`, you're pulling V5; V6 uses `CallType` from the unified UIKit package.
353
+
354
+ ## 7. Verification checklist
355
+
356
+ - [ ] `chatuikit-compose-android` OR `chatuikit-kotlin-android` (NOT both) in `app/build.gradle.kts` — V6 picks one surface
357
+ - [ ] `.enableCalling()` on `UIKitSettings.Builder()`
358
+ - [ ] Activity theme is `CometChatTheme.DayNight` (Kotlin Views only)
359
+ - [ ] All four `FOREGROUND_SERVICE_*` permissions in `AndroidManifest.xml`
360
+ - [ ] All four call permissions (RECORD_AUDIO / CAMERA / POST_NOTIFICATIONS / MANAGE_OWN_CALLS)
361
+ - [ ] `CometChatIncomingCall` mounted at root (Compose: outside nav graph; Views: top-level FrameLayout)
362
+ - [ ] **Standalone only:** ConnectionService + FCM service registered
363
+ - [ ] **Standalone only:** PhoneAccount registered in `Application.onCreate`
364
+ - [ ] Real device: outgoing call → audio + video two-way
365
+ - [ ] Real device: incoming call rings on lock screen
366
+ - [ ] Hangup releases camera + mic within 2 seconds
367
+ - [ ] On Android 14+: ongoing-call notification visible, swipe-up doesn't kill the call
368
+
369
+ ## 8. Pointers
370
+
371
+ - `cometchat-android-v5-calls/references/` — VoIP push, foreground service, ConnectionService, FCM payload shape — all unchanged on V6
372
+ - `cometchat-android-v6-builder-settings` — every UIKitSettings option including calling block details
373
+ - `cometchat-android-v6-{compose,kotlin}-components` — full surface-specific component catalogs
374
+ - `cometchat-android-v6-production` — token endpoints, ProGuard rules
375
+ - `cometchat-android-v6-troubleshooting` — V6 Kotlin Views theme parent crash diagnostic
@@ -0,0 +1,97 @@
1
+ # Adding calls to an existing chat integration (Android V6 / Compose)
2
+
3
+ V6 calls are **bundled** into `chatuikit-{compose,kotlin}-android:6.x` — there's no separate calls SDK to install. To turn calls on, call `.enableCalling()` on your UIKit settings.
4
+
5
+ **Read first:** `cometchat-android-v6-calls/SKILL.md` — V6 architecture.
6
+
7
+ ---
8
+
9
+ ## Step 1 — Verify chat-uikit cohort
10
+
11
+ ```kotlin
12
+ // app/build.gradle.kts
13
+ dependencies {
14
+ implementation("com.cometchat:chatuikit-compose-android:6.+")
15
+ // (or chatuikit-kotlin-android for Views)
16
+ }
17
+ ```
18
+
19
+ If you're on `chatuikit-android` v5 or `calls-sdk-android` separately, this is the wrong family — see `cometchat-android-v5-calls/references/add-calls-to-existing-chat.md`.
20
+
21
+ ---
22
+
23
+ ## Step 2 — Enable calling on UIKit
24
+
25
+ Find your existing UIKit init (typically in `Application.onCreate` or `MainActivity.onCreate`):
26
+
27
+ ```kotlin
28
+ val uikitSettings = UIKitSettings.Builder()
29
+ .setAppId(APP_ID)
30
+ .setRegion(REGION)
31
+ .setAuthKey(AUTH_KEY) // OR .subscribePresenceForAllUsers() etc.
32
+ .enableCalling() // NEW — adds calls
33
+ .build()
34
+
35
+ CometChatUIKit.init(this, uikitSettings, /* callback */)
36
+ ```
37
+
38
+ That's the entire migration for V6. The bundled calls SDK initializes when chat init succeeds.
39
+
40
+ ---
41
+
42
+ ## Step 3 — Permissions + manifest
43
+
44
+ Same as V5 (see V5 sister doc). V6 doesn't change permission requirements.
45
+
46
+ ---
47
+
48
+ ## Step 4 — Mount CometChatIncomingCall
49
+
50
+ In Compose:
51
+
52
+ ```kotlin
53
+ @Composable
54
+ fun AppRoot() {
55
+ Box(modifier = Modifier.fillMaxSize()) {
56
+ AppContent()
57
+ CometChatIncomingCall() // overlay on top — handles incoming call UI
58
+ }
59
+ }
60
+ ```
61
+
62
+ In Views (Kotlin XML):
63
+
64
+ ```xml
65
+ <!-- activity_main.xml -->
66
+ <FrameLayout ...>
67
+ <fragment android:id="@+id/main_content" .../>
68
+ <com.cometchat.chatuikit.calls.incomingcall.CometChatIncomingCall
69
+ android:layout_width="match_parent"
70
+ android:layout_height="match_parent"/>
71
+ </FrameLayout>
72
+ ```
73
+
74
+ ---
75
+
76
+ ## Step 5 — FCM VoIP push
77
+
78
+ Same as V5 (see `cometchat-android-v5-calls/references/server-fcm-voip.md`). V6 adds a Compose-friendly `IncomingCallActivity` pattern — see `cometchat-android-v6-calls/references/server-fcm-voip.md`.
79
+
80
+ ---
81
+
82
+ ## Verification checklist
83
+
84
+ - [ ] `chatuikit-compose-android:6.+` (or `chatuikit-kotlin-android:6.+`) in app deps
85
+ - [ ] `.enableCalling()` chained into UIKitSettings.Builder
86
+ - [ ] Manifest permissions same as V5
87
+ - [ ] `CometChatIncomingCall` mounted (Compose overlay or Views FrameLayout)
88
+ - [ ] FCM token registration wired
89
+ - [ ] Run `cometchat verify --calls` — `v6_enable_calling` should pass
90
+
91
+ ---
92
+
93
+ ## Pointers
94
+
95
+ - `cometchat-android-v5-calls/references/add-calls-to-existing-chat.md` — V5 sister (separate calls SDK)
96
+ - `cometchat-android-v6-calls/SKILL.md`
97
+ - `cometchat-android-v6-calls/references/server-fcm-voip.md` — Compose-flavored server FCM
@@ -0,0 +1,91 @@
1
+ # Call layouts on Android V6 (Compose)
2
+
3
+ Same SDK API as V5; V6 adds Compose-native `SegmentedButton` for the switcher.
4
+
5
+ **Canonical docs:** https://www.cometchat.com/docs/calls/android/call-layouts
6
+ **Read first:** `cometchat-android-v5-calls/references/call-layouts.md` — full Java/Kotlin SDK API.
7
+
8
+ ---
9
+
10
+ ## ViewModel
11
+
12
+ ```kotlin
13
+ class CallLayoutViewModel : ViewModel() {
14
+ private val _layout = MutableStateFlow(CometChatCallsConstants.LAYOUT_TILE)
15
+ val layout: StateFlow<String> = _layout
16
+
17
+ fun set(next: String) {
18
+ CometChatCalls.setLayout(next)
19
+ _layout.value = next
20
+ }
21
+
22
+ fun onSDKChanged(next: String) {
23
+ _layout.value = next // already updated by kit's switcher
24
+ }
25
+ }
26
+
27
+ // Wire from CometChatCallsEventsListener:
28
+ override fun onCallLayoutChanged(layout: String) {
29
+ Handler(Looper.getMainLooper()).post {
30
+ callLayoutViewModel.onSDKChanged(layout)
31
+ }
32
+ }
33
+ ```
34
+
35
+ ---
36
+
37
+ ## Compose switcher (SingleChoiceSegmentedButtonRow)
38
+
39
+ ```kotlin
40
+ @OptIn(ExperimentalMaterial3Api::class)
41
+ @Composable
42
+ fun LayoutSwitcher(viewModel: CallLayoutViewModel = viewModel()) {
43
+ val layout by viewModel.layout.collectAsStateWithLifecycle()
44
+
45
+ val options = listOf(
46
+ CometChatCallsConstants.LAYOUT_TILE to "Tile",
47
+ CometChatCallsConstants.LAYOUT_SIDEBAR to "Sidebar",
48
+ CometChatCallsConstants.LAYOUT_SPOTLIGHT to "Spotlight",
49
+ )
50
+
51
+ SingleChoiceSegmentedButtonRow {
52
+ options.forEachIndexed { index, (value, label) ->
53
+ SegmentedButton(
54
+ selected = layout == value,
55
+ onClick = { viewModel.set(value) },
56
+ shape = SegmentedButtonDefaults.itemShape(index = index, count = options.size),
57
+ ) {
58
+ Text(label)
59
+ }
60
+ }
61
+ }
62
+ }
63
+ ```
64
+
65
+ ---
66
+
67
+ ## Anti-patterns
68
+
69
+ V5 sister rules apply, plus Compose-specific:
70
+
71
+ 1. **`collectAsState()` instead of `collectAsStateWithLifecycle()`.** State updates while paused → wasted work.
72
+ 2. **`Row` of `OutlinedButton`s instead of `SegmentedButton`.** Visually similar but missing the radio-group accessibility semantics; TalkBack announces it as 3 separate buttons.
73
+ 3. **Calling `setLayout` directly from the composable.** Move it to ViewModel — survives config changes.
74
+
75
+ ---
76
+
77
+ ## Verification checklist
78
+
79
+ - [ ] `CallLayoutViewModel` exposes `StateFlow<String>`
80
+ - [ ] `SingleChoiceSegmentedButtonRow` wraps the layout options
81
+ - [ ] `collectAsStateWithLifecycle` (not `collectAsState`)
82
+ - [ ] `onCallLayoutChanged` syncs the ViewModel on main thread
83
+ - [ ] Real-device smoke: cycles all 3, survives rotation
84
+
85
+ ---
86
+
87
+ ## Pointers
88
+
89
+ - `cometchat-android-v5-calls/references/call-layouts.md` — V5 sister (Views patterns)
90
+ - `cometchat-android-v6-calls` SKILL.md
91
+ - Canonical docs: https://www.cometchat.com/docs/calls/android/call-layouts