@cometchat/skills 4.2.1 → 4.4.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 (234) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +33 -12
  3. package/bin/install.js +59 -4
  4. package/package.json +14 -1
  5. package/skills/cometchat/SKILL.md +460 -77
  6. package/skills/cometchat/references/asking-questions.md +48 -0
  7. package/skills/cometchat-a11y/SKILL.md +3 -2
  8. package/skills/cometchat-android-v5/SKILL.md +2 -1
  9. package/skills/cometchat-android-v5-calls/SKILL.md +36 -22
  10. package/skills/cometchat-android-v5-calls/references/README.md +1 -1
  11. package/skills/cometchat-android-v5-calls/references/add-calls-to-existing-chat.md +7 -5
  12. package/skills/cometchat-android-v5-calls/references/audio-controls.md +4 -4
  13. package/skills/cometchat-android-v5-calls/references/call-layouts.md +33 -25
  14. package/skills/cometchat-android-v5-calls/references/call-session.md +2 -2
  15. package/skills/cometchat-android-v5-calls/references/custom-ui.md +5 -5
  16. package/skills/cometchat-android-v5-calls/references/event-listeners.md +2 -2
  17. package/skills/cometchat-android-v5-calls/references/idle-timeout.md +20 -14
  18. package/skills/cometchat-android-v5-calls/references/in-call-chat.md +1 -1
  19. package/skills/cometchat-android-v5-calls/references/migration-v4-to-v5.md +43 -27
  20. package/skills/cometchat-android-v5-calls/references/participant-management.md +3 -3
  21. package/skills/cometchat-android-v5-calls/references/raise-hand.md +25 -19
  22. package/skills/cometchat-android-v5-calls/references/recording.md +2 -2
  23. package/skills/cometchat-android-v5-calls/references/ringing-integration.md +1 -1
  24. package/skills/cometchat-android-v5-calls/references/screen-sharing.md +5 -9
  25. package/skills/cometchat-android-v5-calls/references/session-settings.md +3 -3
  26. package/skills/cometchat-android-v5-calls/references/setup.md +1 -1
  27. package/skills/cometchat-android-v5-calls/references/share-invite.md +9 -4
  28. package/skills/cometchat-android-v5-calls/references/video-controls.md +4 -4
  29. package/skills/cometchat-android-v5-calls/references/voip-calling.md +2 -2
  30. package/skills/cometchat-android-v5-components/SKILL.md +4 -3
  31. package/skills/cometchat-android-v5-core/SKILL.md +20 -2
  32. package/skills/cometchat-android-v5-customization/SKILL.md +171 -7
  33. package/skills/cometchat-android-v5-extensions/SKILL.md +7 -4
  34. package/skills/cometchat-android-v5-features/SKILL.md +5 -4
  35. package/skills/cometchat-android-v5-placement/SKILL.md +2 -1
  36. package/skills/cometchat-android-v5-production/SKILL.md +2 -1
  37. package/skills/cometchat-android-v5-push/SKILL.md +2 -3
  38. package/skills/cometchat-android-v5-testing/SKILL.md +2 -1
  39. package/skills/cometchat-android-v5-theming/SKILL.md +2 -1
  40. package/skills/cometchat-android-v5-troubleshooting/SKILL.md +3 -2
  41. package/skills/cometchat-android-v6/SKILL.md +2 -1
  42. package/skills/cometchat-android-v6-builder-settings/SKILL.md +11 -7
  43. package/skills/cometchat-android-v6-calls/SKILL.md +79 -18
  44. package/skills/cometchat-android-v6-calls/references/advanced-features.md +87 -0
  45. package/skills/cometchat-android-v6-calls/references/call-layouts.md +24 -15
  46. package/skills/cometchat-android-v6-calls/references/call-session.md +2 -2
  47. package/skills/cometchat-android-v6-calls/references/device-management.md +17 -16
  48. package/skills/cometchat-android-v6-calls/references/idle-timeout.md +7 -4
  49. package/skills/cometchat-android-v6-calls/references/in-call-chat.md +13 -8
  50. package/skills/cometchat-android-v6-calls/references/raise-hand.md +6 -4
  51. package/skills/cometchat-android-v6-compose-components/SKILL.md +52 -29
  52. package/skills/cometchat-android-v6-compose-customization/SKILL.md +156 -1
  53. package/skills/cometchat-android-v6-compose-placement/SKILL.md +129 -40
  54. package/skills/cometchat-android-v6-compose-theming/SKILL.md +27 -1
  55. package/skills/cometchat-android-v6-core/SKILL.md +389 -9
  56. package/skills/cometchat-android-v6-events/SKILL.md +4 -1
  57. package/skills/cometchat-android-v6-extensions/SKILL.md +2 -1
  58. package/skills/cometchat-android-v6-features/SKILL.md +26 -2
  59. package/skills/cometchat-android-v6-kotlin-components/SKILL.md +31 -1
  60. package/skills/cometchat-android-v6-kotlin-customization/SKILL.md +172 -1
  61. package/skills/cometchat-android-v6-kotlin-placement/SKILL.md +20 -5
  62. package/skills/cometchat-android-v6-kotlin-theming/SKILL.md +36 -5
  63. package/skills/cometchat-android-v6-migration/SKILL.md +44 -42
  64. package/skills/cometchat-android-v6-production/SKILL.md +6 -3
  65. package/skills/cometchat-android-v6-push/SKILL.md +43 -2
  66. package/skills/cometchat-android-v6-testing/SKILL.md +11 -8
  67. package/skills/cometchat-android-v6-troubleshooting/SKILL.md +26 -5
  68. package/skills/cometchat-angular-calls/SKILL.md +256 -389
  69. package/skills/cometchat-angular-calls/references/add-calls-to-existing-chat.md +3 -2
  70. package/skills/cometchat-angular-calls/references/call-layouts.md +29 -12
  71. package/skills/cometchat-angular-calls/references/call-session.md +2 -2
  72. package/skills/cometchat-angular-calls/references/custom-ui.md +18 -10
  73. package/skills/cometchat-angular-calls/references/device-management.md +53 -34
  74. package/skills/cometchat-angular-calls/references/group-calls.md +45 -24
  75. package/skills/cometchat-angular-calls/references/idle-timeout.md +31 -15
  76. package/skills/cometchat-angular-calls/references/ngzone-and-async-callbacks.md +7 -6
  77. package/skills/cometchat-angular-calls/references/raise-hand.md +9 -4
  78. package/skills/cometchat-angular-calls/references/recording-screen-share.md +32 -39
  79. package/skills/cometchat-angular-calls/references/ringing-integration.md +3 -1
  80. package/skills/cometchat-angular-calls/references/share-invite.md +11 -5
  81. package/skills/cometchat-angular-calls/references/virtual-background.md +29 -0
  82. package/skills/cometchat-angular-components/SKILL.md +149 -620
  83. package/skills/cometchat-angular-core/SKILL.md +235 -293
  84. package/skills/cometchat-angular-customization/SKILL.md +415 -223
  85. package/skills/cometchat-angular-features/SKILL.md +216 -334
  86. package/skills/cometchat-angular-patterns/SKILL.md +168 -359
  87. package/skills/cometchat-angular-placement/SKILL.md +189 -560
  88. package/skills/cometchat-angular-production/SKILL.md +241 -92
  89. package/skills/cometchat-angular-push/SKILL.md +280 -294
  90. package/skills/cometchat-angular-testing/SKILL.md +430 -158
  91. package/skills/cometchat-angular-theming/SKILL.md +190 -265
  92. package/skills/cometchat-angular-troubleshooting/SKILL.md +192 -157
  93. package/skills/cometchat-astro-patterns/SKILL.md +22 -1
  94. package/skills/cometchat-calls/SKILL.md +25 -19
  95. package/skills/cometchat-calls/references/use-case-broadcast.md +15 -10
  96. package/skills/cometchat-calls/references/use-case-marketplace.md +2 -3
  97. package/skills/cometchat-calls/references/use-case-support.md +3 -4
  98. package/skills/cometchat-calls/references/use-case-team.md +23 -12
  99. package/skills/cometchat-calls/references/use-case-telehealth.md +3 -4
  100. package/skills/cometchat-components/SKILL.md +163 -25
  101. package/skills/cometchat-core/SKILL.md +412 -13
  102. package/skills/cometchat-customization/SKILL.md +50 -25
  103. package/skills/cometchat-features/SKILL.md +313 -34
  104. package/skills/cometchat-flutter-v5/SKILL.md +10 -4
  105. package/skills/cometchat-flutter-v5-calls/SKILL.md +188 -158
  106. package/skills/cometchat-flutter-v5-calls/references/add-calls-to-existing-chat.md +48 -24
  107. package/skills/cometchat-flutter-v5-calls/references/call-layouts.md +20 -15
  108. package/skills/cometchat-flutter-v5-calls/references/call-session.md +100 -145
  109. package/skills/cometchat-flutter-v5-calls/references/device-management.md +12 -8
  110. package/skills/cometchat-flutter-v5-calls/references/group-calls.md +30 -36
  111. package/skills/cometchat-flutter-v5-calls/references/idle-timeout.md +15 -13
  112. package/skills/cometchat-flutter-v5-calls/references/in-call-chat.md +12 -9
  113. package/skills/cometchat-flutter-v5-calls/references/migration-v4-to-v5.md +115 -65
  114. package/skills/cometchat-flutter-v5-calls/references/raise-hand.md +41 -30
  115. package/skills/cometchat-flutter-v5-calls/references/ringing-integration.md +17 -14
  116. package/skills/cometchat-flutter-v5-calls/references/share-invite.md +8 -2
  117. package/skills/cometchat-flutter-v5-conversations/SKILL.md +2 -1
  118. package/skills/cometchat-flutter-v5-core/SKILL.md +20 -2
  119. package/skills/cometchat-flutter-v5-customization/SKILL.md +136 -5
  120. package/skills/cometchat-flutter-v5-events/SKILL.md +2 -1
  121. package/skills/cometchat-flutter-v5-messages/SKILL.md +2 -1
  122. package/skills/cometchat-flutter-v5-production/SKILL.md +15 -6
  123. package/skills/cometchat-flutter-v5-push/SKILL.md +2 -1
  124. package/skills/cometchat-flutter-v5-testing/SKILL.md +17 -6
  125. package/skills/cometchat-flutter-v5-theming/SKILL.md +2 -1
  126. package/skills/cometchat-flutter-v5-troubleshooting/SKILL.md +7 -6
  127. package/skills/cometchat-flutter-v5-users-groups/SKILL.md +3 -2
  128. package/skills/cometchat-flutter-v6/SKILL.md +17 -16
  129. package/skills/cometchat-flutter-v6-calls/SKILL.md +78 -63
  130. package/skills/cometchat-flutter-v6-calls/references/add-calls-to-existing-chat.md +8 -6
  131. package/skills/cometchat-flutter-v6-calls/references/advanced-features.md +89 -0
  132. package/skills/cometchat-flutter-v6-calls/references/call-layouts.md +15 -12
  133. package/skills/cometchat-flutter-v6-calls/references/call-session.md +2 -2
  134. package/skills/cometchat-flutter-v6-calls/references/device-management.md +9 -3
  135. package/skills/cometchat-flutter-v6-calls/references/group-calls.md +10 -10
  136. package/skills/cometchat-flutter-v6-calls/references/idle-timeout.md +15 -7
  137. package/skills/cometchat-flutter-v6-calls/references/in-call-chat.md +6 -3
  138. package/skills/cometchat-flutter-v6-calls/references/raise-hand.md +23 -16
  139. package/skills/cometchat-flutter-v6-components/SKILL.md +32 -11
  140. package/skills/cometchat-flutter-v6-conversations/SKILL.md +39 -11
  141. package/skills/cometchat-flutter-v6-core/SKILL.md +348 -10
  142. package/skills/cometchat-flutter-v6-customization/SKILL.md +97 -25
  143. package/skills/cometchat-flutter-v6-events/SKILL.md +3 -2
  144. package/skills/cometchat-flutter-v6-features/SKILL.md +15 -6
  145. package/skills/cometchat-flutter-v6-messages/SKILL.md +111 -60
  146. package/skills/cometchat-flutter-v6-migration/SKILL.md +18 -25
  147. package/skills/cometchat-flutter-v6-placement/SKILL.md +79 -50
  148. package/skills/cometchat-flutter-v6-production/SKILL.md +13 -12
  149. package/skills/cometchat-flutter-v6-push/SKILL.md +43 -21
  150. package/skills/cometchat-flutter-v6-testing/SKILL.md +6 -6
  151. package/skills/cometchat-flutter-v6-theming/SKILL.md +38 -5
  152. package/skills/cometchat-flutter-v6-troubleshooting/SKILL.md +182 -17
  153. package/skills/cometchat-flutter-v6-users-groups/SKILL.md +12 -4
  154. package/skills/cometchat-i18n/SKILL.md +139 -78
  155. package/skills/cometchat-ios/SKILL.md +4 -2
  156. package/skills/cometchat-ios-calls/SKILL.md +225 -95
  157. package/skills/cometchat-ios-calls/references/add-calls-to-existing-chat.md +11 -9
  158. package/skills/cometchat-ios-calls/references/audio-modes-and-controls.md +45 -0
  159. package/skills/cometchat-ios-calls/references/avaudiosession-routing.md +6 -7
  160. package/skills/cometchat-ios-calls/references/call-layouts.md +31 -91
  161. package/skills/cometchat-ios-calls/references/call-session.md +51 -54
  162. package/skills/cometchat-ios-calls/references/callkit-and-pushkit.md +33 -29
  163. package/skills/cometchat-ios-calls/references/custom-ui.md +38 -38
  164. package/skills/cometchat-ios-calls/references/group-calls.md +33 -70
  165. package/skills/cometchat-ios-calls/references/idle-timeout.md +24 -25
  166. package/skills/cometchat-ios-calls/references/in-call-chat.md +19 -23
  167. package/skills/cometchat-ios-calls/references/migration-v4-to-v5.md +128 -70
  168. package/skills/cometchat-ios-calls/references/picture-in-picture.md +20 -20
  169. package/skills/cometchat-ios-calls/references/raise-hand.md +14 -227
  170. package/skills/cometchat-ios-calls/references/recording-screen-share.md +35 -122
  171. package/skills/cometchat-ios-calls/references/ringing-integration.md +17 -16
  172. package/skills/cometchat-ios-calls/references/share-invite.md +8 -12
  173. package/skills/cometchat-ios-calls/references/swiftui-uikit-hosting.md +4 -4
  174. package/skills/cometchat-ios-components/SKILL.md +200 -12
  175. package/skills/cometchat-ios-core/SKILL.md +281 -11
  176. package/skills/cometchat-ios-customization/SKILL.md +276 -110
  177. package/skills/cometchat-ios-features/SKILL.md +64 -36
  178. package/skills/cometchat-ios-placement/SKILL.md +15 -12
  179. package/skills/cometchat-ios-production/SKILL.md +12 -4
  180. package/skills/cometchat-ios-push/SKILL.md +53 -19
  181. package/skills/cometchat-ios-testing/SKILL.md +14 -9
  182. package/skills/cometchat-ios-theming/SKILL.md +39 -3
  183. package/skills/cometchat-ios-troubleshooting/SKILL.md +41 -21
  184. package/skills/cometchat-native-bare-patterns/SKILL.md +56 -18
  185. package/skills/cometchat-native-calls/SKILL.md +89 -19
  186. package/skills/cometchat-native-calls/references/add-calls-to-existing-chat.md +2 -2
  187. package/skills/cometchat-native-calls/references/call-layouts.md +15 -14
  188. package/skills/cometchat-native-calls/references/call-session.md +2 -2
  189. package/skills/cometchat-native-calls/references/custom-ui.md +12 -8
  190. package/skills/cometchat-native-calls/references/device-management.md +53 -30
  191. package/skills/cometchat-native-calls/references/group-calls.md +35 -30
  192. package/skills/cometchat-native-calls/references/idle-timeout.md +6 -6
  193. package/skills/cometchat-native-calls/references/in-call-chat.md +10 -8
  194. package/skills/cometchat-native-calls/references/migration-v4-to-v5.md +2 -2
  195. package/skills/cometchat-native-calls/references/raise-hand.md +15 -13
  196. package/skills/cometchat-native-calls/references/recording-screen-share.md +49 -170
  197. package/skills/cometchat-native-calls/references/share-invite.md +7 -5
  198. package/skills/cometchat-native-calls/references/voip-push-end-to-end.md +4 -2
  199. package/skills/cometchat-native-components/SKILL.md +91 -57
  200. package/skills/cometchat-native-core/SKILL.md +281 -9
  201. package/skills/cometchat-native-customization/SKILL.md +150 -28
  202. package/skills/cometchat-native-expo-patterns/SKILL.md +77 -27
  203. package/skills/cometchat-native-features/SKILL.md +79 -49
  204. package/skills/cometchat-native-placement/SKILL.md +19 -10
  205. package/skills/cometchat-native-production/SKILL.md +9 -3
  206. package/skills/cometchat-native-push/SKILL.md +2 -1
  207. package/skills/cometchat-native-testing/SKILL.md +1 -2
  208. package/skills/cometchat-native-theming/SKILL.md +54 -29
  209. package/skills/cometchat-native-troubleshooting/SKILL.md +71 -3
  210. package/skills/cometchat-nextjs-patterns/SKILL.md +48 -6
  211. package/skills/cometchat-placement/SKILL.md +42 -3
  212. package/skills/cometchat-production/SKILL.md +12 -5
  213. package/skills/cometchat-react-calls/SKILL.md +220 -10
  214. package/skills/cometchat-react-calls/references/add-calls-to-existing-chat.md +4 -3
  215. package/skills/cometchat-react-calls/references/call-layouts.md +5 -6
  216. package/skills/cometchat-react-calls/references/call-session.md +1 -1
  217. package/skills/cometchat-react-calls/references/custom-ui.md +61 -15
  218. package/skills/cometchat-react-calls/references/device-management.md +55 -51
  219. package/skills/cometchat-react-calls/references/group-calls.md +18 -23
  220. package/skills/cometchat-react-calls/references/idle-timeout.md +25 -12
  221. package/skills/cometchat-react-calls/references/in-call-chat.md +7 -7
  222. package/skills/cometchat-react-calls/references/migration-v4-to-v5.md +9 -11
  223. package/skills/cometchat-react-calls/references/raise-hand.md +14 -14
  224. package/skills/cometchat-react-calls/references/recording-screen-share.md +39 -38
  225. package/skills/cometchat-react-calls/references/ringing-integration.md +2 -2
  226. package/skills/cometchat-react-calls/references/share-invite.md +4 -5
  227. package/skills/cometchat-react-calls/references/testing-calls-on-web.md +20 -2
  228. package/skills/cometchat-react-calls/references/virtual-background.md +32 -0
  229. package/skills/cometchat-react-patterns/SKILL.md +57 -4
  230. package/skills/cometchat-react-push/SKILL.md +258 -72
  231. package/skills/cometchat-react-router-patterns/SKILL.md +43 -4
  232. package/skills/cometchat-react-testing/SKILL.md +14 -5
  233. package/skills/cometchat-theming/SKILL.md +181 -18
  234. package/skills/cometchat-troubleshooting/SKILL.md +40 -20
@@ -3,13 +3,14 @@ name: cometchat-flutter-v5
3
3
  description: "Use when building chat with CometChat Flutter UIKit v5 (cometchat_chat_uikit v5.2.14, cometchat_calls_uikit v5.0.15). Orchestrator skill that routes to feature-specific skills."
4
4
  license: "MIT"
5
5
  compatibility: "cometchat_chat_uikit ^5.2.14; cometchat_calls_uikit ^5.0.15; cometchat_uikit_shared ^5.2.3; cometchat_sdk ^4.1.2; get ^4.6.5"
6
- allowed-tools: "shell, file-read, file-search, file-list"
7
6
  metadata:
8
7
  author: "CometChat"
9
8
  version: "3.0.0"
10
9
  tags: "cometchat flutter v5 chat uikit messaging conversations getx"
11
10
  ---
12
11
 
12
+ > **Ground truth:** `cometchat_chat_uikit: ^5.2` (legacy/maintenance-only; calls via raw `cometchat_calls_sdk ^5.0.2`) — pub-cache source + `ui-kit/flutter/v5`. **Official docs:** https://www.cometchat.com/docs/ui-kit/flutter/v5/overview · **Docs MCP:** `claude mcp add --transport http cometchat-docs https://www.cometchat.com/docs/mcp` (or fetch the URL directly without MCP). Verify symbols against the installed package/source before relying on them.
13
+
13
14
  # CometChat Flutter UIKit v5 — Orchestrator
14
15
 
15
16
  Entry point skill for the CometChat UIKit v5 packages. Routes to feature skills based on context.
@@ -21,9 +22,11 @@ Confirm the project uses CometChat UIKit v5 by checking `pubspec.yaml` for:
21
22
  ```yaml
22
23
  dependencies:
23
24
  cometchat_chat_uikit: ^5.2.14
24
- cometchat_calls_uikit: ^5.0.15 # Optional, for calling features
25
+ cometchat_calls_uikit: ^5.0.15 # part of the v5 kit family — but NOT the calls path (see note)
25
26
  ```
26
27
 
28
+ > **⚠️ Voice/video calling does NOT use `cometchat_calls_uikit`.** Its prebuilt call widgets are **4.x-bound** (it transitively pins `cometchat_calls_sdk ^4.2.2`). Per the product policy that all families use the **V5 calls SDK**, Flutter V5 calling integrates the **raw `cometchat_calls_sdk ^5.0.2`** with a custom call surface — load **`cometchat-flutter-v5-calls`**. Do not add `cometchat_calls_uikit` for calls.
29
+
27
30
  The v5 uses **separate packages** (unlike v6 which bundles everything):
28
31
  - `cometchat_chat_uikit` — Chat UI components
29
32
  - `cometchat_calls_uikit` — Call UI components (re-exports `cometchat_uikit_shared` + `cometchat_sdk` + `cometchat_calls_sdk`; does NOT re-export `cometchat_chat_uikit`)
@@ -60,6 +63,7 @@ import 'package:cometchat_calls_uikit/cometchat_calls_uikit.dart';
60
63
  | calls, voice call, video call, CometChatCallButtons, incoming call, call logs | `cometchat-flutter-v5-calls` |
61
64
  | events, listeners, real-time, typing indicator, online status, receipts | `cometchat-flutter-v5-events` |
62
65
  | custom bubbles, templates, DataSource, decorator, formatters, slot views, extensions | `cometchat-flutter-v5-customization` |
66
+ | enable a feature, polls, reactions, stickers, message translation, AI, `apply-feature` | `cometchat-flutter-v6-features` (proxy — V5 has no separate features skill; feature *enablement* is the same `apply-feature`/dashboard path, only UI wiring differs; V5 is legacy/maintenance-only) |
63
67
  | push notifications, FCM, APNs, VoIP, token, firebase messaging, callkit | `cometchat-flutter-v5-push` |
64
68
  | auth tokens, ProGuard, release build, security, environment, production | `cometchat-flutter-v5-production` |
65
69
  | error, debug, not working, crash, fix, troubleshoot, verify | `cometchat-flutter-v5-troubleshooting` |
@@ -111,9 +115,11 @@ class _MyAppState extends State<MyApp> {
111
115
  ..appId = appId
112
116
  ..region = region
113
117
  ..authKey = authKey
114
- ..subscriptionType = CometChatSubscriptionType.allUsers
115
- ..callingExtension = CometChatCallingExtension())
118
+ ..subscriptionType = CometChatSubscriptionType.allUsers)
116
119
  .build();
120
+ // For voice/video calls, also `import cometchat_calls_uikit` and add
121
+ // ..callingExtension = CometChatCallingExtension()
122
+ // to the builder above (see cometchat-flutter-v5-calls).
117
123
 
118
124
  CometChatUIKit.init(
119
125
  uiKitSettings: settings,
@@ -1,9 +1,8 @@
1
1
  ---
2
2
  name: cometchat-flutter-v5-calls
3
- description: CometChat Calls integration for Flutter UIKit v5 (GetX-based, cometchat_calls_uikit separate package). Covers package wiring (cometchat_calls_uikit ^5.0.15 alongside cometchat_chat_uikit ^5.2), CometChatCallingExtension via UIKitSettingsBuilder, CallNavigationContext.navigatorKey, the kit's CometChatCallButtons / CometChatIncomingCall / CometChatOutgoingCall / CometChatOngoingCall / CometChatCallLogs widgets, dual-SDK ringing (CometChat.initiateCall + CometChatUIKitCalls.joinSession), Android FCM + ConnectionService for VoIP push, iOS CallKit + PushKit, foreground service correctness on Android 14+, hangup cleanup, and additive-vs-standalone modes.
3
+ description: CometChat Calls integration for Flutter UIKit v5 (GetX-based chat kit) on the v5 Calls SDK (cometchat_calls_sdk ^5.0.2, added as a DIRECT dependency raw SDK + custom call surface). Covers the 5.x lifecycle (CometChatCalls.init/login/loginWithAuthToken/generateToken/joinSession/getLoggedInUser), the CallSession.getInstance() in-call controls (mute/pauseVideo/switchCamera/raiseHand/setLayout/setAudioModeType/recording/leaveSession), SessionSettingsBuilder, the 5 split listeners (SessionStatus/ParticipantEvent/MediaEvent/ButtonClick/Layout), Android FCM + ConnectionService for VoIP push, iOS CallKit + PushKit, foreground service correctness on Android 14+, hangup cleanup, and additive-vs-standalone modes. The 4.x-bound cometchat_calls_uikit prebuilt call widgets are documented only as a legacy alternative incompatible with the 5.x calls SDK.
4
4
  license: "MIT"
5
- compatibility: "Flutter >= 2.5, Dart >= 2.17; cometchat_chat_uikit ^5.2.14; cometchat_calls_uikit ^5.0.15; cometchat_calls_sdk ^4.2.2; cometchat_sdk ^4.1.2"
6
- allowed-tools: "shell, file-read, file-search, file-list, ask-user"
5
+ compatibility: "Flutter >= 2.5, Dart >= 2.17; cometchat_chat_uikit ^5.2.14; cometchat_calls_sdk ^5.0.2 (DIRECT dependency — raw SDK, custom call surface); cometchat_sdk ^4.1.2. NOTE: cometchat_calls_uikit ^5.0.16 transitively pins cometchat_calls_sdk ^4.2.2 and its prebuilt call widgets are 4.x-bound — do NOT use them with the 5.x calls SDK."
7
6
  metadata:
8
7
  author: "CometChat"
9
8
  version: "4.0.0"
@@ -12,10 +11,12 @@ metadata:
12
11
 
13
12
  ## Purpose
14
13
 
15
- Production-grade voice + video calling for Flutter UIKit v5 (GetX-based). Loaded by `cometchat-calls` when `framework === "flutter"` and `flutter_version === "v5"`. Operates in two modes:
14
+ Production-grade voice + video calling for Flutter UIKit v5 (GetX-based chat kit) on the **v5 Calls SDK** (`cometchat_calls_sdk ^5.0.2`, added as a **direct** dependency). Loaded by `cometchat-calls` when `framework === "flutter"` and `flutter_version === "v5"`. Operates in two modes:
16
15
 
17
- - **Standalone** — calls is the product. `cometchat_chat_sdk` (signaling) + `cometchat_calls_sdk` (WebRTC) without the `cometchat_chat_uikit` UI Kit. Custom call screens (or hand-roll the kit's call widgets without the conversation kit). **VoIP push is mandatory** — same rule as native iOS / Android.
18
- - **Additive** — calls layered onto an existing v5 chat integration. Adds `cometchat_calls_uikit` package, configures the calling extension via `UIKitSettingsBuilder.callingExtension`, sets `CallNavigationContext.navigatorKey` on `MaterialApp`, mounts the global incoming-call listener at the app shell.
16
+ - **Standalone** — calls is the product. `cometchat_chat_sdk` (signaling) + `cometchat_calls_sdk ^5.0.2` (WebRTC) without the `cometchat_chat_uikit` UI Kit. Custom call screens. **VoIP push is mandatory** — same rule as native iOS / Android.
17
+ - **Additive** — calls layered onto an existing v5 chat integration. Keep the existing GetX chat UI Kit (`cometchat_chat_uikit`), add the **raw `cometchat_calls_sdk ^5.0.2`** directly, and build a **custom call surface** around it. Mount the global incoming-call listener at the app shell.
18
+
19
+ > **DEPENDENCY CONTEXT — why raw SDK, not the calls UI Kit (read first).** The V5 Flutter calls UI Kit `cometchat_calls_uikit` (latest **5.0.16**) transitively pins `cometchat_calls_sdk ^4.2.2`, and its prebuilt call widgets (`CometChatCallButtons` / `CometChatIncomingCall` / `CometChatOutgoingCall` / `CometChatOngoingCall`) are **compiled against the 4.x API**. To run the **5.x** calls SDK (`cometchat_calls_sdk ^5.0.2`) on the Flutter V5 (GetX) chat UI Kit — per the product decision that all families use the V5 calls SDK — you integrate the **raw `cometchat_calls_sdk ^5.0.2`** directly with a **custom call surface**. You do **NOT** use `cometchat_calls_uikit`'s prebuilt call widgets — they require the 4.x SDK and will clash with the 5.x pin. Wherever this skill mentions those widgets, they are a **legacy 4.x-kit alternative, incompatible with the 5.x calls SDK**. Substrate of record (Dart 5.x): `~/.pub-cache/hosted/pub.dev/cometchat_calls_sdk-5.0.2/lib/`.
19
20
 
20
21
  **Read these other skills first:**
21
22
  - `cometchat-calls` — dispatcher (modes, hard rules, anti-patterns)
@@ -23,104 +24,102 @@ Production-grade voice + video calling for Flutter UIKit v5 (GetX-based). Loaded
23
24
  - `cometchat-flutter-v5-events` — CometChatMessageEvents / CometChatCallEvents subscription patterns
24
25
 
25
26
  **Ground truth:**
26
- - SDK source`~/Downloads/calls-sdk/calls-sdk-flutter-5/sdk/`
27
- - Sample app — `~/Downloads/calls-sdk/calls-sdk-flutter-5/sample-apps/`
27
+ - Calls SDK substrate`~/.pub-cache/hosted/pub.dev/cometchat_calls_sdk-5.0.2/lib/` (lifecycle: `src/plugin/cometchatcalls.dart`; in-call controls: `src/call_session.dart`; the 5 split listeners: `src/listener/*`; settings: `src/builder/session_settings.dart`)
28
28
  - Public docs — https://www.cometchat.com/docs/calls/flutter/overview
29
29
 
30
30
  ---
31
31
 
32
- ## 1. The seven hard rules — Flutter v5 specialization
32
+ ## 1. The seven hard rules — Flutter v5 specialization (5.x Calls SDK)
33
+
34
+ > **THIS SKILL TARGETS THE 5.x CALLS SDK (read this first).** Add `cometchat_calls_sdk ^5.0.2` as a **direct** dependency. The 5.x SDK splits its surface: **lifecycle is static on `CometChatCalls`** (`init`/`login`/`loginWithAuthToken`/`logout`/`generateToken`/`generateCallToken`/`joinSession`/`getLoggedInUser`) while **in-call controls are instance methods on the `CallSession` singleton** fetched via `CallSession.getInstance()`. Settings use `SessionSettingsBuilder` (NOT `CallSettingsBuilder` — `@Deprecated` in 5.0.2, `src/builder/call_settings.dart:209`). Events arrive through the **5 split listeners** (NOT the single `CometChatCallsEventsListener` — `@Deprecated`, `src/listener/cometchat_calls_events_listener.dart:16`). Do **not** pull calls transitively via `cometchat_calls_uikit` — that brings the 4.x SDK (see the dependency-context note above).
35
+
36
+ ### 1.0 The 5.x Calls SDK has its OWN login
33
37
 
34
- ### 1.0 Calls SDK login is its own step (v5+)
38
+ Unlike 4.x, the 5.x Calls SDK is logged in explicitly and caches the auth token internally — `generateCallToken`/`joinSession` then need no per-call token argument. The lifecycle (all static on `CometChatCalls`, `src/plugin/cometchatcalls.dart`):
35
39
 
36
- 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"**.
40
+ - `init(CallAppSettings, {onSuccess, onError})` — `:172`
41
+ - `login({uid:, authKey:, onSuccess:, onError:})` — `:224`
42
+ - `loginWithAuthToken({authToken:, onSuccess:, onError:})` — `:316` (production path)
43
+ - `logout({onSuccess:, onError:})` — `:409`
44
+ - `generateToken(sessionId, userAuthToken, {onSuccess, onError})` — `:449` (**@Deprecated** v4-compat shim; prefer `generateCallToken`)
45
+ - `generateCallToken(sessionId, {onSuccess, onError})` — `:565` (uses the cached auth token)
46
+ - `joinSession({sessionId: OR callToken:, sessionSettings:, onSuccess:, onError:})` — `:735`
47
+ - `getLoggedInUser()` — `:698`
37
48
 
38
49
  ```dart
39
50
  import 'package:cometchat_sdk/cometchat_sdk.dart';
40
51
  import 'package:cometchat_calls_sdk/cometchat_calls_sdk.dart';
41
52
 
53
+ // 1. Chat SDK login (signaling).
42
54
  CometChat.login(uid, AUTH_KEY,
43
- onSuccess: (User user) {
44
- // Chat SDK ready now login Calls SDK
45
- CometChatCalls.login(
46
- uid: uid,
47
- authKey: AUTH_KEY,
48
- onSuccess: (User? callUser) {
49
- // both ready
50
- },
51
- onError: (CometChatException e) {
52
- // surface to user
53
- },
54
- );
55
- },
56
- onError: (CometChatException e) {
57
- // chat login failed
55
+ onSuccess: (User user) async {
56
+ // 2. Calls SDK login (5.x has its own). Borrow the Chat auth token.
57
+ // getAuthToken() is NOT a User method — use the static CometChat.getUserAuthToken().
58
+ final authToken = await CometChat.getUserAuthToken();
59
+ if (authToken != null) {
60
+ CometChatCalls.loginWithAuthToken( // :316
61
+ authToken: authToken,
62
+ onSuccess: (cu) { /* Calls SDK ready */ },
63
+ onError: (CometChatCallsException e) { debugPrint(e.message ?? ''); },
64
+ );
65
+ }
58
66
  },
67
+ onError: (CometChatException e) { /* chat login failed */ },
59
68
  );
60
69
  ```
61
70
 
62
- For production with server-minted tokens:
63
-
64
- ```dart
65
- CometChatCalls.loginWithAuthToken(
66
- authToken: tokenFromBackend,
67
- onSuccess: (User? user) { /* … */ },
68
- onError: (CometChatException e) { /* … */ },
69
- );
70
- ```
71
+ You can also `CometChatCalls.login(uid: uid, authKey: AUTH_KEY, ...)` (`:224`) directly with the app's auth key in dev. In production use `loginWithAuthToken` with a server-minted token (rule 1.4).
71
72
 
72
73
  **Surprises:**
73
- - Chat SDK persists login via shared preferences across launches. The **Calls SDK does NOT** always check `CometChatCalls.getLoggedInUser()` on app start and re-login if it returns null.
74
- - The Calls SDK's onSuccess hands back `User?` (nullable) — guard before using.
74
+ - `CometChatCalls.init(...)` (`:172`) takes a `CallAppSettings` (built via `CallAppSettingBuilder`, `src/builder/call_app_settings_request.dart:36`) — `appId` + `region`, no `authKey` field.
75
+ - After login, `CometChatCalls.getLoggedInUser()` (`:698`) returns the calls user; `generateCallToken` (`:565`) and `joinSession` (`:735`) use the **cached** auth token no per-call token arg.
75
76
 
76
- ### 1.1 Dual-SDK contract — `CometChatCallingExtension` hides it (additive); standalone code sees both
77
+ ### 1.1 Dual-SDK contract — Chat SDK signals, Calls SDK (5.x) does WebRTC
77
78
 
78
- In additive mode, the `CometChatCallingExtension` registered via `UIKitSettingsBuilder.callingExtension` wires both SDKs internallyyour code rarely touches `CometChatUIKitCalls` directly. In standalone mode (no UI Kit), you call both SDKs explicitly:
79
+ Both modes integrate the **raw 5.x calls SDK** directly (no calling-extension widgetthat's a 4.x-kit construct). Chat SDK initiates ringing; the 5.x Calls SDK joins the WebRTC session via `joinSession`:
79
80
 
80
81
  ```dart
81
- // ✓ RIGHT — additive mode (calling extension owns the dual-SDK split)
82
- final settings = (UIKitSettingsBuilder()
83
- ..appId = 'APP_ID'
84
- ..region = 'us'
85
- ..authKey = 'AUTH_KEY'
86
- ..subscriptionType = CometChatSubscriptionType.allUsers
87
- ..callingExtension = CometChatCallingExtension())
88
- .build();
89
- CometChatUIKit.init(uiKitSettings: settings);
90
- ```
91
-
92
- ```dart
93
- // ✓ RIGHT — standalone mode (explicit dual-SDK)
82
+ // ✓ RIGHT — raw 5.x dual-SDK (additive AND standalone)
94
83
  import 'package:cometchat_chat_sdk/cometchat_chat_sdk.dart';
95
84
  import 'package:cometchat_calls_sdk/cometchat_calls_sdk.dart';
96
85
 
97
86
  // Chat SDK — initiate ringing
98
- final outgoing = Call(receiverUid, CometChatReceiverType.user, CometChatCallType.video);
99
- final initiated = await CometChat.initiateCall(call: outgoing);
100
-
101
- // Calls SDK — join WebRTC session after acceptance.
102
- // Use SessionSettingsBuilder + callback shape — matches the upstream sample
103
- // at calls-sdk-flutter-5/sample-apps/cometchat-calls-sample-app-flutter/.
104
- // CallSettingsBuilder is the chat-side type; SessionSettingsBuilder is what
105
- // session/joinSession accepts.
106
- final sessionSettings = (SessionSettingsBuilder()
107
- .setTitle('CometChat Call')
108
- .startVideoPaused(false)
109
- .startAudioMuted(false))
87
+ // Chat SDK Call — NAMED constructor; `type`/`receiverType` are Strings (the constants resolve to strings).
88
+ final outgoing = Call(
89
+ receiverUid: receiverUid,
90
+ type: CometChatCallType.video, // 'video'
91
+ receiverType: CometChatReceiverType.user, // 'user'
92
+ );
93
+
94
+ final settings = (SessionSettingsBuilder()
95
+ ..setTitle('CometChat Call') // src/builder/session_settings.dart:155
96
+ ..startAudioMuted(false) // :173
97
+ ..startVideoPaused(false)) // :167
110
98
  .build();
111
99
 
112
- CometChatCalls.joinSession(
113
- sessionId: sessionId,
114
- sessionSettings: sessionSettings,
115
- onSuccess: (Widget? widget) {
116
- // render widget via SizedBox.expand; register SessionStatusListeners
117
- },
118
- onError: (CometChatCallsException err) {
119
- debugPrint('joinSession failed: ${err.message}');
100
+ // initiateCall is VOID + callback-based — the Call (with sessionId) arrives in onSuccess,
101
+ // NOT via `await`/a return value. Join the WebRTC session inside that callback.
102
+ CometChat.initiateCall(
103
+ outgoing, // POSITIONAL Call arg
104
+ onSuccess: (Call initiated) {
105
+ CometChatCalls.joinSession(
106
+ sessionId: initiated.sessionId, // SDK mints the call token internally
107
+ sessionSettings: settings,
108
+ onSuccess: (Widget? widget) {
109
+ // render widget via SizedBox.expand; register split listeners on
110
+ // CallSession.getInstance() (rule 1.0 / references/call-session.md)
111
+ },
112
+ onError: (CometChatCallsException err) {
113
+ debugPrint('joinSession failed: ${err.message}');
114
+ },
115
+ );
120
116
  },
117
+ onError: (CometChatException e) { debugPrint('initiateCall failed: ${e.message}'); },
121
118
  );
122
119
  ```
123
120
 
121
+ > **Legacy 4.x-kit alternative (incompatible with the 5.x calls SDK).** The old `cometchat_calls_uikit` path registered a `CometChatCallingExtension` on `UIKitSettingsBuilder` and used `CometChatUIKitCalls.startSession` + the prebuilt `CometChatCallButtons`/`CometChatIncomingCall`/`CometChatOutgoingCall`/`CometChatOngoingCall` widgets. Those widgets are **compiled against the 4.x calls SDK** — they cannot run against `cometchat_calls_sdk ^5.0.2`. Do not mix them in.
122
+
124
123
  ### 1.2 VoIP push — `flutter_callkit_incoming` + `firebase_messaging` + platform-channel bridges
125
124
 
126
125
  Standalone mode requires working VoIP push end-to-end. The Flutter stack:
@@ -134,16 +133,14 @@ In additive mode, this is opt-in but recommended.
134
133
 
135
134
  ### 1.3 Foreground service — Android 14+ rules apply unchanged
136
135
 
137
- **⚠️ Android build prerequisite — Jetifier is mandatory.** One of the `cometchat_calls_uikit` transitive deps pulls in the legacy `com.android.support:support-compat:26.1.0` AAR. Without Jetifier, AGP fails the assembleDebug step with dozens of `Duplicate class android.support.v4.*` errors against `androidx.core`. Set in `android/gradle.properties`:
136
+ **⚠️ Android build prerequisite — Jetifier.** If your build pulls in any legacy `com.android.support:*` AAR transitively, AGP fails `assembleDebug` with dozens of `Duplicate class android.support.v4.*` errors against `androidx.core`. Set in `android/gradle.properties`:
138
137
 
139
138
  ```properties
140
139
  android.useAndroidX=true
141
140
  android.enableJetifier=true
142
141
  ```
143
142
 
144
- Flutter 3.x scaffolds omit `enableJetifier=true` by default — the build blows up on the first `flutter build apk` if you skip this. The error is loud but the fix is one line.
145
-
146
- The `cometchat_calls_uikit` registers `CometChatOngoingCallService` via manifest merge, but the host app's `android/app/src/main/AndroidManifest.xml` must declare the four FOREGROUND_SERVICE permissions plus MANAGE_OWN_CALLS / BIND_TELECOM_CONNECTION_SERVICE — the same rule as native Android (cf. `cometchat-android-v5-calls` rule 1.3).
143
+ The 5.x calls SDK ships `CometChatOngoingCallService` (`src/services/ongoing_call_service.dart`)call `CometChatOngoingCallService.launch()` after the session starts and `.abort()` on teardown (both `static Future<void>`, no-arg). The host app's `android/app/src/main/AndroidManifest.xml` must declare the four FOREGROUND_SERVICE permissions plus MANAGE_OWN_CALLS / BIND_TELECOM_CONNECTION_SERVICE — the same rule as native Android (cf. `cometchat-android-v5-calls` rule 1.3).
147
144
 
148
145
  ```xml
149
146
  <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
@@ -159,16 +156,18 @@ Silent crash on Android 14+ if `FOREGROUND_SERVICE_PHONE_CALL` is missing. The `
159
156
 
160
157
  ### 1.4 Server-minted auth tokens
161
158
 
162
- `cometchat-flutter-v5-production` covers the token-endpoint pattern. Production calls path uses `CometChatUIKit.loginWithAuthToken(token)`, not `loginWithAuthKey(uid, authKey)`. The Calls SDK piggybacks on the Chat SDK auth contextthere is no separate calls-only token.
159
+ `cometchat-flutter-v5-production` covers the token-endpoint pattern. In production, log BOTH SDKs in with a server-minted auth token, not the app auth key: `CometChat.loginWithAuthToken(token)` (Chat SDK) then `CometChatCalls.loginWithAuthToken(authToken: token, onSuccess:, onError:)` (Calls SDK, `:316`). The 5.x calls SDK caches that token internally `generateCallToken` (`:565`) / `joinSession` (`:735`) then need no per-call token.
163
160
 
164
161
  ### 1.5 Hangup cleanup — Dart + native + system call UI
165
162
 
166
163
  ```dart
167
164
  Future<void> endCall(String sessionId) async {
168
- // 1. End the Calls SDK session — releases WebRTC tracks.
169
- // CometChatCalls.endSession() does NOT exist on Flutter use the
170
- // CallSession singleton's leaveSession().
171
- await CallSession.getInstance().leaveSession();
165
+ // 1. Leave the Calls SDK session — releases WebRTC tracks.
166
+ // In 5.x the canonical teardown is the CallSession INSTANCE method
167
+ // leaveSession() (call_session.dart:272). The static CometChatCalls.endSession
168
+ // still exists (cometchatcalls.dart:676) but is @Deprecated — it just
169
+ // delegates to CallSession.getInstance()?.leaveSession() internally.
170
+ await CallSession.getInstance()?.leaveSession();
172
171
  await CometChatOngoingCallService.abort();
173
172
 
174
173
  // 2. Tell the OS-level call UI the call ended
@@ -210,42 +209,42 @@ iOS — `ios/Runner/Info.plist`:
210
209
 
211
210
  Android — manifest as above (rule 1.3) plus runtime requests via `permission_handler`.
212
211
 
213
- ### 1.7 IncomingCall mounted at app root + `CallNavigationContext.navigatorKey`
212
+ ### 1.7 IncomingCall mounted at app root + a global navigator key
214
213
 
215
- V5 uses GetX's navigator key pattern. `CallNavigationContext.navigatorKey` MUST be set on `MaterialApp.navigatorKey` so call overlays can navigate even when a call is initiated from a sub-route:
214
+ With the raw 5.x SDK + custom call surface, use a plain `GlobalKey<NavigatorState>` on `MaterialApp.navigatorKey` so call overlays can navigate even when a call is initiated from a sub-route. (Do NOT use `CallNavigationContext.navigatorKey` — that is a `cometchat_calls_uikit` (4.x-kit) symbol and is not available on the raw 5.x SDK path.)
216
215
 
217
216
  ```dart
218
217
  // ✓ RIGHT
218
+ final navigatorKey = GlobalKey<NavigatorState>();
219
+
219
220
  MaterialApp(
220
- navigatorKey: CallNavigationContext.navigatorKey,
221
+ navigatorKey: navigatorKey,
221
222
  // ...
222
223
  );
223
224
  ```
224
225
 
225
- Global call listener registration (incoming calls fire app-wide) belongs in the app shell's State, not in a feature screen:
226
+ Incoming calls are signaled by the **Chat SDK** `CallListener` — register it app-wide in the app shell's State, not in a feature screen:
226
227
 
227
228
  ```dart
228
- class AppShellState extends State<AppShell>
229
- with CallListener, CometChatCallEventListener {
229
+ class AppShellState extends State<AppShell> with CallListener {
230
230
  static const _listenerId = 'app-shell-call-listener';
231
231
 
232
232
  @override
233
233
  void initState() {
234
234
  super.initState();
235
235
  CometChat.addCallListener(_listenerId, this);
236
- CometChatCallEvents.addCallEventsListener(_listenerId, this);
237
236
  }
238
237
 
239
238
  @override
240
239
  void dispose() {
241
240
  CometChat.removeCallListener(_listenerId);
242
- CometChatCallEvents.removeCallEventsListener(_listenerId);
243
241
  super.dispose();
244
242
  }
245
243
 
246
244
  @override
247
245
  void onIncomingCallReceived(Call call) {
248
- // Route through CallNavigationContext or flutter_callkit_incoming
246
+ // Show your custom incoming-call UI / flutter_callkit_incoming, then on
247
+ // accept: CometChat.acceptCall(call.sessionId) → CometChatCalls.joinSession(...)
249
248
  }
250
249
  }
251
250
  ```
@@ -261,76 +260,105 @@ Use a stable string ID for the listener — duplicate IDs overwrite, distinct ID
261
260
  dependencies:
262
261
  flutter:
263
262
  sdk: flutter
264
- cometchat_chat_uikit: ^5.2.14 # additive mode — already there
265
- cometchat_calls_uikit: ^5.0.15 # adds the calling extension + widgets
263
+ cometchat_chat_uikit: ^5.2.14 # additive mode — existing GetX chat kit (keep)
264
+ cometchat_calls_sdk: ^5.0.2 # DIRECT dependency — the 5.x calls SDK (raw)
266
265
  permission_handler: ^11.0.0 # rule 1.6
267
266
  flutter_callkit_incoming: ^2.0.0 # standalone — VoIP UI bridge
268
267
  firebase_messaging: ^14.0.0 # standalone — Android FCM
269
268
  firebase_core: ^2.0.0 # firebase_messaging peer
270
269
  ```
271
270
 
271
+ > **Do NOT add `cometchat_calls_uikit`.** Its latest (5.0.16) transitively pins `cometchat_calls_sdk ^4.2.2` and clashes with the 5.x SDK above. The raw `cometchat_calls_sdk ^5.0.2` is the calls dependency; build a custom call surface around it (Section 3). See the dependency-context note at the top.
272
+
272
273
  Hosted source if pub.dev resolution lags:
273
274
 
274
275
  ```yaml
275
- cometchat_calls_uikit:
276
+ cometchat_calls_sdk:
276
277
  hosted: https://dart.cloudsmith.io/cometchat/cometchat/
277
- version: ^5.0.15
278
+ version: ^5.0.2
278
279
  ```
279
280
 
280
- Init order — calling extension flows the dual-SDK init internally:
281
+ Init order — init both SDKs, then log both in (rule 1.0):
281
282
 
282
283
  ```dart
284
+ import 'package:cometchat_chat_uikit/cometchat_chat_uikit.dart'; // additive chat kit
285
+ import 'package:cometchat_calls_sdk/cometchat_calls_sdk.dart';
286
+
287
+ // Chat UI Kit init (additive — existing GetX chat integration)
283
288
  final settings = (UIKitSettingsBuilder()
284
289
  ..appId = CometChatConfig.appId
285
290
  ..region = CometChatConfig.region
286
291
  ..authKey = CometChatConfig.authKey
287
- ..subscriptionType = CometChatSubscriptionType.allUsers
288
- ..callingExtension = CometChatCallingExtension()) // ← rule 1.1 (additive)
292
+ ..subscriptionType = CometChatSubscriptionType.allUsers)
289
293
  .build();
290
-
291
294
  await CometChatUIKit.init(uiKitSettings: settings);
292
- ```
293
-
294
- In standalone mode (no UI Kit), use the SDKs directly:
295
295
 
296
- ```dart
297
- await CometChat.init(CometChatConfig.appId, AppSettings.builder
298
- ..setRegion(CometChatConfig.region)
299
- ..subscribePresenceForAllUsers());
296
+ // 5.x Calls SDK init (raw) — CallAppSettingBuilder, no authKey field
297
+ final callAppSettings = (CallAppSettingBuilder()
298
+ ..appId = CometChatConfig.appId
299
+ ..region = CometChatConfig.region)
300
+ .build();
300
301
 
301
- await CometChatCalls.init(CallAppSettings.builder
302
- ..setAppId(CometChatConfig.appId)
303
- ..setRegion(CometChatConfig.region));
302
+ CometChatCalls.init( // cometchatcalls.dart:172
303
+ callAppSettings,
304
+ onSuccess: (String success) { /* Calls SDK ready */ },
305
+ onError: (CometChatCallsException e) { /* surface to user */ },
306
+ );
307
+ // After login, also CometChatCalls.loginWithAuthToken(...) — rule 1.0.
304
308
  ```
305
309
 
310
+ Standalone mode is identical except you use the raw `cometchat_chat_sdk` (`CometChat.init`) instead of the chat UI Kit for signaling.
311
+
306
312
  ---
307
313
 
308
- ## 3. Components catalog (UI Kit widgets)
314
+ ## 3. The raw 5.x calls surface (custom UI)
309
315
 
310
- Imports (additive mode barrel re-exports `cometchat_uikit_shared`, `cometchat_sdk`, `cometchat_calls_sdk`):
316
+ Import the raw SDK barrel — it re-exports the lifecycle class, `CallSession`, `SessionSettingsBuilder`, the 5 listeners, the enums, and `CometChatOngoingCallService`:
311
317
 
312
318
  ```dart
313
- import 'package:cometchat_calls_uikit/cometchat_calls_uikit.dart';
319
+ import 'package:cometchat_calls_sdk/cometchat_calls_sdk.dart';
314
320
  ```
315
321
 
316
- | Widget | Purpose |
317
- |---|---|
318
- | `CometChatCallButtons(user: ..., group: ...)` | Voice + video buttons. Drop into `CometChatMessageHeader` trailing slot or anywhere in the tree. Mutually exclusive `user` / `group`. |
319
- | `CometChatIncomingCall(call:, onAccept:, onDecline:)` | Foreground in-app ring UI (additive mode). **Callbacks take `(BuildContext, Call)`, NOT `(Call)` alone** — common mistake. |
320
- | `CometChatOutgoingCall(call:, user: OR group:, onCancelled:)` | Dialing UI. `call:` is the result of `CometChatUIKitCalls.initiateCall(...)`. Callbacks `(BuildContext, Call)?`. |
321
- | `CometChatOngoingCall(callSettingsBuilder:, sessionId:)` | Active call view, hosts WebRTC. |
322
- | `CometChatCallLogs(onItemClick:, callLogsRequestBuilder:)` | Paginated history. **`CometChatCallLogDetails` is NOT a UIKit export** — copy the sample-app pattern from `~/Downloads/calls-sdk/calls-sdk-flutter-5/sample-apps/.../call_log_details/` for the detail screen. |
323
-
324
- `CometChatUIKitCalls` API:
325
-
326
- | Method | Purpose |
327
- |---|---|
328
- | `CometChatUIKitCalls.initiateCall(call)` | Start a call (wraps Chat SDK `initiateCall` + Calls SDK preflight) |
329
- | `CometChatUIKitCalls.acceptCall(sessionId)` | Accept incoming |
330
- | `CometChatUIKitCalls.rejectCall(sessionId, status)` | Reject / cancel |
331
- | `CometChatUIKitCalls.generateToken(sessionId)` | Mint session-scoped RTC token |
332
- | `CometChatUIKitCalls.startSession(sessionId, settings)` | Start WebRTC |
333
- | `CometChatUIKitCalls.endSession()` | End and cleanup |
322
+ You build the call surface yourself (custom widgets) around these APIs. There are no prebuilt 5.x call widgets in this package — `joinSession` hands back a `Widget?` you render via `SizedBox.expand`, and you wrap it with your own controls bound to the `CallSession` singleton.
323
+
324
+ **Lifecycle static on `CometChatCalls`** (`src/plugin/cometchatcalls.dart`):
325
+
326
+ | Method | Line | Purpose |
327
+ |---|---|---|
328
+ | `init(CallAppSettings, {onSuccess, onError})` | `:172` | Initialize the SDK (appId + region) |
329
+ | `login({uid:, authKey:, onSuccess:, onError:})` | `:224` | Dev login with app auth key |
330
+ | `loginWithAuthToken({authToken:, onSuccess:, onError:})` | `:316` | Production login (server-minted token) |
331
+ | `logout({onSuccess:, onError:})` | `:409` | Log out, clear cached token |
332
+ | `generateCallToken(sessionId, {onSuccess, onError})` | `:565` | Mint a `CallToken` using the cached auth token |
333
+ | `generateToken(sessionId, userAuthToken, {...})` | `:449` | **@Deprecated** v4-compat shim (explicit token) |
334
+ | `joinSession({sessionId: OR callToken:, sessionSettings:, onSuccess:, onError:})` | `:735` | Join WebRTC; `onSuccess` `Widget?` |
335
+ | `getLoggedInUser()` | `:698` | The logged-in calls user |
336
+ | `endSession({onSuccess:, onError:})` | `:676` | **@Deprecated** — delegates to `CallSession.getInstance()?.leaveSession()` |
337
+
338
+ **In-call controls — instance on `CallSession.getInstance()`** (`src/call_session.dart`):
339
+
340
+ | Method | Line | Purpose |
341
+ |---|---|---|
342
+ | `muteAudio()` / `unMuteAudio()` | `:131` / `:145` | Local audio mute (no-arg) |
343
+ | `pauseVideo()` / `resumeVideo()` | `:168` / `:182` | Local video pause (no-arg) |
344
+ | `switchCamera()` | `:205` | Flip front/back camera |
345
+ | `raiseHand()` / `lowerHand()` | `:292` / `:306` | Hand raise |
346
+ | `setLayout(LayoutType)` | `:394` | `tile` / `sidebar` / `spotlight` |
347
+ | `setAudioModeType(AudioMode)` | `:381` | `speaker` / `earpiece` / `bluetooth` |
348
+ | `startRecording()` / `stopRecording()` | `:451` / `:465` | Recording |
349
+ | `enablePictureInPictureLayout()` / `disablePictureInPictureLayout()` | `:223` / `:236` | PiP layout toggle |
350
+ | `enterPipMode()` / `isPipSupported()` | `:250` / `:263` | OS-level PiP (Future&lt;bool&gt;) |
351
+ | `openVirtualBackgroundSettingsPanel()` | `:438` | Virtual Background — the raw 5.0.2 SDK DOES support VB (unlike the 4.x calls-uikit) |
352
+ | `muteParticipant(String)` / `pauseParticipantVideo(String)` | `:329` / `:342` | Moderator: mute/pause a remote participant |
353
+ | `pinParticipant(String?)` / `unPinParticipant()` | `:355` / `:368` | Pin/unpin a participant (Flutter: single nullable arg + `unPinParticipant` capital P — differs from Android) |
354
+ | `setChatButtonUnreadCount(int)` | `:489` | In-call chat badge |
355
+ | `leaveSession()` | `:272` | End session, release tracks |
356
+
357
+ **Settings:** `SessionSettingsBuilder` (`src/builder/session_settings.dart`) — `setTitle` (`:155`), `startAudioMuted(bool)` (`:173`), `startVideoPaused(bool)` (`:167`), `setLayout(LayoutType)` (`:179`), `setIdleTimeoutPeriod(int seconds)` (`:185`), `setAudioMode(AudioMode)` (`:191`), and the `hide*Button(bool)` family (`:215`–`:305`). **NOT `CallSettingsBuilder`** (`@Deprecated`, `src/builder/call_settings.dart:209`).
358
+
359
+ **Listeners — register on `CallSession.getInstance()`:** the 5 split interfaces in `src/listener/`: `SessionStatusListeners`, `ParticipantEventListeners`, `MediaEventListeners`, `ButtonClickListeners`, `LayoutListeners`. **NOT the single `CometChatCallsEventsListener`** (`@Deprecated`, `src/listener/cometchat_calls_events_listener.dart:16`). See `references/call-session.md`.
360
+
361
+ > **Legacy 4.x-kit alternative (incompatible with the 5.x calls SDK).** `cometchat_calls_uikit` ships prebuilt `CometChatCallButtons` / `CometChatIncomingCall` / `CometChatOutgoingCall` / `CometChatOngoingCall` / `CometChatCallLogs` widgets and a `CometChatUIKitCalls` facade — but those are compiled against the **4.x** calls SDK (`cometchat_calls_sdk ^4.2.2`). They cannot be used with `cometchat_calls_sdk ^5.0.2`. Replicate their behavior with your own widgets bound to the raw 5.x API above. For call-log history, fetch via `CometChatCalls.getCallDetails(sessionId, ...)` or the Chat SDK `CallLogRequestBuilder` and render your own list.
334
362
 
335
363
  ---
336
364
 
@@ -342,62 +370,64 @@ When `product === "voice-video"` and there is no v5 chat integration.
342
370
 
343
371
  ### 4a. Standalone — Session mode (meeting-room UX, no ringing)
344
372
 
345
- Calls SDK ONLY. NO Chat SDK. Matches `~/Downloads/calls-sdk/calls-sdk-flutter-5/sample-apps/cometchat-calls-sample-app-flutter/`. Scaffold:
373
+ 5.x Calls SDK ONLY. The Chat SDK is present only as the source of the auth token used to log the Calls SDK in (rule 1.0). Scaffold:
346
374
 
347
- 1. **`pubspec.yaml`** — `cometchat_calls_sdk: ^5.0.0` ONLY. No `cometchat_chat_sdk` / `cometchat_uikit_chat`.
348
- 2. **`lib/main.dart`** — `CometChatCalls.init(appId, region, authKey)` + `permission_handler` flow.
349
- 3. **`lib/screens/call_screen.dart`** — `StatefulWidget implements SessionStatusListeners, ButtonClickListeners`. `CometChatCalls.joinSession(sessionId:, sessionSettings: SessionSettingsBuilder().build(), onSuccess:, onError:)`. `CometChatOngoingCallService.launch/abort`. See `references/call-session.md`.
375
+ 1. **`pubspec.yaml`** — `cometchat_calls_sdk: ^5.0.2` + `cometchat_chat_sdk` (for the auth token). No `cometchat_chat_uikit`, no `cometchat_calls_uikit`.
376
+ 2. **`lib/main.dart`** — `CometChat.init(...)` + `CometChat.login(...)`, then `CometChatCalls.init(callAppSettings, onSuccess:, onError:)` (build via `CallAppSettingBuilder()..appId=…..region=…`) + `CometChatCalls.loginWithAuthToken(authToken: ..., ...)` + `permission_handler` flow.
377
+ 3. **`lib/screens/call_screen.dart`** — `StatefulWidget` implementing the relevant 5.x split listeners (`SessionStatusListeners`, etc.). `CometChatCalls.joinSession(sessionId: ..., sessionSettings: SessionSettingsBuilder().build(), onSuccess:, onError:)`. Register listeners on `CallSession.getInstance()` in `onSuccess`. `CometChatOngoingCallService.launch/abort`. See `references/call-session.md`.
350
378
  4. **Native config** — Camera + microphone permissions only (no PushKit, no FCM for VoIP).
351
379
 
352
- **Why no Chat SDK / no VoIP push:** session mode never touches a Chat SDK call entity. No ringing.
380
+ **Why no chat UI Kit / no VoIP push:** session mode never touches a Chat SDK call entity. No ringing. The Chat SDK is present only to mint the auth token for `CometChatCalls.loginWithAuthToken`.
353
381
 
354
- ### 4b. Standalone — Ringing mode (CallKit + FCM + UIKit-driven UI)
382
+ ### 4b. Standalone — Ringing mode (CallKit + FCM + custom UI)
355
383
 
356
- Dual-SDK: Chat SDK signaling + Calls SDK media. Scaffold:
384
+ Dual-SDK: Chat SDK signaling + 5.x Calls SDK media. Scaffold:
357
385
 
358
- 1. **`lib/main.dart`** — Chat SDK + Calls SDK init (no UIKit). Permission_handler request flow. PushKit + FCM listener registration.
359
- 2. **`lib/services/voip_service.dart`** — Combines `flutter_callkit_incoming` events + `firebase_messaging` + iOS platform-channel PushKit. On payload → `FlutterCallkitIncoming.showCallkitIncoming(...)`. On accept → navigate to ongoing-call screen.
360
- 3. **`lib/widgets/call_button.dart`** — Voice + video icon buttons rendered next to a user / contact.
361
- 4. **`lib/screens/ongoing_call_screen.dart`** — `CometChatCalls.joinSession(sessionId:, sessionSettings:, onSuccess:, onError:)` with the returned Widget rendered via `SizedBox.expand`. Implements rule 1.5 cleanup. Sets `resizeToAvoidBottomInset: false`.
362
- 5. **`lib/screens/call_logs_screen.dart`** — `/calls` route. Paginated via `CallLogsRequestBuilder`.
363
- 6. **`MaterialApp.navigatorKey: CallNavigationContext.navigatorKey`** — rule 1.7.
386
+ 1. **`lib/main.dart`** — Chat SDK + 5.x Calls SDK init + dual login (rule 1.0). Permission_handler request flow. PushKit + FCM listener registration.
387
+ 2. **`lib/services/voip_service.dart`** — Combines `flutter_callkit_incoming` events + `firebase_messaging` + iOS platform-channel PushKit. On payload → `FlutterCallkitIncoming.showCallkitIncoming(...)`. On accept → `CometChat.acceptCall(sessionId)` → navigate to ongoing-call screen.
388
+ 3. **`lib/widgets/call_button.dart`** — Custom voice + video icon buttons `CometChat.initiateCall(...)`.
389
+ 4. **`lib/screens/ongoing_call_screen.dart`** — `CometChatCalls.joinSession(sessionId: ..., sessionSettings: ..., onSuccess:, onError:)` with the returned `Widget?` rendered via `SizedBox.expand`. Implements rule 1.5 cleanup (`CallSession.getInstance()?.leaveSession()`). Sets `resizeToAvoidBottomInset: false`.
390
+ 5. **`lib/screens/call_logs_screen.dart`** — `/calls` route. Custom list via Chat SDK `CallLogRequestBuilder` (or `CometChatCalls.getCallDetails`).
391
+ 6. **`MaterialApp.navigatorKey: navigatorKey`** — a plain `GlobalKey<NavigatorState>` (rule 1.7).
364
392
  7. **Native config** — `Info.plist` (rule 1.6), `AndroidManifest.xml` (rule 1.3 + FCM service registration), Firebase config (`google-services.json` in `android/app/`, `GoogleService-Info.plist` in `ios/Runner/`).
365
393
 
366
394
  ## 5. Additive integration
367
395
 
368
- When chat is already integrated. The skill:
396
+ When chat is already integrated (existing GetX `cometchat_chat_uikit`). The skill:
369
397
 
370
- 1. Adds `cometchat_calls_uikit` to `pubspec.yaml`.
371
- 2. Patches the existing `UIKitSettingsBuilder` to add `..callingExtension = CometChatCallingExtension()`.
372
- 3. Sets `CallNavigationContext.navigatorKey` on `MaterialApp.navigatorKey` (rule 1.7).
373
- 4. Mounts the global call listener in the app-shell `State` (rule 1.7).
374
- 5. Confirms `CometChatMessageHeader` already shows call buttons (auto-rendered when `user` / `group` is passed).
375
- 6. Optionally adds `CometChatCallLogs` as a tab/screen if user picked dedicated history.
398
+ 1. Adds **`cometchat_calls_sdk: ^5.0.2`** (raw, direct) to `pubspec.yaml` — NOT `cometchat_calls_uikit`.
399
+ 2. Inits + logs in the 5.x Calls SDK alongside the existing chat init/login (rules 1.0, 1.1).
400
+ 3. Sets a plain `GlobalKey<NavigatorState>` on `MaterialApp.navigatorKey` (rule 1.7).
401
+ 4. Mounts the global Chat SDK `CallListener` in the app-shell `State` (rule 1.7).
402
+ 5. Adds a **custom** call button (e.g. into `CometChatMessageHeader`'s trailing slot) `CometChat.initiateCall(...)`.
403
+ 6. Builds a custom ongoing-call screen around `CometChatCalls.joinSession` + `CallSession` controls (Section 3, `references/call-session.md`).
376
404
  7. VoIP push: opt-in (substantial native config).
377
405
 
378
406
  ## 6. Anti-patterns
379
407
 
380
- 1. **`MaterialApp` without `CallNavigationContext.navigatorKey`.** Call overlays can't navigate; in-app ring works but accept-into-ongoing breaks. Rule 1.7.
381
- 2. **Forgetting `..callingExtension = CometChatCallingExtension()`** on `UIKitSettingsBuilder`. Calls compile but `CometChatMessageHeader` doesn't show call icons; nothing rings. Most common additive-mode mistake.
382
- 3. **`onAccept` / `onDecline` typed as `Function(Call)`** instead of `Function(BuildContext, Call)`. Compile errors are obvious; the dangerous case is when an agent wraps an existing chat screen's accept handler and silently mismatches signatures.
408
+ 1. **`MaterialApp` without a global `navigatorKey`.** Call overlays can't navigate; in-app ring works but accept-into-ongoing breaks. Rule 1.7.
409
+ 2. **Adding `cometchat_calls_uikit` to get calls.** It pins `cometchat_calls_sdk ^4.2.2` and clashes with the 5.x SDK; its prebuilt call widgets are 4.x-bound. Use the raw 5.x SDK + custom surface.
410
+ 3. **`CallSettingsBuilder` / single `CometChatCallsEventsListener` / `CometChatCalls.startSession`.** All 4.x (the builder + listener are `@Deprecated` in 5.0.2). Use `SessionSettingsBuilder`, the 5 split listeners, and `joinSession`.
383
411
  4. **Per-screen incoming-call handling.** Calls only ring on the screen where the listener is attached. Listener belongs in the app shell (rule 1.7).
384
412
  5. **Skipping `resizeToAvoidBottomInset: false`** on Scaffolds with call UI. Keyboard-show during a call resizes WebRTC views and breaks layout.
385
- 6. **Mixing `cometchat_chat_uikit ^5.x` with `cometchat_calls_uikit ^4.x`** (or vice versa). Internal SDK pin clash. Both UI Kit packages must be on matching majors.
413
+ 6. **Calling in-call controls statically on `CometChatCalls`** (e.g. `CometChatCalls.muteAudio(...)`, `CometChatCalls.setLayout(...)`). In 5.x those are INSTANCE methods on `CallSession.getInstance()`.
386
414
  7. **Sending Android push as `notification`** instead of `data`. ConnectionService can't intercept `notification` payloads. Server must send `data: { type: "incoming_call", sessionId: ... }` with `priority: "high"`.
387
415
 
388
416
  ## 7. Verification checklist
389
417
 
390
418
  **Static:**
391
419
 
392
- - [ ] `cometchat_calls_uikit ^5.0.15` in `pubspec.yaml` (additive) OR `cometchat_calls_sdk ^4.2.2` + `cometchat_sdk ^4.1.2` (standalone)
393
- - [ ] `..callingExtension = CometChatCallingExtension()` on `UIKitSettingsBuilder` (additive)
394
- - [ ] `MaterialApp.navigatorKey` is `CallNavigationContext.navigatorKey`
395
- - [ ] Global call listener attached in app-shell State, removed in `dispose`
420
+ - [ ] `cometchat_calls_sdk ^5.0.2` is a DIRECT dependency in `pubspec.yaml`; `cometchat_calls_uikit` is ABSENT
421
+ - [ ] No `CallSettingsBuilder` / `CometChatCallsEventsListener` / `CometChatCalls.startSession` / `CometChatUIKitCalls` / `CometChatCallingExtension` anywhere (all 4.x)
422
+ - [ ] Lifecycle uses `CometChatCalls.init/loginWithAuthToken/joinSession`; settings via `SessionSettingsBuilder`; events via the 5 split listeners on `CallSession.getInstance()`
423
+ - [ ] In-call controls go through `CallSession.getInstance()?.X()`, not static `CometChatCalls.X()`
424
+ - [ ] `MaterialApp.navigatorKey` is a `GlobalKey<NavigatorState>`
425
+ - [ ] Global Chat SDK `CallListener` attached in app-shell State, removed in `dispose`
396
426
  - [ ] Listener uses a stable string ID
397
427
  - [ ] Camera + microphone + notification permissions requested via `permission_handler`
398
428
  - [ ] iOS `Info.plist`: NSCameraUsageDescription + NSMicrophoneUsageDescription + UIBackgroundModes (audio + voip + remote-notification)
399
429
  - [ ] Android manifest: four FOREGROUND_SERVICE_* permissions + MANAGE_OWN_CALLS + BIND_TELECOM_CONNECTION_SERVICE
400
- - [ ] Hangup path: `endSession()` + `FlutterCallkitIncoming.endAllCalls()` + `Navigator.popUntil` (rule 1.5)
430
+ - [ ] Hangup path: `CallSession.getInstance()?.leaveSession()` + `CometChatOngoingCallService.abort()` + `FlutterCallkitIncoming.endAllCalls()` + `Navigator.popUntil` (rule 1.5)
401
431
  - [ ] **Standalone only:** Firebase configured (`google-services.json` + `GoogleService-Info.plist`)
402
432
  - [ ] **Standalone only:** `flutter_callkit_incoming` + `firebase_messaging` + iOS PushKit platform-channel bridge
403
433