@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
@@ -1,47 +1,78 @@
1
1
  ---
2
2
  name: cometchat-flutter-v6-calls
3
- description: >
4
- Use when implementing voice calls, video calls, or call UI with CometChat Flutter UIKit v6.
5
- Covers CometChatCallButtons, CometChatIncomingCall, CometChatOutgoingCall,
6
- CometChatOngoingCall, CometChatCallLogs, CometChatUIKitCalls, CallingConfiguration,
7
- CallButtonsBloc, IncomingCallBloc, OutgoingCallBloc, OngoingCallBloc, CallLogsBloc,
8
- CallEventService, CallOperationsServiceLocator, call_operations, call_settings,
9
- SessionSettingsBuilder, CallAppSettings, initiateCall, acceptCall, rejectCall,
10
- endSession, startSession, generateToken, CallNavigationContext,
11
- CometChatDisplayIncomingCallOverlay, native_call_kit,
12
- call permissions, audio call, video call, group call, call logs, call history,
13
- incoming call screen, outgoing call screen, ongoing call screen, call bubble,
14
- or "add calling to my app". Also use when seeing errors like
15
- "CallManager not found", "startSession null", "call token null",
16
- "session already started", or call-related crashes.
3
+ description: CometChat Calls integration for Flutter UIKit v6 (Bloc-based, beta). ⚠️ Partially working at v6.0.0-beta2 (2026-05-13) — chat + calls init OK, outgoing call API succeeds, but TWO vendor bugs block end-to-end calling: (1) MaterialApp MUST set `navigatorKey: CallNavigationContext.navigatorKey` or the outgoing-call screen never renders ("Context is not mounted for navigation" — undocumented hard requirement); (2) even with the navigatorKey wired, the outgoing-call screen does NOT transition to the in-call view when peer accepts — call goes to `ongoing` at server level but UI stays on "Calling…" indefinitely, no client-side workaround. Customers shipping calls on Flutter today must stay on V5 cohort (cometchat_calls_uikit ^5.0.+). Covers UIKitSettings calling block, CometChatUIKitCalls.init() after CometChatUIKit.init() (CALLS_INIT_AFTER_CHAT_INIT), the kit's Bloc-driven CometChatCallButtons / CometChatIncomingCall / CometChatOutgoingCall / CometChatOngoingCall / CometChatCallLogs / CometChatCallBubble widgets, CallingConfiguration, native_call_kit module (iOS CallKit + Android ConnectionService), CallOperationsServiceLocator lifecycle, FCM + PushKit VoIP push, and additive-vs-standalone modes.
17
4
  license: "MIT"
18
- compatibility: "cometchat_chat_uikit ^6.0.0-beta2"
19
- allowed-tools: "executeBash, readFile, readCode, fileSearch, listDirectory, grepSearch"
5
+ compatibility: "Flutter >= 2.5, Dart >= 3.0; cometchat_chat_uikit ^6.0.0-beta2 (calls bundled in); minSdk 26+ on Android; iOS 13+"
6
+ allowed-tools: "shell, file-read, file-search, file-list, ask-user"
20
7
  metadata:
21
8
  author: "CometChat"
22
- version: "3.0.0"
23
- tags: "cometchat flutter calls voice video calling incoming outgoing ongoing call-logs"
9
+ version: "4.0.0"
10
+ tags: "cometchat flutter v6 beta calls voice video webrtc bloc incoming outgoing ongoing call-logs callkit pushkit connectionservice fcm voip-push native-call-kit call-operations service-locator"
24
11
  ---
25
12
 
26
- # CometChat Flutter UIKit — Calls
13
+ ## Purpose
27
14
 
28
- Voice and video calling for 1:1 and group conversations. Call functionality is built into `cometchat_chat_uikit` no separate package needed.
15
+ Production-grade voice + video calling for Flutter UIKit v6 (beta, Bloc-based). Loaded by `cometchat-calls` when `framework === "flutter"` and `flutter_version === "v6"`. Operates in two modes:
29
16
 
30
- ## Import
17
+ - **Standalone** — calls is the product. Chat SDK + Calls SDK without the v6 UI Kit (rare today, since the UI Kit ships calling bundled). Custom call screens on the SDKs.
18
+ - **Additive** — calls layered onto an existing v6 chat integration. The v6 UI Kit ships call widgets in the same package (`cometchat_chat_uikit`) — no extra dependency. The skill enables calling on `UIKitSettings`, calls `CometChatUIKitCalls.init()` in the chat-init success callback, mounts the global incoming-call overlay at app root.
19
+
20
+ **Read these other skills first:**
21
+ - `cometchat-calls` — dispatcher (modes, hard rules, anti-patterns)
22
+ - `cometchat-flutter-v6-core` — UIKitSettings, init/login order (CHAT_INIT_BEFORE_CALLS_INIT is THE rule)
23
+ - `cometchat-flutter-v6-events` — Bloc event streams + listener registration
24
+
25
+ **V6 vs V5 difference (critical for migration):**
26
+ - V6 — single `cometchat_chat_uikit` package (calls bundled in)
27
+ - V5 — `cometchat_chat_uikit` + `cometchat_calls_uikit` (separate)
28
+ - V6 uses Bloc; V5 uses GetX
29
+ - V6 `CometChatUIKitCalls.init(appId, region)` must run AFTER `CometChatUIKit.init()` succeeds; V5 hides this via `CometChatCallingExtension`
30
+
31
+ **Ground truth:**
32
+ - SDK source — installed `cometchat_chat_uikit@6.0.0-beta2` artifacts under `~/.pub-cache/`
33
+ - Sample app — `~/Downloads/calls-sdk/calls-sdk-flutter-5/sample-apps/` (V5 sample; V6 sample app may not exist yet — verify before citing)
34
+ - Public docs — https://www.cometchat.com/docs/calls/flutter/overview (note: V6 docs may still reference V5 module split)
35
+
36
+ ---
37
+
38
+ ## 1. The seven hard rules — Flutter v6 specialization
39
+
40
+ ### 1.0 Calls SDK login is its own step (v5+)
41
+
42
+ Same as v5 cohort — the v5 Calls SDK has its own auth state, separate from the Chat SDK. After `CometChat.login` succeeds, you MUST also call `CometChatCalls.login` — without it, the FIRST calls API call throws **"auth token cannot be null"**.
43
+
44
+ V6's `CometChatUIKitCalls.init()` initializes the SDK but does not handle login. Login still needs to happen explicitly after the user signs in via `CometChatUIKit.login`:
31
45
 
32
46
  ```dart
33
- import 'package:cometchat_chat_uikit/cometchat_chat_uikit.dart';
34
- import 'package:cometchat_chat_uikit/cometchat_calls_uikit.dart';
47
+ import 'package:cometchat_sdk/cometchat_sdk.dart';
48
+ import 'package:cometchat_calls_sdk/cometchat_calls_sdk.dart';
49
+
50
+ // After CometChatUIKit.login resolves
51
+ CometChatCalls.login(
52
+ uid: uid,
53
+ authKey: AUTH_KEY,
54
+ onSuccess: (User? callUser) { /* both ready */ },
55
+ onError: (CometChatException e) { /* surface to user */ },
56
+ );
57
+
58
+ // Production:
59
+ CometChatCalls.loginWithAuthToken(
60
+ authToken: tokenFromBackend,
61
+ onSuccess: (User? user) { /* … */ },
62
+ onError: (CometChatException e) { /* … */ },
63
+ );
35
64
  ```
36
65
 
37
- The first import gives you chat components. The second gives you call-specific types.
66
+ **Surprises:**
67
+ - Chat SDK persists login via shared preferences. The **Calls SDK does NOT** — always check `CometChatCalls.getLoggedInUser()` on app start and re-login if it returns null.
68
+ - Even though V6 bundles the call UI into `CometChatUIKit`, the underlying Calls SDK login is still mandatory and separate.
38
69
 
39
- ## Rule: CALLS_INIT_AFTER_CHAT_INIT
70
+ ### 1.1 Dual-SDK contract — `CometChatUIKitCalls.init` after `CometChatUIKit.init`
40
71
 
41
- `CometChatUIKitCalls.init()` MUST be called after `CometChatUIKit.init()` completes. The calls SDK needs the chat SDK's auth context.
72
+ The V6 UI Kit unifies the two SDKs but `init` order is still load-bearing:
42
73
 
43
74
  ```dart
44
- // CORRECT — calls init after chat init
75
+ // RIGHT — calls init in chat init's onSuccess
45
76
  CometChatUIKit.init(
46
77
  uiKitSettings: settings,
47
78
  onSuccess: (_) {
@@ -51,141 +82,201 @@ CometChatUIKit.init(
51
82
  );
52
83
  },
53
84
  );
85
+ ```
54
86
 
55
- // ❌ WRONG — parallel init causes auth token null
56
- CometChatUIKit.init(uiKitSettings: settings);
57
- CometChatUIKitCalls.init(appId, region); // Race condition
87
+ ```dart
88
+ // ✗ WRONG — parallel init causes "auth token null" intermittently
89
+ CometChatUIKit.init(uiKitSettings: settings); // returns immediately
90
+ CometChatUIKitCalls.init(appId, region); // race — chat auth not ready yet
58
91
  ```
59
92
 
60
- ## Rule: SINGLE_CALLS_INIT
93
+ `CometChatUIKitCalls.init()` must be called **exactly once per app lifecycle**. Re-calling it after logout + re-login causes "session already started" errors.
61
94
 
62
- `CometChatUIKitCalls.init()` must be called exactly once per app lifecycle. Calling it again after logout + re-login can cause "session already started" errors.
95
+ After logout: the calls SDK session is invalidated; on next login, call `CometChatUIKitCalls.init()` again. Treat this as a "first run" of the calls subsystem.
63
96
 
64
- ## Rule: CALLS_REINIT_AFTER_LOGOUT
97
+ ### 1.2 VoIP push — `native_call_kit` module + FCM + PushKit bridge
65
98
 
66
- After `CometChatUIKit.logout()`, the calls SDK session is invalidated. On the next login, `CometChatUIKitCalls.init()` must be called again.
99
+ V6 ships a `native_call_kit` sub-module inside `cometchat_chat_uikit` that wraps CallKit (iOS) and ConnectionService (Android). The skill still wires:
67
100
 
68
- ## Architecture
101
+ - **`firebase_messaging`** — FCM data messages on Android
102
+ - **iOS PushKit** — same platform-channel bridge as v5 (Flutter has no first-party PushKit plugin)
103
+ - **`native_call_kit` API** — Dart-side handlers for incoming-call payloads → OS-level ring UI
69
104
 
70
- ```
71
- call_ui/src/
72
- ├── call_buttons/ # Voice/video call buttons (CallButtonsBloc)
73
- ├── incoming_call/ # Incoming call screen (IncomingCallBloc)
74
- ├── outgoing_call/ # Outgoing call screen (OutgoingCallBloc)
75
- ├── ongoing_call/ # Active call screen — WebRTC (OngoingCallBloc)
76
- ├── call_logs/ # Call history list (CallLogsBloc + Clean Arch)
77
- ├── call_operations/ # Shared clean architecture (DI, use cases, repos)
78
- ├── call_bubble/ # Call message bubble in chat
79
- ├── call_settings/ # CometChatUIKitCalls, CallNavigationContext
80
- ├── native_call_kit/ # iOS CallKit / Android ConnectionService
81
- ├── utils/ # CallUtils, CallStateService, CallPermissions
82
- ├── call_event_service.dart # Centralized call event handling
83
- └── calling_configuration.dart # Top-level config object
105
+ In additive mode, opt-in. In standalone, mandatory.
106
+
107
+ ### 1.3 Foreground service same Android 14+ rules
108
+
109
+ **⚠️ Android build prerequisite Jetifier is mandatory.** One of the `cometchat_calls_uikit` transitive deps still pulls in the legacy `com.android.support:support-compat:26.1.0` AAR in V6. Without Jetifier, AGP fails with `Duplicate class android.support.v4.*` errors. Set in `android/gradle.properties`:
110
+
111
+ ```properties
112
+ android.useAndroidX=true
113
+ android.enableJetifier=true
84
114
  ```
85
115
 
86
- ## Components
116
+ Flutter 3.x scaffolds omit `enableJetifier=true` by default — the build fails on first `flutter build apk` if you skip this.
87
117
 
88
- ### CometChatCallButtons
118
+ Same as native Android / Flutter v5. The four FOREGROUND_SERVICE_* permissions plus MANAGE_OWN_CALLS / BIND_TELECOM_CONNECTION_SERVICE in `android/app/src/main/AndroidManifest.xml`. V6 raised Android `minSdk` to 26 (calls SDK in V6 raised the floor) — verify this is set in `android/app/build.gradle`.
89
119
 
90
- Voice and video call buttons. Typically placed in `CometChatMessageHeader`'s trailing view or standalone.
120
+ ### 1.4 Server-minted auth tokens
121
+
122
+ `cometchat-flutter-v6-production` covers it. `CometChatUIKit.loginWithAuthToken(token)` for production, never `loginWithAuthKey(uid, authKey)`.
123
+
124
+ ### 1.5 Hangup cleanup — Calls + ServiceLocator + native call UI
91
125
 
92
126
  ```dart
93
- CometChatCallButtons(
94
- user: user, // For 1:1 calls
95
- group: group, // For group calls (meetings)
96
- hideVoiceCallButton: false,
97
- hideVideoCallButton: false,
98
- voiceCallIcon: Icon(Icons.call),
99
- videoCallIcon: Icon(Icons.videocam),
100
- callButtonsStyle: CometChatCallButtonsStyle(
101
- voiceCallIconColor: colorPalette.iconPrimary,
102
- videoCallIconColor: colorPalette.iconPrimary,
103
- ),
104
- outgoingCallConfiguration: CometChatOutgoingCallConfiguration(
105
- outgoingCallStyle: CometChatOutgoingCallStyle(...),
106
- ),
107
- )
127
+ Future<void> endCall(String sessionId) async {
128
+ await CometChatUIKitCalls.endSession(); // 1. end WebRTC + release tracks
129
+ await FlutterCallkitIncoming.endAllCalls(); // 2. clear OS-level ring UI
130
+ if (mounted) Navigator.of(context, rootNavigator: true).pop(); // 3. pop call screen
131
+ }
108
132
  ```
109
133
 
110
- Call buttons are built into `CometChatMessageHeader` by default:
134
+ After `CometChatUIKit.logout()`, also reset the calls service locator:
111
135
  ```dart
112
- CometChatMessageHeader(
113
- user: user,
114
- group: group,
115
- hideVoiceCallButton: false,
116
- hideVideoCallButton: false,
117
- )
136
+ CallOperationsServiceLocator.instance.reset();
118
137
  ```
119
138
 
120
- ### CometChatIncomingCall
139
+ The kit's call widgets handle the basic teardown automatically; custom WebRTC surfaces must replicate this.
121
140
 
122
- Displays when the logged-in user receives a call. Supports accept/decline with custom views.
141
+ ### 1.6 Permissions `permission_handler` + `CallPermissions`
142
+
143
+ V6 ships an internal `CallPermissions` helper that wraps the standard permission flow:
123
144
 
124
145
  ```dart
125
- CometChatIncomingCall(
126
- call: call, // Required the active Call object
127
- user: callerUser, // Caller info for display
128
- onAccept: (ctx, call) { },
129
- onDecline: (ctx, call) { },
130
- disableSoundForCalls: false,
131
- customSoundForCalls: 'assets/ringtone.mp3',
132
- incomingCallStyle: CometChatIncomingCallStyle(
133
- backgroundColor: colorPalette.background3,
134
- acceptButtonColor: colorPalette.success,
135
- declineButtonColor: colorPalette.error,
136
- ),
137
- // Custom view slots
138
- titleView: (ctx, call) => Text('Custom Title'),
139
- subTitleView: (ctx, call) => Text('Custom Subtitle'),
140
- leadingView: (ctx, call) => Icon(Icons.call),
141
- trailingView: (ctx, call) => CometChatAvatar(image: user.avatar),
142
- )
146
+ final granted = await CallPermissions.requestCallPermissions(callType: CallType.video);
147
+ if (!granted) { /* surface a clear UI message */ }
143
148
  ```
144
149
 
145
- ### CometChatOutgoingCall
150
+ Native config (Info.plist + AndroidManifest) is identical to V5 (rule 1.6 in `cometchat-flutter-v5-calls`).
151
+
152
+ ### 1.7 IncomingCall mounted at app root
146
153
 
147
- Displays when the logged-in user initiates a call.
154
+ V6 exposes the incoming-call overlay via `CometChatDisplayIncomingCallOverlay` mounted in `MaterialApp`'s `builder`:
148
155
 
149
156
  ```dart
150
- CometChatOutgoingCall(
151
- call: call,
152
- user: receiverUser,
153
- outgoingCallStyle: CometChatOutgoingCallStyle(
154
- backgroundColor: colorPalette.background1,
155
- ),
156
- )
157
+ MaterialApp(
158
+ navigatorKey: CallNavigationContext.navigatorKey, // ⚠️ REQUIRED — see warning below
159
+ builder: (context, child) {
160
+ return Stack(
161
+ children: [
162
+ child!,
163
+ const CometChatDisplayIncomingCallOverlay(),
164
+ ],
165
+ );
166
+ },
167
+ );
157
168
  ```
158
169
 
159
- ### CometChatOngoingCall
170
+ **⚠️ `navigatorKey: CallNavigationContext.navigatorKey` is REQUIRED on MaterialApp at v6.0.0-beta2.** The kit's `CometChatCallButtons` and outgoing-call flow navigate via `CallNavigationContext.navigatorKey.currentContext`. Without this line, `CometChat.initiateCall` succeeds but the outgoing-call screen never renders — kit logs `"Context is not mounted for navigation"` and silently drops the navigation. Symptom: user taps call button, peer rings, but the Flutter app shows nothing.
160
171
 
161
- The active call screen with WebRTC video/audio. Rendered after a call is accepted.
172
+ Import: `import 'package:cometchat_chat_uikit/cometchat_calls_uikit.dart' show CallNavigationContext;` (use `show` to avoid a name collision with kit-exported `IncomingCallOverlay`).
162
173
 
163
- ```dart
164
- CometChatOngoingCall(
165
- callSettingsBuilder: sessionSettingsBuilder,
166
- sessionId: call.sessionId,
167
- callWorkFlow: CallWorkFlow.directCalling,
168
- )
174
+ **⚠️ Outgoing → in-call screen transition is broken at v6.0.0-beta2.** When the peer accepts, the call's status moves to `ongoing` at the server level — but the kit's outgoing-call screen does NOT transition to the in-call view. Users see the "Calling…" ring spinner indefinitely while the call is actually live. Pressing the reject button fires `CometChat.rejectCall` which the server rejects with `"The call status cannot be updated from ongoing to cancelled"`. **No client-side workaround known** — vendor needs to fix the outgoing-call BLoC's `onOutgoingCallAccepted` handler to push the in-call route. Validated on 2026-05-13 against a Next.js web peer.
175
+
176
+ In standalone mode, `native_call_kit` owns the OS-level ring UI; the in-app overlay only fires when the app is foregrounded.
177
+
178
+ ---
179
+
180
+ ## 2. Setup
181
+
182
+ ```yaml
183
+ # pubspec.yaml
184
+ dependencies:
185
+ flutter:
186
+ sdk: flutter
187
+ cometchat_chat_uikit: ^6.0.0-beta2 # calls bundled in
188
+ permission_handler: ^11.0.0
189
+ flutter_callkit_incoming: ^2.0.0 # standalone — VoIP UI bridge
190
+ firebase_messaging: ^14.0.0 # standalone — Android FCM
191
+ firebase_core: ^2.0.0
169
192
  ```
170
193
 
171
- ### CometChatCallLogs
194
+ If pub.dev resolution lags, use the Cloudsmith hosted pin:
195
+ ```yaml
196
+ cometchat_chat_uikit:
197
+ hosted: https://dart.cloudsmith.io/cometchat/cometchat/
198
+ version: ^6.0.0-beta2
199
+ ```
172
200
 
173
- Scrollable list of call history. Clean Architecture + BLoC with `CallLogsServiceLocator`.
201
+ Init (additive mode):
174
202
 
175
203
  ```dart
176
- CometChatCallLogs(
177
- onItemClick: (callLog) { /* Navigate or initiate call */ },
178
- callLogsStyle: CallLogsStyle(backgroundColor: colorPalette.background1),
179
- )
204
+ import 'package:cometchat_chat_uikit/cometchat_chat_uikit.dart';
205
+ import 'package:cometchat_chat_uikit/cometchat_calls_uikit.dart';
206
+
207
+ void main() async {
208
+ WidgetsFlutterBinding.ensureInitialized();
209
+
210
+ final settings = (UIKitSettings.builder()
211
+ ..appId = CometChatConfig.appId
212
+ ..region = CometChatConfig.region
213
+ ..authKey = CometChatConfig.authKey
214
+ ..subscriptionType = CometChatSubscriptionType.allUsers)
215
+ .build();
216
+
217
+ CometChatUIKit.init(
218
+ uiKitSettings: settings,
219
+ onSuccess: (_) {
220
+ CometChatUIKitCalls.init(
221
+ CometChatConfig.appId,
222
+ CometChatConfig.region,
223
+ onSuccess: (_) => runApp(const MyApp()),
224
+ onError: (e) => runApp(MyErrorApp(e.message)),
225
+ );
226
+ },
227
+ onError: (e) => runApp(MyErrorApp(e.message)),
228
+ );
229
+ }
230
+ ```
231
+
232
+ The first import gives you chat components. The second gives you call-specific types.
233
+
234
+ ---
235
+
236
+ ## 3. Components catalog (V6 widgets — Bloc-driven)
237
+
238
+ Architecture (lives inside `cometchat_chat_uikit`):
239
+
240
+ ```
241
+ call_ui/src/
242
+ ├── call_buttons/ # CometChatCallButtons + CallButtonsBloc
243
+ ├── incoming_call/ # CometChatIncomingCall + IncomingCallBloc
244
+ ├── outgoing_call/ # CometChatOutgoingCall + OutgoingCallBloc
245
+ ├── ongoing_call/ # CometChatOngoingCall + OngoingCallBloc
246
+ ├── call_logs/ # CometChatCallLogs + CallLogsBloc + Clean Architecture
247
+ ├── call_operations/ # Shared DI / use cases / repositories (CallOperationsServiceLocator)
248
+ ├── call_bubble/ # CometChatCallBubble — call-event bubble in message list (auto-rendered)
249
+ ├── call_settings/ # CometChatUIKitCalls, CallNavigationContext
250
+ ├── native_call_kit/ # iOS CallKit / Android ConnectionService bridge
251
+ ├── utils/ # CallUtils, CallStateService, CallPermissions
252
+ ├── call_event_service.dart # Centralized call event handling
253
+ └── calling_configuration.dart # Top-level config object
180
254
  ```
181
255
 
182
- ### CometChatCallBubble
256
+ ### Component reference
183
257
 
184
- Message bubble for call events in the message list. Automatically rendered for call-type messages.
258
+ | Widget | Purpose | Notes |
259
+ |---|---|---|
260
+ | `CometChatCallButtons(user:, group:)` | Voice + video buttons | Mutually exclusive `user` / `group`. Use `group:` for group calls (meetings). |
261
+ | `CometChatIncomingCall(call:, user:, onAccept:, onDecline:)` | In-app foreground ring UI | `onAccept`/`onDecline` are `(BuildContext, Call) -> void`. Custom view slots: `titleView`, `subTitleView`, `leadingView`, `trailingView`. |
262
+ | `CometChatOutgoingCall(call:, user:, outgoingCallStyle:)` | Dialing UI | Auto-mounted when `initiateCall` is called via the kit. |
263
+ | `CometChatOngoingCall(callSettingsBuilder:, sessionId:, callWorkFlow:)` | Active call view | `callWorkFlow: CallWorkFlow.directCalling` or `CallWorkFlow.defaultCalling`. Set `resizeToAvoidBottomInset: false` on host Scaffold. |
264
+ | `CometChatCallLogs(onItemClick:, callLogsStyle:)` | Paginated history | Clean Architecture + BLoC; `CallLogsServiceLocator` is initialized automatically when the widget mounts. |
265
+ | `CometChatCallBubble` | Call-event message bubble | Auto-rendered for call-type messages in `CometChatMessageList`. |
185
266
 
186
- ## CallingConfiguration
267
+ ### `CometChatUIKitCalls` API
187
268
 
188
- Top-level configuration object bundling all call component configs:
269
+ | Method | Purpose |
270
+ |---|---|
271
+ | `CometChatUIKitCalls.init(appId, region)` | Initialize calls SDK (after chat init — rule 1.1) |
272
+ | `CometChatUIKitCalls.initiateCall(call)` | Start a call (Chat SDK initiate + Calls SDK preflight) |
273
+ | `CometChatUIKitCalls.acceptCall(sessionId)` | Accept incoming |
274
+ | `CometChatUIKitCalls.rejectCall(sessionId, status)` | Reject / cancel |
275
+ | `CometChatUIKitCalls.generateToken(sessionId)` | Mint session-scoped RTC token |
276
+ | `CometChatUIKitCalls.startSession(sessionId, settings)` | Start WebRTC |
277
+ | `CometChatUIKitCalls.endSession()` | End and cleanup |
278
+
279
+ ### `CallingConfiguration` — top-level config
189
280
 
190
281
  ```dart
191
282
  CallingConfiguration(
@@ -196,138 +287,112 @@ CallingConfiguration(
196
287
  )
197
288
  ```
198
289
 
199
- ## CometChatUIKitCalls API
290
+ Pass to `UIKitSettings.callingConfiguration` to apply globally without per-component plumbing.
200
291
 
201
- | Method | Purpose |
202
- |--------|---------|
203
- | `CometChatUIKitCalls.init(appId, region)` | Initialize calls SDK |
204
- | `CometChatUIKitCalls.initiateCall(call)` | Start a call |
205
- | `CometChatUIKitCalls.acceptCall(sessionId)` | Accept incoming call |
206
- | `CometChatUIKitCalls.rejectCall(sessionId, status)` | Reject/cancel call |
207
- | `CometChatUIKitCalls.generateToken(sessionId)` | Generate call token |
208
- | `CometChatUIKitCalls.startSession(sessionId, settings)` | Start WebRTC session |
209
- | `CometChatUIKitCalls.endSession()` | End active call session |
292
+ ### Bloc events (when interacting directly — UIKit widgets handle these for you)
210
293
 
211
- ## Call Flow 1:1 Direct Call
294
+ | Bloc | Events |
295
+ |---|---|
296
+ | `CallButtonsBloc` | `InitiateVoiceCall`, `InitiateVideoCall` |
297
+ | `IncomingCallBloc` | `AcceptCall`, `RejectCall` |
298
+ | `OutgoingCallBloc` | `CancelCall`, `CallAccepted(call)`, `CallRejected(call)` |
299
+ | `OngoingCallBloc` | `StartSession(sessionId, settings)`, `EndSession` |
300
+ | `CallLogsBloc` | `LoadCallLogs`, `LoadMoreCallLogs` |
212
301
 
213
- ```
214
- Caller Receiver
215
- |-- CometChatCallButtons tap ------->|
216
- |-- initiateCall(Call) ------------->|
217
- |-- CometChatOutgoingCall shown ---->|
218
- | |-- CometChatIncomingCall shown
219
- | |-- acceptCall(sessionId)
220
- |<-- onOutgoingCallAccepted ---------|
221
- |-- generateToken(sessionId) ------->|
222
- |-- startSession(token, settings) -->|
223
- |-- CometChatOngoingCall shown ----->|-- CometChatOngoingCall shown
224
- |-- endSession() ------------------>|-- endSession()
225
- ```
302
+ `CallOperationsServiceLocator` must be initialized before using call BLoCs directly — UIKit widgets handle this automatically. After logout, call `CallOperationsServiceLocator.instance.reset()` to clean up.
226
303
 
227
- ## Golden Path — Messages Screen with Calls
304
+ ---
228
305
 
229
- ```dart
230
- Scaffold(
231
- resizeToAvoidBottomInset: false,
232
- appBar: CometChatMessageHeader(
233
- user: user,
234
- group: group,
235
- onBack: () => Navigator.pop(context),
236
- hideVoiceCallButton: false,
237
- hideVideoCallButton: false,
238
- ),
239
- body: Column(
240
- children: [
241
- Expanded(child: CometChatMessageList(user: user, group: group)),
242
- CometChatMessageComposer(user: user, group: group),
243
- ],
244
- ),
245
- )
246
- ```
306
+ ## 4. Standalone integration
247
307
 
248
- ## BLoC Events
249
-
250
- ### CallButtonsBloc
251
- | Event | Purpose |
252
- |-------|---------|
253
- | `InitiateVoiceCall` | Start audio call |
254
- | `InitiateVideoCall` | Start video call |
255
-
256
- ### IncomingCallBloc
257
- | Event | Purpose |
258
- |-------|---------|
259
- | `AcceptCall` | Accept the incoming call |
260
- | `RejectCall` | Decline the incoming call |
261
-
262
- ### OutgoingCallBloc
263
- | Event | Purpose |
264
- |-------|---------|
265
- | `CancelCall` | Cancel the outgoing call |
266
- | `CallAccepted(call)` | Receiver accepted |
267
- | `CallRejected(call)` | Receiver rejected |
268
-
269
- ### OngoingCallBloc
270
- | Event | Purpose |
271
- |-------|---------|
272
- | `StartSession(sessionId, settings)` | Begin WebRTC session |
273
- | `EndSession` | End the call |
274
-
275
- ### CallLogsBloc
276
- | Event | Purpose |
277
- |-------|---------|
278
- | `LoadCallLogs` | Initial load |
279
- | `LoadMoreCallLogs` | Pagination |
280
-
281
- ## Gotchas
282
-
283
- - `CometChatUIKitCalls.init()` must happen AFTER `CometChatUIKit.init()` — parallel init causes "auth token null".
284
- - After logout, the calls SDK session is invalidated. Re-init required on next login.
285
- - `startSession` on Android can return `null` with a 5-second timeout and no error feedback. Known platform issue.
286
- - `SessionType.audio` is ignored on Android in some SDK versions — always opens with video. Known external SDK bug.
287
- - Group calls use `CometChat.Group` not `CometChat.User` on `CometChatCallButtons`.
288
- - Incoming call handling must be global (mounted at app root level) so calls ring on every screen.
289
- - `CallOperationsServiceLocator` must be initialized before using call BLoCs directly. UIKit widgets handle this automatically.
290
- - After logout, call `CallOperationsServiceLocator.instance.reset()` to clean up.
291
- - On iOS, CallKit integration via `native_call_kit` shows the native call UI. Ensure `Info.plist` has the `voip` background mode.
292
- - On Android, the ongoing call foreground service shows a notification during active calls. Launched automatically by `startSession`.
293
-
294
- ## Anti-Patterns
308
+ When `product === "voice-video"` and there is no v6 chat integration.
295
309
 
296
- ```dart
297
- // ❌ WRONG — init calls SDK before chat SDK
298
- CometChatUIKitCalls.init(appId, region);
299
- CometChatUIKit.init(uiKitSettings: settings);
310
+ **Split by calling mode:**
300
311
 
301
- // CORRECTcalls init in chat init's onSuccess
302
- CometChatUIKit.init(
303
- uiKitSettings: settings,
304
- onSuccess: (_) {
305
- CometChatUIKitCalls.init(appId, region);
306
- },
307
- );
308
- ```
312
+ ### 4a. StandaloneSession mode (meeting-room UX, no ringing)
309
313
 
310
- ```dart
311
- // ❌ WRONG — not handling incoming calls globally
312
- CometChatIncomingCall(call: call, user: user) // Only on messages screen
314
+ Calls SDK ONLY. NO Chat SDK, NO UIKit. Same SDK as v5 (`cometchat_calls_sdk`). Scaffold:
313
315
 
314
- // CORRECT mount incoming call overlay at app root
315
- MaterialApp(
316
- builder: (context, child) {
317
- return Stack(children: [child!, /* Global incoming call listener */]);
318
- },
319
- )
320
- ```
316
+ 1. **`pubspec.yaml`**`cometchat_calls_sdk: ^5.0.0` + `flutter_bloc` + `equatable` + `permission_handler` ONLY.
317
+ 2. **`lib/main.dart`** — `CometChatCalls.init(appId, region, authKey)`. Permission requests. NO Chat SDK init.
318
+ 3. **`lib/cubits/call_session_cubit.dart`** — Cubit implements `SessionStatusListeners`. `CometChatCalls.joinSession(sessionId:, sessionSettings: SessionSettingsBuilder().build(), onSuccess:, onError:)`. Renders the returned `Widget?` via `SizedBox.expand`. See `references/call-session.md`.
319
+ 4. **`lib/screens/call_room.dart`** `BlocConsumer` for auto-pop on idle transition.
320
+ 5. **Native config** — Camera + microphone permissions only.
321
+
322
+ **Why no Chat SDK / no UIKit:** session mode never touches a Chat SDK call entity. No ringing, no UIKit incoming-call overlay needed.
323
+
324
+ ### 4b. Standalone — Ringing mode (kit overlay + CallKit + FCM)
325
+
326
+ Dual-SDK + UIKit. Scaffold:
327
+
328
+ 1. **`lib/main.dart`** — Chat SDK + Calls SDK init (no UIKit), permission requests, `flutter_callkit_incoming` + Firebase setup.
329
+ 2. **`lib/services/voip_service.dart`** — FCM + PushKit + `native_call_kit` bridge.
330
+ 3. **`lib/widgets/call_button.dart`** — Voice + video buttons next to a contact.
331
+ 4. **`lib/screens/ongoing_call_screen.dart`** — `CometChatCalls.joinSession(sessionId:, sessionSettings:, onSuccess:, onError:)` with Widget rendered via `SizedBox.expand`. Cubit-driven state.
332
+ 5. **`lib/screens/call_logs_screen.dart`** — `/calls` route.
333
+ 6. **`MaterialApp.builder`** — `CometChatDisplayIncomingCallOverlay` for foreground rings (rule 1.7).
334
+ 7. **Native config** — same as V5 standalone (Info.plist + AndroidManifest + Firebase config files).
321
335
 
322
- ## Checklist
336
+ ## 5. Additive integration
323
337
 
324
- - [ ] `CometChatUIKitCalls.init()` called after `CometChatUIKit.init()` completes
325
- - [ ] Incoming call handling is global (app root level), not per-screen
326
- - [ ] Camera + microphone permissions handled (automatic via `CallPermissions`)
327
- - [ ] `resizeToAvoidBottomInset: false` on any Scaffold with call UI
328
- - [ ] Call buttons visible in `CometChatMessageHeader` (default) or standalone
329
- - [ ] After logout, calls SDK re-initialized on next login
330
- - [ ] Android: `minSdk = 26`, ProGuard rules for `com.cometchat.**`
331
- - [ ] iOS: `voip` background mode in `Info.plist` for CallKit
338
+ When chat is already integrated. The skill:
339
+
340
+ 1. Confirms `cometchat_chat_uikit` is on `^6.0.0-beta2` calls are already bundled.
341
+ 2. Patches the `CometChatUIKit.init` call to add `CometChatUIKitCalls.init` in the success callback (rule 1.1).
342
+ 3. Adds `CometChatDisplayIncomingCallOverlay` to `MaterialApp.builder` (rule 1.7).
343
+ 4. Confirms `CometChatMessageHeader` shows call buttons by default (`hideVoiceCallButton: false`, `hideVideoCallButton: false`).
344
+ 5. Optionally adds `CometChatCallLogs` as a tab/screen.
345
+ 6. VoIP push: opt-in.
346
+
347
+ ## 6. Anti-patterns
348
+
349
+ 1. **Init Calls SDK before Chat SDK.** Auth-token race; `CometChatUIKitCalls.init` must run inside `CometChatUIKit.init`'s `onSuccess`. Rule 1.1.
350
+ 2. **Calling `CometChatUIKitCalls.init` more than once per app lifecycle.** Causes "session already started". After logout-relogin, this is the first run again — but in a single session, do it exactly once.
351
+ 3. **Per-screen incoming-call handling.** `CometChatIncomingCall(call: c, user: u)` mounted on the messages screen only fires there. Mount the overlay at app root via `MaterialApp.builder` (rule 1.7).
352
+ 4. **Forgetting `resizeToAvoidBottomInset: false`** on Scaffolds with call UI — keyboard show breaks WebRTC layout.
353
+ 5. **Group calls with `user:` instead of `group:`** on `CometChatCallButtons`. Group calls require `group:`; the widget silently mismatches if both are passed.
354
+ 6. **Caching the theme in `build()`** instead of `didChangeDependencies()`. Listed in V6 components catalog as a perf rule but applies to every call surface.
355
+ 7. **Skipping `CallOperationsServiceLocator.instance.reset()` after logout.** Stale singletons leak across user sessions; calls subsystem behaves erratically on next login.
356
+ 8. **Mixing V5 and V6 widget imports.** V5's `cometchat_calls_uikit` namespace and V6's `cometchat_chat_uikit/cometchat_calls_uikit.dart` barrel re-export different classes with the same name. Pick a cohort and stay there.
357
+
358
+ ## 7. Verification checklist
359
+
360
+ **Static:**
361
+
362
+ - [ ] `cometchat_chat_uikit ^6.0.0-beta2` in pubspec.yaml (V6 bundles calls — no separate calls package)
363
+ - [ ] `CometChatUIKitCalls.init` called inside `CometChatUIKit.init`'s `onSuccess` (rule 1.1)
364
+ - [ ] `CometChatUIKitCalls.init` called exactly once per app lifecycle
365
+ - [ ] `CometChatDisplayIncomingCallOverlay` mounted in `MaterialApp.builder` (rule 1.7)
366
+ - [ ] iOS `Info.plist`: NSCameraUsageDescription + NSMicrophoneUsageDescription + UIBackgroundModes (audio + voip + remote-notification)
367
+ - [ ] Android `minSdk = 26`, ProGuard rules `-keep class com.cometchat.** { *; }`
368
+ - [ ] Android manifest: four FOREGROUND_SERVICE_* permissions + MANAGE_OWN_CALLS + BIND_TELECOM_CONNECTION_SERVICE
369
+ - [ ] Hangup path: `endSession` + `FlutterCallkitIncoming.endAllCalls` + Navigator pop
370
+ - [ ] After logout: `CallOperationsServiceLocator.instance.reset()`
371
+ - [ ] `resizeToAvoidBottomInset: false` on call-screen Scaffolds
332
372
  - [ ] Theme cached in `didChangeDependencies()`, not `build()`
333
- - [ ] SDK listeners cleaned up in `dispose()`
373
+ - [ ] **Standalone only:** `flutter_callkit_incoming` + `firebase_messaging` + iOS PushKit platform-channel bridge
374
+
375
+ **Runtime (real devices, both platforms):**
376
+
377
+ - [ ] iOS — terminated app, lock-screen rings on incoming call (CallKit)
378
+ - [ ] Android — terminated app, heads-up notification rings (ConnectionService)
379
+ - [ ] Both — outgoing call connects, two-way audio + video
380
+ - [ ] Both — hangup releases camera + mic, no system call UI stuck
381
+ - [ ] Logout + relogin: calls subsystem reinitializes cleanly (no "session already started")
382
+ - [ ] Android 14+: ongoing-call notification visible, swipe-up doesn't kill the call
383
+ - [ ] Keyboard during call doesn't break layout
384
+
385
+ ## 8. Pointers
386
+
387
+ - `cometchat-calls` — dispatcher
388
+ - `cometchat-flutter-v6-core` — UIKitSettings, init/login order, init guard rules
389
+ - `cometchat-flutter-v6-events` — Bloc event streams
390
+ - `cometchat-flutter-v6-features` — feature catalog (calls is a base capability — features layer on top)
391
+ - `cometchat-flutter-v6-production` — server-minted tokens, ProGuard, environment config
392
+ - `cometchat-flutter-v6-troubleshooting` — pubspec resolution, Bloc errors, theme cache, build errors
393
+ - `cometchat-flutter-v6-migration` — V5 → V6 migration recipes (GetX → Bloc, calls package → bundled, theme API rewrite)
394
+
395
+ ## Known external SDK gotchas (worth surfacing in any agent message)
396
+
397
+ - `startSession` on Android can return `null` with a 5-second timeout and no error feedback — known platform issue; retry once before surfacing failure.
398
+ - `SessionType.audio` is ignored on Android in some V6 SDK builds — always opens with video. External SDK bug; track upstream.