@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.
- package/LICENSE +21 -0
- package/README.md +33 -12
- package/bin/install.js +59 -4
- package/package.json +14 -1
- package/skills/cometchat/SKILL.md +460 -77
- package/skills/cometchat/references/asking-questions.md +48 -0
- package/skills/cometchat-a11y/SKILL.md +3 -2
- package/skills/cometchat-android-v5/SKILL.md +2 -1
- package/skills/cometchat-android-v5-calls/SKILL.md +36 -22
- package/skills/cometchat-android-v5-calls/references/README.md +1 -1
- package/skills/cometchat-android-v5-calls/references/add-calls-to-existing-chat.md +7 -5
- package/skills/cometchat-android-v5-calls/references/audio-controls.md +4 -4
- package/skills/cometchat-android-v5-calls/references/call-layouts.md +33 -25
- package/skills/cometchat-android-v5-calls/references/call-session.md +2 -2
- package/skills/cometchat-android-v5-calls/references/custom-ui.md +5 -5
- package/skills/cometchat-android-v5-calls/references/event-listeners.md +2 -2
- package/skills/cometchat-android-v5-calls/references/idle-timeout.md +20 -14
- package/skills/cometchat-android-v5-calls/references/in-call-chat.md +1 -1
- package/skills/cometchat-android-v5-calls/references/migration-v4-to-v5.md +43 -27
- package/skills/cometchat-android-v5-calls/references/participant-management.md +3 -3
- package/skills/cometchat-android-v5-calls/references/raise-hand.md +25 -19
- package/skills/cometchat-android-v5-calls/references/recording.md +2 -2
- package/skills/cometchat-android-v5-calls/references/ringing-integration.md +1 -1
- package/skills/cometchat-android-v5-calls/references/screen-sharing.md +5 -9
- package/skills/cometchat-android-v5-calls/references/session-settings.md +3 -3
- package/skills/cometchat-android-v5-calls/references/setup.md +1 -1
- package/skills/cometchat-android-v5-calls/references/share-invite.md +9 -4
- package/skills/cometchat-android-v5-calls/references/video-controls.md +4 -4
- package/skills/cometchat-android-v5-calls/references/voip-calling.md +2 -2
- package/skills/cometchat-android-v5-components/SKILL.md +4 -3
- package/skills/cometchat-android-v5-core/SKILL.md +20 -2
- package/skills/cometchat-android-v5-customization/SKILL.md +171 -7
- package/skills/cometchat-android-v5-extensions/SKILL.md +7 -4
- package/skills/cometchat-android-v5-features/SKILL.md +5 -4
- package/skills/cometchat-android-v5-placement/SKILL.md +2 -1
- package/skills/cometchat-android-v5-production/SKILL.md +2 -1
- package/skills/cometchat-android-v5-push/SKILL.md +2 -3
- package/skills/cometchat-android-v5-testing/SKILL.md +2 -1
- package/skills/cometchat-android-v5-theming/SKILL.md +2 -1
- package/skills/cometchat-android-v5-troubleshooting/SKILL.md +3 -2
- package/skills/cometchat-android-v6/SKILL.md +2 -1
- package/skills/cometchat-android-v6-builder-settings/SKILL.md +11 -7
- package/skills/cometchat-android-v6-calls/SKILL.md +79 -18
- package/skills/cometchat-android-v6-calls/references/advanced-features.md +87 -0
- package/skills/cometchat-android-v6-calls/references/call-layouts.md +24 -15
- package/skills/cometchat-android-v6-calls/references/call-session.md +2 -2
- package/skills/cometchat-android-v6-calls/references/device-management.md +17 -16
- package/skills/cometchat-android-v6-calls/references/idle-timeout.md +7 -4
- package/skills/cometchat-android-v6-calls/references/in-call-chat.md +13 -8
- package/skills/cometchat-android-v6-calls/references/raise-hand.md +6 -4
- package/skills/cometchat-android-v6-compose-components/SKILL.md +52 -29
- package/skills/cometchat-android-v6-compose-customization/SKILL.md +156 -1
- package/skills/cometchat-android-v6-compose-placement/SKILL.md +129 -40
- package/skills/cometchat-android-v6-compose-theming/SKILL.md +27 -1
- package/skills/cometchat-android-v6-core/SKILL.md +389 -9
- package/skills/cometchat-android-v6-events/SKILL.md +4 -1
- package/skills/cometchat-android-v6-extensions/SKILL.md +2 -1
- package/skills/cometchat-android-v6-features/SKILL.md +26 -2
- package/skills/cometchat-android-v6-kotlin-components/SKILL.md +31 -1
- package/skills/cometchat-android-v6-kotlin-customization/SKILL.md +172 -1
- package/skills/cometchat-android-v6-kotlin-placement/SKILL.md +20 -5
- package/skills/cometchat-android-v6-kotlin-theming/SKILL.md +36 -5
- package/skills/cometchat-android-v6-migration/SKILL.md +44 -42
- package/skills/cometchat-android-v6-production/SKILL.md +6 -3
- package/skills/cometchat-android-v6-push/SKILL.md +43 -2
- package/skills/cometchat-android-v6-testing/SKILL.md +11 -8
- package/skills/cometchat-android-v6-troubleshooting/SKILL.md +26 -5
- package/skills/cometchat-angular-calls/SKILL.md +256 -389
- package/skills/cometchat-angular-calls/references/add-calls-to-existing-chat.md +3 -2
- package/skills/cometchat-angular-calls/references/call-layouts.md +29 -12
- package/skills/cometchat-angular-calls/references/call-session.md +2 -2
- package/skills/cometchat-angular-calls/references/custom-ui.md +18 -10
- package/skills/cometchat-angular-calls/references/device-management.md +53 -34
- package/skills/cometchat-angular-calls/references/group-calls.md +45 -24
- package/skills/cometchat-angular-calls/references/idle-timeout.md +31 -15
- package/skills/cometchat-angular-calls/references/ngzone-and-async-callbacks.md +7 -6
- package/skills/cometchat-angular-calls/references/raise-hand.md +9 -4
- package/skills/cometchat-angular-calls/references/recording-screen-share.md +32 -39
- package/skills/cometchat-angular-calls/references/ringing-integration.md +3 -1
- package/skills/cometchat-angular-calls/references/share-invite.md +11 -5
- package/skills/cometchat-angular-calls/references/virtual-background.md +29 -0
- package/skills/cometchat-angular-components/SKILL.md +149 -620
- package/skills/cometchat-angular-core/SKILL.md +235 -293
- package/skills/cometchat-angular-customization/SKILL.md +415 -223
- package/skills/cometchat-angular-features/SKILL.md +216 -334
- package/skills/cometchat-angular-patterns/SKILL.md +168 -359
- package/skills/cometchat-angular-placement/SKILL.md +189 -560
- package/skills/cometchat-angular-production/SKILL.md +241 -92
- package/skills/cometchat-angular-push/SKILL.md +280 -294
- package/skills/cometchat-angular-testing/SKILL.md +430 -158
- package/skills/cometchat-angular-theming/SKILL.md +190 -265
- package/skills/cometchat-angular-troubleshooting/SKILL.md +192 -157
- package/skills/cometchat-astro-patterns/SKILL.md +22 -1
- package/skills/cometchat-calls/SKILL.md +25 -19
- package/skills/cometchat-calls/references/use-case-broadcast.md +15 -10
- package/skills/cometchat-calls/references/use-case-marketplace.md +2 -3
- package/skills/cometchat-calls/references/use-case-support.md +3 -4
- package/skills/cometchat-calls/references/use-case-team.md +23 -12
- package/skills/cometchat-calls/references/use-case-telehealth.md +3 -4
- package/skills/cometchat-components/SKILL.md +163 -25
- package/skills/cometchat-core/SKILL.md +412 -13
- package/skills/cometchat-customization/SKILL.md +50 -25
- package/skills/cometchat-features/SKILL.md +313 -34
- package/skills/cometchat-flutter-v5/SKILL.md +10 -4
- package/skills/cometchat-flutter-v5-calls/SKILL.md +188 -158
- package/skills/cometchat-flutter-v5-calls/references/add-calls-to-existing-chat.md +48 -24
- package/skills/cometchat-flutter-v5-calls/references/call-layouts.md +20 -15
- package/skills/cometchat-flutter-v5-calls/references/call-session.md +100 -145
- package/skills/cometchat-flutter-v5-calls/references/device-management.md +12 -8
- package/skills/cometchat-flutter-v5-calls/references/group-calls.md +30 -36
- package/skills/cometchat-flutter-v5-calls/references/idle-timeout.md +15 -13
- package/skills/cometchat-flutter-v5-calls/references/in-call-chat.md +12 -9
- package/skills/cometchat-flutter-v5-calls/references/migration-v4-to-v5.md +115 -65
- package/skills/cometchat-flutter-v5-calls/references/raise-hand.md +41 -30
- package/skills/cometchat-flutter-v5-calls/references/ringing-integration.md +17 -14
- package/skills/cometchat-flutter-v5-calls/references/share-invite.md +8 -2
- package/skills/cometchat-flutter-v5-conversations/SKILL.md +2 -1
- package/skills/cometchat-flutter-v5-core/SKILL.md +20 -2
- package/skills/cometchat-flutter-v5-customization/SKILL.md +136 -5
- package/skills/cometchat-flutter-v5-events/SKILL.md +2 -1
- package/skills/cometchat-flutter-v5-messages/SKILL.md +2 -1
- package/skills/cometchat-flutter-v5-production/SKILL.md +15 -6
- package/skills/cometchat-flutter-v5-push/SKILL.md +2 -1
- package/skills/cometchat-flutter-v5-testing/SKILL.md +17 -6
- package/skills/cometchat-flutter-v5-theming/SKILL.md +2 -1
- package/skills/cometchat-flutter-v5-troubleshooting/SKILL.md +7 -6
- package/skills/cometchat-flutter-v5-users-groups/SKILL.md +3 -2
- package/skills/cometchat-flutter-v6/SKILL.md +17 -16
- package/skills/cometchat-flutter-v6-calls/SKILL.md +78 -63
- package/skills/cometchat-flutter-v6-calls/references/add-calls-to-existing-chat.md +8 -6
- package/skills/cometchat-flutter-v6-calls/references/advanced-features.md +89 -0
- package/skills/cometchat-flutter-v6-calls/references/call-layouts.md +15 -12
- package/skills/cometchat-flutter-v6-calls/references/call-session.md +2 -2
- package/skills/cometchat-flutter-v6-calls/references/device-management.md +9 -3
- package/skills/cometchat-flutter-v6-calls/references/group-calls.md +10 -10
- package/skills/cometchat-flutter-v6-calls/references/idle-timeout.md +15 -7
- package/skills/cometchat-flutter-v6-calls/references/in-call-chat.md +6 -3
- package/skills/cometchat-flutter-v6-calls/references/raise-hand.md +23 -16
- package/skills/cometchat-flutter-v6-components/SKILL.md +32 -11
- package/skills/cometchat-flutter-v6-conversations/SKILL.md +39 -11
- package/skills/cometchat-flutter-v6-core/SKILL.md +348 -10
- package/skills/cometchat-flutter-v6-customization/SKILL.md +97 -25
- package/skills/cometchat-flutter-v6-events/SKILL.md +3 -2
- package/skills/cometchat-flutter-v6-features/SKILL.md +15 -6
- package/skills/cometchat-flutter-v6-messages/SKILL.md +111 -60
- package/skills/cometchat-flutter-v6-migration/SKILL.md +18 -25
- package/skills/cometchat-flutter-v6-placement/SKILL.md +79 -50
- package/skills/cometchat-flutter-v6-production/SKILL.md +13 -12
- package/skills/cometchat-flutter-v6-push/SKILL.md +43 -21
- package/skills/cometchat-flutter-v6-testing/SKILL.md +6 -6
- package/skills/cometchat-flutter-v6-theming/SKILL.md +38 -5
- package/skills/cometchat-flutter-v6-troubleshooting/SKILL.md +182 -17
- package/skills/cometchat-flutter-v6-users-groups/SKILL.md +12 -4
- package/skills/cometchat-i18n/SKILL.md +139 -78
- package/skills/cometchat-ios/SKILL.md +4 -2
- package/skills/cometchat-ios-calls/SKILL.md +225 -95
- package/skills/cometchat-ios-calls/references/add-calls-to-existing-chat.md +11 -9
- package/skills/cometchat-ios-calls/references/audio-modes-and-controls.md +45 -0
- package/skills/cometchat-ios-calls/references/avaudiosession-routing.md +6 -7
- package/skills/cometchat-ios-calls/references/call-layouts.md +31 -91
- package/skills/cometchat-ios-calls/references/call-session.md +51 -54
- package/skills/cometchat-ios-calls/references/callkit-and-pushkit.md +33 -29
- package/skills/cometchat-ios-calls/references/custom-ui.md +38 -38
- package/skills/cometchat-ios-calls/references/group-calls.md +33 -70
- package/skills/cometchat-ios-calls/references/idle-timeout.md +24 -25
- package/skills/cometchat-ios-calls/references/in-call-chat.md +19 -23
- package/skills/cometchat-ios-calls/references/migration-v4-to-v5.md +128 -70
- package/skills/cometchat-ios-calls/references/picture-in-picture.md +20 -20
- package/skills/cometchat-ios-calls/references/raise-hand.md +14 -227
- package/skills/cometchat-ios-calls/references/recording-screen-share.md +35 -122
- package/skills/cometchat-ios-calls/references/ringing-integration.md +17 -16
- package/skills/cometchat-ios-calls/references/share-invite.md +8 -12
- package/skills/cometchat-ios-calls/references/swiftui-uikit-hosting.md +4 -4
- package/skills/cometchat-ios-components/SKILL.md +200 -12
- package/skills/cometchat-ios-core/SKILL.md +281 -11
- package/skills/cometchat-ios-customization/SKILL.md +276 -110
- package/skills/cometchat-ios-features/SKILL.md +64 -36
- package/skills/cometchat-ios-placement/SKILL.md +15 -12
- package/skills/cometchat-ios-production/SKILL.md +12 -4
- package/skills/cometchat-ios-push/SKILL.md +53 -19
- package/skills/cometchat-ios-testing/SKILL.md +14 -9
- package/skills/cometchat-ios-theming/SKILL.md +39 -3
- package/skills/cometchat-ios-troubleshooting/SKILL.md +41 -21
- package/skills/cometchat-native-bare-patterns/SKILL.md +56 -18
- package/skills/cometchat-native-calls/SKILL.md +89 -19
- package/skills/cometchat-native-calls/references/add-calls-to-existing-chat.md +2 -2
- package/skills/cometchat-native-calls/references/call-layouts.md +15 -14
- package/skills/cometchat-native-calls/references/call-session.md +2 -2
- package/skills/cometchat-native-calls/references/custom-ui.md +12 -8
- package/skills/cometchat-native-calls/references/device-management.md +53 -30
- package/skills/cometchat-native-calls/references/group-calls.md +35 -30
- package/skills/cometchat-native-calls/references/idle-timeout.md +6 -6
- package/skills/cometchat-native-calls/references/in-call-chat.md +10 -8
- package/skills/cometchat-native-calls/references/migration-v4-to-v5.md +2 -2
- package/skills/cometchat-native-calls/references/raise-hand.md +15 -13
- package/skills/cometchat-native-calls/references/recording-screen-share.md +49 -170
- package/skills/cometchat-native-calls/references/share-invite.md +7 -5
- package/skills/cometchat-native-calls/references/voip-push-end-to-end.md +4 -2
- package/skills/cometchat-native-components/SKILL.md +91 -57
- package/skills/cometchat-native-core/SKILL.md +281 -9
- package/skills/cometchat-native-customization/SKILL.md +150 -28
- package/skills/cometchat-native-expo-patterns/SKILL.md +77 -27
- package/skills/cometchat-native-features/SKILL.md +79 -49
- package/skills/cometchat-native-placement/SKILL.md +19 -10
- package/skills/cometchat-native-production/SKILL.md +9 -3
- package/skills/cometchat-native-push/SKILL.md +2 -1
- package/skills/cometchat-native-testing/SKILL.md +1 -2
- package/skills/cometchat-native-theming/SKILL.md +54 -29
- package/skills/cometchat-native-troubleshooting/SKILL.md +71 -3
- package/skills/cometchat-nextjs-patterns/SKILL.md +48 -6
- package/skills/cometchat-placement/SKILL.md +42 -3
- package/skills/cometchat-production/SKILL.md +12 -5
- package/skills/cometchat-react-calls/SKILL.md +220 -10
- package/skills/cometchat-react-calls/references/add-calls-to-existing-chat.md +4 -3
- package/skills/cometchat-react-calls/references/call-layouts.md +5 -6
- package/skills/cometchat-react-calls/references/call-session.md +1 -1
- package/skills/cometchat-react-calls/references/custom-ui.md +61 -15
- package/skills/cometchat-react-calls/references/device-management.md +55 -51
- package/skills/cometchat-react-calls/references/group-calls.md +18 -23
- package/skills/cometchat-react-calls/references/idle-timeout.md +25 -12
- package/skills/cometchat-react-calls/references/in-call-chat.md +7 -7
- package/skills/cometchat-react-calls/references/migration-v4-to-v5.md +9 -11
- package/skills/cometchat-react-calls/references/raise-hand.md +14 -14
- package/skills/cometchat-react-calls/references/recording-screen-share.md +39 -38
- package/skills/cometchat-react-calls/references/ringing-integration.md +2 -2
- package/skills/cometchat-react-calls/references/share-invite.md +4 -5
- package/skills/cometchat-react-calls/references/testing-calls-on-web.md +20 -2
- package/skills/cometchat-react-calls/references/virtual-background.md +32 -0
- package/skills/cometchat-react-patterns/SKILL.md +57 -4
- package/skills/cometchat-react-push/SKILL.md +258 -72
- package/skills/cometchat-react-router-patterns/SKILL.md +43 -4
- package/skills/cometchat-react-testing/SKILL.md +14 -5
- package/skills/cometchat-theming/SKILL.md +181 -18
- 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 #
|
|
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
|
|
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;
|
|
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
|
|
18
|
-
- **Additive** — calls layered onto an existing v5 chat integration.
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
//
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
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
|
-
|
|
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
|
-
-
|
|
74
|
-
-
|
|
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 —
|
|
77
|
+
### 1.1 Dual-SDK contract — Chat SDK signals, Calls SDK (5.x) does WebRTC
|
|
77
78
|
|
|
78
|
-
|
|
79
|
+
Both modes integrate the **raw 5.x calls SDK** directly (no calling-extension widget — that'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 —
|
|
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
|
-
|
|
99
|
-
final
|
|
100
|
-
|
|
101
|
-
//
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
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
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
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
|
|
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
|
-
|
|
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.
|
|
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.
|
|
169
|
-
//
|
|
170
|
-
//
|
|
171
|
-
|
|
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 +
|
|
212
|
+
### 1.7 IncomingCall mounted at app root + a global navigator key
|
|
214
213
|
|
|
215
|
-
|
|
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:
|
|
221
|
+
navigatorKey: navigatorKey,
|
|
221
222
|
// ...
|
|
222
223
|
);
|
|
223
224
|
```
|
|
224
225
|
|
|
225
|
-
|
|
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
|
-
//
|
|
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 —
|
|
265
|
-
|
|
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
|
-
|
|
276
|
+
cometchat_calls_sdk:
|
|
276
277
|
hosted: https://dart.cloudsmith.io/cometchat/cometchat/
|
|
277
|
-
version: ^5.0.
|
|
278
|
+
version: ^5.0.2
|
|
278
279
|
```
|
|
279
280
|
|
|
280
|
-
Init order —
|
|
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
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
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
|
-
|
|
302
|
-
|
|
303
|
-
|
|
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.
|
|
314
|
+
## 3. The raw 5.x calls surface (custom UI)
|
|
309
315
|
|
|
310
|
-
|
|
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:
|
|
319
|
+
import 'package:cometchat_calls_sdk/cometchat_calls_sdk.dart';
|
|
314
320
|
```
|
|
315
321
|
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
|
321
|
-
|
|
322
|
-
| `
|
|
323
|
-
|
|
324
|
-
`
|
|
325
|
-
|
|
326
|
-
|
|
|
327
|
-
|
|
328
|
-
| `
|
|
329
|
-
| `
|
|
330
|
-
| `
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
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<bool>) |
|
|
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.
|
|
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.
|
|
348
|
-
2. **`lib/main.dart`** — `CometChatCalls.init(
|
|
349
|
-
3. **`lib/screens/call_screen.dart`** — `StatefulWidget
|
|
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
|
|
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 +
|
|
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 (
|
|
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`** —
|
|
361
|
-
4. **`lib/screens/ongoing_call_screen.dart`** — `CometChatCalls.joinSession(sessionId
|
|
362
|
-
5. **`lib/screens/call_logs_screen.dart`** — `/calls` route.
|
|
363
|
-
6. **`MaterialApp.navigatorKey:
|
|
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
|
|
371
|
-
2.
|
|
372
|
-
3. Sets `
|
|
373
|
-
4. Mounts the global
|
|
374
|
-
5.
|
|
375
|
-
6.
|
|
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 `
|
|
381
|
-
2. **
|
|
382
|
-
3. **`
|
|
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. **
|
|
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
|
-
- [ ] `
|
|
393
|
-
- [ ]
|
|
394
|
-
- [ ] `
|
|
395
|
-
- [ ]
|
|
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: `
|
|
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
|
|