@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
|
@@ -8,14 +8,15 @@ description: >
|
|
|
8
8
|
Also use when seeing imports from cometchat_calls_uikit, get/get.dart, or v5-era patterns
|
|
9
9
|
like GetBuilder, Get.put, Get.find, PageManager, BuilderSettings, or CometChatCallingExtension.
|
|
10
10
|
license: "MIT"
|
|
11
|
-
compatibility: "cometchat_chat_uikit 6.0.
|
|
12
|
-
allowed-tools: "shell, file-read, file-search, file-list, grep"
|
|
11
|
+
compatibility: "cometchat_chat_uikit 6.0.1"
|
|
13
12
|
metadata:
|
|
14
13
|
author: "CometChat"
|
|
15
14
|
version: "3.0.0"
|
|
16
15
|
tags: "cometchat flutter migration v5 v6 getx removal upgrade consumer"
|
|
17
16
|
---
|
|
18
17
|
|
|
18
|
+
> **Ground truth:** `cometchat_chat_uikit: ^6.0` — pub-cache source + `ui-kit/flutter`. **Official docs:** https://www.cometchat.com/docs/ui-kit/flutter/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.
|
|
19
|
+
|
|
19
20
|
# CometChat Flutter — v5 to v6 Migration
|
|
20
21
|
|
|
21
22
|
Complete guide for migrating a consumer app from UIKit v5 to v6.
|
|
@@ -28,7 +29,7 @@ Complete guide for migrating a consumer app from UIKit v5 to v6.
|
|
|
28
29
|
| State | GetX (`Get.put`, `GetBuilder`, `Obx`, `.obs`, `RxBool`) | Plain `StatefulWidget` + `setState()` |
|
|
29
30
|
| Navigation | `PageManager` (GetxController singleton) | Direct `Navigator.push` |
|
|
30
31
|
| Init | `InitializeCometChat.init()` + `CometChatCallingExtension()` + `extensions` + `aiFeature` | Inline `CometChatUIKit.init()` + `enableCalls: true` + `CallingConfiguration()` |
|
|
31
|
-
| Calls SDK init | `CometChatCallingExtension()` in extensions list | `
|
|
32
|
+
| Calls SDK init | `CometChatCallingExtension()` in extensions list | Automatic via `..enableCalls = true` on `UIKitSettingsBuilder` (kit auto-invokes `CallEventService` internally on both fresh login and cached-session restore; no manual init required) |
|
|
32
33
|
| Screens | Separate controller + widget files per screen | Single file, state in StatefulWidget |
|
|
33
34
|
| Dashboard | `MyHomePage`/`MyPageView` with GetX `PageManager` | `HomeScreen` with `IndexedStack` |
|
|
34
35
|
| Messages | `MessagesSample` + `CometChatMessagesController` | `MessagesScreen` with listener mixins |
|
|
@@ -36,7 +37,7 @@ Complete guide for migrating a consumer app from UIKit v5 to v6.
|
|
|
36
37
|
| Notifications | `VoipNotificationHandler`, `APNSService` | `VoipCallHandler`, `ApnsService` |
|
|
37
38
|
| Extra deps | `get`, `google_sign_in`, `firebase_auth`, `bugsee_flutter`, `shared_preferences`, `toast`, `mobile_scanner`, `app_badge_plus` | None of these |
|
|
38
39
|
| Localization | `cc.Translations.delegate` + `GlobalMaterialLocalizations` in MaterialApp | Handled by UIKit internally |
|
|
39
|
-
| Call screen | `callMain()` entry point + `CallApp` + `CallScreen` widget | `CometChatOngoingCall` widget for the in-call UI + `
|
|
40
|
+
| Call screen | `callMain()` entry point + `CallApp` + `CallScreen` widget | `CometChatOngoingCall` widget for the in-call UI + the kit's `IncomingCallOverlay` (imperative singleton automatically invoked by `CallEventService` when `enableCalls = true` — do NOT mount it manually). No separate Dart entry point. |
|
|
40
41
|
| Android minSdk | 24 | 26 (required by `cometchat_calls_sdk`) |
|
|
41
42
|
|
|
42
43
|
## Step 1: pubspec.yaml
|
|
@@ -58,11 +59,10 @@ dependencies:
|
|
|
58
59
|
mobile_scanner: ^7.1.2
|
|
59
60
|
app_badge_plus: ^1.2.6
|
|
60
61
|
|
|
61
|
-
# ✅ v6
|
|
62
|
+
# ✅ v6 — GA is on pub.dev; use a plain dependency (NOT a Cloudsmith `hosted:` stanza,
|
|
63
|
+
# which only carries the pre-GA 6.0.0-beta* builds and fails version solving for ^6.0.x).
|
|
62
64
|
dependencies:
|
|
63
|
-
cometchat_chat_uikit:
|
|
64
|
-
hosted: https://dart.cloudsmith.io/cometchat/cometchat/
|
|
65
|
-
version: 6.0.0-beta2
|
|
65
|
+
cometchat_chat_uikit: ^6.0.1 # resolves 6.0.1/6.0.2/6.0.3 from pub.dev
|
|
66
66
|
firebase_core: ^3.9.0
|
|
67
67
|
firebase_crashlytics: ^4.1.3
|
|
68
68
|
firebase_messaging: ^15.1.6
|
|
@@ -120,17 +120,7 @@ CometChatUIKit.init(uiKitSettings: settings, onSuccess: (_) { ... });
|
|
|
120
120
|
|
|
121
121
|
### Calls SDK Init for Cached Sessions
|
|
122
122
|
|
|
123
|
-
|
|
124
|
-
// ❌ v5 — CometChatCallingExtension handled it automatically
|
|
125
|
-
|
|
126
|
-
// ✅ v6 — explicit init needed when restoring cached session (no login call)
|
|
127
|
-
Future<void> _initCallsSdk() async {
|
|
128
|
-
await CallEventService.instance.init(
|
|
129
|
-
configuration: CallingConfiguration(),
|
|
130
|
-
);
|
|
131
|
-
}
|
|
132
|
-
// Call after checking getLoggedInUser() returns non-null
|
|
133
|
-
```
|
|
123
|
+
With `..enableCalls = true` on `UIKitSettingsBuilder`, the kit invokes `CallEventService.instance.init(...)` automatically for BOTH fresh logins AND cached-session restores (verified in `cometchat_chat_uikit-6.0.1/lib/shared_ui/src/cometchat_ui_kit/cometchat_ui_kit.dart` lines 170–179 — `_initiateAfterLogin()` is called from both `CometChatUIKit.init` cached-user branch and `CometChatUIKit.login`). No manual `CallEventService.instance.init()` call is required or recommended.
|
|
134
124
|
|
|
135
125
|
## Step 4: Remove GetX
|
|
136
126
|
|
|
@@ -290,7 +280,7 @@ MaterialApp(
|
|
|
290
280
|
)
|
|
291
281
|
```
|
|
292
282
|
|
|
293
|
-
Remove the `callMain()` entry point and `CallApp`/`CallScreen` widget entirely. V6 renders the in-call UI via the `CometChatOngoingCall` widget (placed in your widget tree once the call is active) and presents incoming calls via `
|
|
283
|
+
Remove the `callMain()` entry point and `CallApp`/`CallScreen` widget entirely. V6 renders the in-call UI via the `CometChatOngoingCall` widget (placed in your widget tree once the call is active) and presents incoming calls via the `IncomingCallOverlay` widget. (The kit DOES expose `CallScreenOverlay.show(...)` — `call_ui/src/ongoing_call/call_screen_overlay.dart` — which it uses internally for the outgoing→in-call transition.)
|
|
294
284
|
|
|
295
285
|
## Step 8: Update Notification Services
|
|
296
286
|
|
|
@@ -313,12 +303,15 @@ await VoipCallHandler.instance.markSdkReady(); // after login
|
|
|
313
303
|
## Step 9: resizeToAvoidBottomInset
|
|
314
304
|
|
|
315
305
|
```dart
|
|
316
|
-
// ❌ v5 —
|
|
306
|
+
// ❌ v5 — SafeArea wrapping around the composer
|
|
317
307
|
Scaffold(body: SafeArea(child: Column(children: [messageList, composer])))
|
|
318
308
|
|
|
319
|
-
// ✅ v6 —
|
|
309
|
+
// ✅ v6 on ^6.0.1 — true (or omit; true is the default). The composer clamps
|
|
310
|
+
// the keyboard height to viewInsets (kit fix ENG-34434), so true does NOT
|
|
311
|
+
// double-compensate. (false was only the pre-6.0.1 workaround — if you still
|
|
312
|
+
// see a double keyboard gap, upgrade the kit.)
|
|
320
313
|
Scaffold(
|
|
321
|
-
resizeToAvoidBottomInset:
|
|
314
|
+
resizeToAvoidBottomInset: true,
|
|
322
315
|
body: Column(children: [Expanded(child: messageList), composer]),
|
|
323
316
|
)
|
|
324
317
|
```
|
|
@@ -356,7 +349,7 @@ android.enableJetifier=true // Required for support library conflicts
|
|
|
356
349
|
- `CallSettingsBuilder` is renamed to `SessionSettingsBuilder` with different API: `.setLayout(LayoutType.tile)` instead of `..enableDefaultLayout = true`.
|
|
357
350
|
- v6 `CometChatMessageList` doesn't have `messageId` param — use `goToMessageId` instead.
|
|
358
351
|
- `CometChatBannedMembers`, `CometChatCallLogParticipants`, `CometChatCallLogRecordings`, `CometChatCallLogHistory` are not exported as standalone widgets in v6.
|
|
359
|
-
- The `callMain()` entry point pattern (separate Dart entry point for Android CallActivity) is gone. V6 renders the in-call UI via the `CometChatOngoingCall` widget within your existing app navigator + `
|
|
352
|
+
- The `callMain()` entry point pattern (separate Dart entry point for Android CallActivity) is gone. V6 renders the in-call UI via the `CometChatOngoingCall` widget within your existing app navigator + the `IncomingCallOverlay` widget for incoming-call UI.
|
|
360
353
|
- `FormatPatterns.stripFormatting()` doesn't exist in v6. Use `MarkdownTextFormatter` instead.
|
|
361
354
|
|
|
362
355
|
## Checklist
|
|
@@ -374,7 +367,7 @@ android.enableJetifier=true // Required for support library conflicts
|
|
|
374
367
|
- [ ] Update `MaterialApp` — remove localization delegates, remove `BuilderTypography`
|
|
375
368
|
- [ ] Remove `callMain()` entry point and `CallScreen` widget
|
|
376
369
|
- [ ] `CallSettingsBuilder` → `SessionSettingsBuilder`
|
|
377
|
-
- [ ] `resizeToAvoidBottomInset:
|
|
370
|
+
- [ ] `resizeToAvoidBottomInset: true` (or omitted) on Scaffolds with composer on `^6.0.1` — composer clamps to `viewInsets` (ENG-34434); `false` is only the pre-6.0.1 stopgap
|
|
378
371
|
- [ ] Android `minSdk` = 26
|
|
379
372
|
- [ ] Android `enableJetifier = true`
|
|
380
373
|
- [ ] Delete all unused v5 files
|
|
@@ -9,14 +9,15 @@ description: >
|
|
|
9
9
|
"tab bar with chat", "chat in modal", "chat in drawer", "embedded chat",
|
|
10
10
|
"Scaffold layout", or "keyboard handling".
|
|
11
11
|
license: "MIT"
|
|
12
|
-
compatibility: "cometchat_chat_uikit ^6.0.
|
|
13
|
-
allowed-tools: "shell, file-read, file-search, file-list, grep"
|
|
12
|
+
compatibility: "cometchat_chat_uikit ^6.0.1; flutter >=2.5.0"
|
|
14
13
|
metadata:
|
|
15
14
|
author: "CometChat"
|
|
16
15
|
version: "3.0.0"
|
|
17
16
|
tags: "cometchat flutter placement route modal drawer tabs scaffold keyboard layout"
|
|
18
17
|
---
|
|
19
18
|
|
|
19
|
+
> **Ground truth:** `cometchat_chat_uikit: ^6.0` widgets + `docs/ui-kit/flutter`. **Official docs:** https://www.cometchat.com/docs/ui-kit/flutter/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.
|
|
20
|
+
|
|
20
21
|
# CometChat Flutter UIKit — Placement
|
|
21
22
|
|
|
22
23
|
WHERE to put CometChat in your Flutter app. Five patterns, each with complete code.
|
|
@@ -144,20 +145,24 @@ class _MessagesScreenState extends State<MessagesScreen> {
|
|
|
144
145
|
|
|
145
146
|
@override
|
|
146
147
|
Widget build(BuildContext context) {
|
|
148
|
+
final colorPalette = CometChatThemeHelper.getColorPalette(context);
|
|
147
149
|
return Scaffold(
|
|
148
|
-
resizeToAvoidBottomInset:
|
|
150
|
+
resizeToAvoidBottomInset: true, // matches sample app; composer clamps to viewInsets (ENG-34434)
|
|
149
151
|
appBar: CometChatMessageHeader(
|
|
150
152
|
user: _user,
|
|
151
153
|
group: _group,
|
|
152
154
|
onBack: () => Navigator.pop(context),
|
|
153
155
|
),
|
|
154
156
|
body: SafeArea(
|
|
155
|
-
|
|
156
|
-
child:
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
157
|
+
top: false, // Header is the appBar — top inset already handled; keep bottom inset
|
|
158
|
+
child: Container(
|
|
159
|
+
color: colorPalette.background3,
|
|
160
|
+
child: Column(
|
|
161
|
+
children: [
|
|
162
|
+
Expanded(child: CometChatMessageList(user: _user, group: _group)),
|
|
163
|
+
CometChatMessageComposer(user: _user, group: _group),
|
|
164
|
+
],
|
|
165
|
+
),
|
|
161
166
|
),
|
|
162
167
|
),
|
|
163
168
|
);
|
|
@@ -167,8 +172,8 @@ class _MessagesScreenState extends State<MessagesScreen> {
|
|
|
167
172
|
|
|
168
173
|
### Critical Scaffold Rules
|
|
169
174
|
|
|
170
|
-
1. `resizeToAvoidBottomInset:
|
|
171
|
-
2. `SafeArea(
|
|
175
|
+
1. `resizeToAvoidBottomInset: true` (or omit — `true` is the Scaffold default) — matches the kit sample app (`messages_screen.dart` defaults it; `thread_screen.dart` sets it `true`). The composer clamps the native keyboard height to Flutter's `viewInsets` (kit fix ENG-34434), so `true` does NOT double-compensate on `^6.0.1`. (Pre-6.0.1 kits double-compensated with `true`; `false` was the old workaround — if you see a double keyboard gap, upgrade the kit.)
|
|
176
|
+
2. `SafeArea(top: false)` wrapping `Container(color: colorPalette.background3, ...)` — the header is the `appBar`, so the top inset is already handled; keep the bottom inset. The `background3` container gives the list/composer the correct surface color.
|
|
172
177
|
3. Mutable `_user`/`_group` — Keep mutable copies in State, not `widget.user`/`widget.group`. Update from SDK listeners for block/kick/scope changes.
|
|
173
178
|
|
|
174
179
|
---
|
|
@@ -191,33 +196,41 @@ class ThreadScreen extends StatelessWidget {
|
|
|
191
196
|
|
|
192
197
|
@override
|
|
193
198
|
Widget build(BuildContext context) {
|
|
199
|
+
final colorPalette = CometChatThemeHelper.getColorPalette(context);
|
|
194
200
|
return Scaffold(
|
|
195
|
-
resizeToAvoidBottomInset:
|
|
201
|
+
resizeToAvoidBottomInset: true, // same as messages screen
|
|
196
202
|
appBar: CometChatMessageHeader(
|
|
197
203
|
user: user, group: group,
|
|
198
204
|
onBack: () => Navigator.pop(context),
|
|
199
205
|
),
|
|
200
206
|
body: SafeArea(
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
207
|
+
child: Container(
|
|
208
|
+
color: colorPalette.background3,
|
|
209
|
+
child: Column(
|
|
210
|
+
children: [
|
|
211
|
+
CometChatThreadedHeader(
|
|
212
|
+
parentMessage: message,
|
|
213
|
+
loggedInUser: CometChatUIKit.loggedInUser!,
|
|
214
|
+
template: template,
|
|
215
|
+
),
|
|
216
|
+
Expanded(
|
|
217
|
+
child: CometChatMessageList(
|
|
218
|
+
user: user, group: group,
|
|
219
|
+
parentMessageId: message.id,
|
|
220
|
+
// Scope the list to this thread only: exclude the parent and
|
|
221
|
+
// request just the replies for message.id.
|
|
222
|
+
withParent: false,
|
|
223
|
+
messagesRequestBuilder: MessagesRequestBuilder()
|
|
224
|
+
..parentMessageId = message.id,
|
|
225
|
+
hideReplyInThreadOption: true,
|
|
226
|
+
),
|
|
227
|
+
),
|
|
228
|
+
CometChatMessageComposer(
|
|
211
229
|
user: user, group: group,
|
|
212
230
|
parentMessageId: message.id,
|
|
213
|
-
hideReplyInThreadOption: true,
|
|
214
231
|
),
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
user: user, group: group,
|
|
218
|
-
parentMessageId: message.id,
|
|
219
|
-
),
|
|
220
|
-
],
|
|
232
|
+
],
|
|
233
|
+
),
|
|
221
234
|
),
|
|
222
235
|
),
|
|
223
236
|
);
|
|
@@ -254,7 +267,7 @@ void _openChatModal(BuildContext context, User user) {
|
|
|
254
267
|
builder: (_) => SizedBox(
|
|
255
268
|
height: MediaQuery.sizeOf(context).height * 0.85,
|
|
256
269
|
child: Scaffold(
|
|
257
|
-
resizeToAvoidBottomInset:
|
|
270
|
+
resizeToAvoidBottomInset: true, // same rule applies to the inner Scaffold
|
|
258
271
|
appBar: CometChatMessageHeader(
|
|
259
272
|
user: user,
|
|
260
273
|
onBack: () => Navigator.pop(context),
|
|
@@ -274,7 +287,7 @@ void _openChatModal(BuildContext context, User user) {
|
|
|
274
287
|
**Key details:**
|
|
275
288
|
- `isScrollControlled: true` — allows the sheet to be taller than half screen
|
|
276
289
|
- `useSafeArea: true` — respects notch/status bar
|
|
277
|
-
- Inner `Scaffold`
|
|
290
|
+
- Inner `Scaffold` uses `resizeToAvoidBottomInset: true` (same as the messages screen)
|
|
278
291
|
- Use `MediaQuery.sizeOf(context)` not `MediaQuery.of(context).size`
|
|
279
292
|
|
|
280
293
|
---
|
|
@@ -291,7 +304,7 @@ class SplitView extends StatelessWidget {
|
|
|
291
304
|
@override
|
|
292
305
|
Widget build(BuildContext context) {
|
|
293
306
|
return Scaffold(
|
|
294
|
-
resizeToAvoidBottomInset:
|
|
307
|
+
resizeToAvoidBottomInset: true,
|
|
295
308
|
body: Row(
|
|
296
309
|
children: [
|
|
297
310
|
// Left: your app content
|
|
@@ -332,32 +345,48 @@ Scaffold(
|
|
|
332
345
|
|
|
333
346
|
## Incoming Calls — Global Placement
|
|
334
347
|
|
|
335
|
-
Incoming call handling MUST be at the app root level, not per-screen.
|
|
348
|
+
Incoming call handling MUST be at the app root level, not per-screen. **`VoipCallHandler` does NOT exist as a public symbol** (it appears only in comments inside `call_event_service.dart` and `ongoing_call_bloc.dart`). The canonical V6 root-mount API is `CometChatUIKit.init` + `MaterialApp(navigatorKey: CallNavigationContext.navigatorKey)`:
|
|
336
349
|
|
|
337
350
|
```dart
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
)
|
|
351
|
+
import 'package:cometchat_chat_uikit/cometchat_calls_uikit.dart' show CallNavigationContext;
|
|
352
|
+
import 'package:cometchat_chat_uikit/cometchat_chat_uikit.dart';
|
|
353
|
+
|
|
354
|
+
void main() async {
|
|
355
|
+
WidgetsFlutterBinding.ensureInitialized();
|
|
356
|
+
await CometChatUIKit.init(
|
|
357
|
+
uiKitSettings: (UIKitSettingsBuilder()
|
|
358
|
+
..appId = APP_ID
|
|
359
|
+
..region = REGION
|
|
360
|
+
..authKey = AUTH_KEY
|
|
361
|
+
..subscriptionType = CometChatSubscriptionType.allUsers
|
|
362
|
+
..enableCalls = true)
|
|
363
|
+
.build(),
|
|
364
|
+
);
|
|
365
|
+
runApp(MyApp());
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
class MyApp extends StatelessWidget {
|
|
369
|
+
@override
|
|
370
|
+
Widget build(BuildContext context) {
|
|
371
|
+
return MaterialApp(
|
|
372
|
+
navigatorKey: CallNavigationContext.navigatorKey, // ← Bug 1 fix per project_v6_flutter_calls_partial; even 6.0.1 sample omits this
|
|
373
|
+
home: HomeScreen(),
|
|
374
|
+
);
|
|
375
|
+
}
|
|
376
|
+
}
|
|
350
377
|
```
|
|
351
378
|
|
|
379
|
+
See `cometchat-flutter-v6-calls` §1.7 for full root-mount details. CallEventService mounts `IncomingCallOverlay` automatically when `enableCalls=true`.
|
|
380
|
+
|
|
352
381
|
---
|
|
353
382
|
|
|
354
383
|
## Anti-Patterns
|
|
355
384
|
|
|
356
385
|
```dart
|
|
357
|
-
// ❌ WRONG —
|
|
386
|
+
// ❌ WRONG — CometChatMessageList not wrapped in Expanded (unbounded → won't scroll)
|
|
358
387
|
Scaffold(
|
|
359
388
|
body: Column(children: [
|
|
360
|
-
|
|
389
|
+
CometChatMessageList(user: user), // needs Expanded inside a Column
|
|
361
390
|
CometChatMessageComposer(user: user),
|
|
362
391
|
]),
|
|
363
392
|
)
|
|
@@ -387,12 +416,12 @@ onItemTap: (conv) {
|
|
|
387
416
|
|
|
388
417
|
## Checklist
|
|
389
418
|
|
|
390
|
-
- [ ] `resizeToAvoidBottomInset:
|
|
391
|
-
- [ ] `SafeArea(
|
|
419
|
+
- [ ] `resizeToAvoidBottomInset: true` (or omitted — default) on Scaffolds with `CometChatMessageComposer`
|
|
420
|
+
- [ ] `SafeArea(top: false)` wrapping `Container(color: colorPalette.background3, ...)` for the message screen body
|
|
392
421
|
- [ ] Mutable `_user`/`_group` state copies, not `widget.user`/`widget.group`
|
|
393
422
|
- [ ] `onItemTap` extracts `User`/`Group` from `conversation.conversationWith`
|
|
394
423
|
- [ ] Protected groups handled (check `group.hasJoined` and `group.type`)
|
|
395
424
|
- [ ] Incoming call handler mounted at app root level
|
|
396
|
-
- [ ] Thread screen also
|
|
425
|
+
- [ ] Thread screen also uses `resizeToAvoidBottomInset: true`
|
|
397
426
|
- [ ] `hideAppbar: true` when parent provides its own AppBar
|
|
398
427
|
- [ ] `IndexedStack` used for tab-based home (preserves tab state)
|
|
@@ -6,14 +6,15 @@ description: >
|
|
|
6
6
|
checklist, environment configuration, and security hardening. Use when preparing
|
|
7
7
|
a CometChat Flutter app for production deployment.
|
|
8
8
|
license: "MIT"
|
|
9
|
-
compatibility: "cometchat_chat_uikit ^6.0.
|
|
10
|
-
allowed-tools: "shell, file-read, file-search, file-list, grep"
|
|
9
|
+
compatibility: "cometchat_chat_uikit ^6.0.1"
|
|
11
10
|
metadata:
|
|
12
11
|
author: "CometChat"
|
|
13
12
|
version: "3.0.0"
|
|
14
13
|
tags: "cometchat flutter production release auth-token proguard security"
|
|
15
14
|
---
|
|
16
15
|
|
|
16
|
+
> **Ground truth:** `cometchat_chat_uikit: ^6.0` — pub-cache source + `ui-kit/flutter`. **Official docs:** https://www.cometchat.com/docs/fundamentals/user-auth · **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.
|
|
17
|
+
|
|
17
18
|
# CometChat Flutter UIKit v6 — Production Readiness
|
|
18
19
|
|
|
19
20
|
Everything you need to move a CometChat Flutter app from development to production. Covers authentication, platform configuration, environment management, and security hardening.
|
|
@@ -99,9 +100,8 @@ await CometChatUIKit.loginWithAuthToken(authToken,
|
|
|
99
100
|
Your server calls the CometChat REST API with the `authKey` (which stays server-side):
|
|
100
101
|
|
|
101
102
|
```bash
|
|
102
|
-
curl -X POST "https
|
|
103
|
-
-H "
|
|
104
|
-
-H "apiKey: YOUR_AUTH_KEY" \
|
|
103
|
+
curl -X POST "https://<APP_ID>.api-<REGION>.cometchat.io/v3/users/<UID>/auth_tokens" \
|
|
104
|
+
-H "apikey: YOUR_REST_API_KEY" \
|
|
105
105
|
-H "Content-Type: application/json"
|
|
106
106
|
```
|
|
107
107
|
|
|
@@ -116,10 +116,12 @@ Response:
|
|
|
116
116
|
}
|
|
117
117
|
```
|
|
118
118
|
|
|
119
|
-
Replace
|
|
120
|
-
- US:
|
|
121
|
-
- EU:
|
|
122
|
-
- IN:
|
|
119
|
+
Replace `<APP_ID>` with your CometChat app ID and `<REGION>` with your region code (`us`, `eu`, or `in`). The full host becomes:
|
|
120
|
+
- US: `<APP_ID>.api-us.cometchat.io`
|
|
121
|
+
- EU: `<APP_ID>.api-eu.cometchat.io`
|
|
122
|
+
- IN: `<APP_ID>.api-in.cometchat.io`
|
|
123
|
+
|
|
124
|
+
Use `YOUR_REST_API_KEY` from the CometChat dashboard (API & Auth Keys). Do not confuse it with the client `authKey`.
|
|
123
125
|
|
|
124
126
|
### Step 2: Your Backend Returns the Token to the Client
|
|
125
127
|
|
|
@@ -195,9 +197,8 @@ await CometChatUIKit.updateUser(user,
|
|
|
195
197
|
|
|
196
198
|
Server-side user creation:
|
|
197
199
|
```bash
|
|
198
|
-
curl -X POST "https
|
|
199
|
-
-H "
|
|
200
|
-
-H "apiKey: YOUR_AUTH_KEY" \
|
|
200
|
+
curl -X POST "https://<APP_ID>.api-<REGION>.cometchat.io/v3/users" \
|
|
201
|
+
-H "apikey: YOUR_REST_API_KEY" \
|
|
201
202
|
-H "Content-Type: application/json" \
|
|
202
203
|
-d '{"uid": "user_123", "name": "Jane Doe"}'
|
|
203
204
|
```
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: cometchat-flutter-v6-push
|
|
3
|
-
description: Push notifications for CometChat Flutter UIKit v6 (
|
|
3
|
+
description: Push notifications for CometChat Flutter UIKit v6 (stable, Bloc-based). Covers firebase_messaging setup for FCM (Android) + APNs (iOS via Firebase), CometChat dashboard PushPlatform configuration, token registration via the Notifications SDK, background isolate handler (Dart entry-point rule), foreground vs background message routing, notification tap deep-link to chat threads, and the Bloc patterns for surfacing push state. Sister skill of cometchat-flutter-v5-push — same FCM stack, Bloc-flavored client integration.
|
|
4
4
|
license: "MIT"
|
|
5
|
-
compatibility: "Flutter >= 2.5, Dart >= 3.0; cometchat_chat_uikit ^6.0.
|
|
6
|
-
allowed-tools: "shell, file-read, file-search, file-list, ask-user"
|
|
5
|
+
compatibility: "Flutter >= 2.5, Dart >= 3.0; cometchat_chat_uikit ^6.0.1; firebase_messaging ^14.0.0; firebase_core ^2.0.0; Android minSdk 26+; iOS 13+ deployment target"
|
|
7
6
|
metadata:
|
|
8
7
|
author: "CometChat"
|
|
9
8
|
version: "4.0.0"
|
|
@@ -12,9 +11,9 @@ metadata:
|
|
|
12
11
|
|
|
13
12
|
## Purpose
|
|
14
13
|
|
|
15
|
-
Push notifications for Flutter v6 (
|
|
14
|
+
Push notifications for Flutter v6 (stable, GA 2026-05-25). Notifies users on incoming messages when the app is backgrounded or terminated. Two components: **Firebase Messaging** (FCM on Android, APNs forwarded via Firebase on iOS) on the client, plus **CometChat dashboard PushPlatform** configured to forward CometChat's webhook to Firebase.
|
|
16
15
|
|
|
17
|
-
This skill is for **chat push** (new messages). Calls/VoIP push has different mechanics — see `cometchat-flutter-v6-calls/
|
|
16
|
+
This skill is for **chat push** (new messages). Calls/VoIP push has different mechanics — see `cometchat-flutter-v6-calls/SKILL.md` §1.2 (VoIP push — `native_call_kit` + FCM + PushKit) and its `references/server-push-bridge.md`.
|
|
18
17
|
|
|
19
18
|
**Read these other skills first:**
|
|
20
19
|
- `cometchat-flutter-v6-core` — UIKitSettings, init/login order
|
|
@@ -56,7 +55,7 @@ Unlike Web Push (which requires you to run a push server), CometChat hosts the c
|
|
|
56
55
|
dependencies:
|
|
57
56
|
flutter:
|
|
58
57
|
sdk: flutter
|
|
59
|
-
cometchat_chat_uikit: ^6.0
|
|
58
|
+
cometchat_chat_uikit: ^6.0
|
|
60
59
|
firebase_messaging: ^14.0.0
|
|
61
60
|
firebase_core: ^2.0.0
|
|
62
61
|
flutter_local_notifications: ^16.0.0 # for foreground notifications + iOS in-app banner
|
|
@@ -203,24 +202,47 @@ class PushService {
|
|
|
203
202
|
}
|
|
204
203
|
|
|
205
204
|
Future<void> _registerWithCometChat(String token, {required TargetPlatform platform}) async {
|
|
206
|
-
//
|
|
207
|
-
//
|
|
208
|
-
// drafts of this doc but doesn't exist on the installed SDK).
|
|
209
|
-
// Source: https://www.cometchat.com/docs/notifications/flutter-push-notifications-android.md
|
|
205
|
+
// Canonical SDK source: chat-sdk-flutter/lib/notification/main/cometchat_notifications.dart
|
|
206
|
+
// (registerPushToken lines 36-235, unregisterPushToken lines 246-261).
|
|
210
207
|
//
|
|
211
|
-
// The
|
|
212
|
-
//
|
|
213
|
-
|
|
208
|
+
// The kit's only public push surface is CometChatNotifications.registerPushToken /
|
|
209
|
+
// unregisterPushToken — named-arg signature. PNRegistry seen in the vendor docs is
|
|
210
|
+
// a sample-app extension (cometchat-uikit-flutter sample_app_push_notifications),
|
|
211
|
+
// NOT a kit-exported symbol — copying it as-is into a customer project fails to
|
|
212
|
+
// compile with "Undefined name 'PNRegistry'".
|
|
213
|
+
//
|
|
214
|
+
// Provider ID comes from the dashboard's Notifications → Push → Provider ID config;
|
|
215
|
+
// customers typically store it as a const (AppCredentials.fcmProviderId pattern).
|
|
216
|
+
final pushPlatform = platform == TargetPlatform.android
|
|
217
|
+
? PushPlatforms.FCM_FLUTTER_ANDROID
|
|
218
|
+
: PushPlatforms.FCM_FLUTTER_IOS; // iOS via Firebase (FCM relay).
|
|
219
|
+
// For pure APNs chat: PushPlatforms.APNS_FLUTTER_DEVICE + deviceToken: <APNs token>
|
|
220
|
+
// For VoIP/CallKit: PushPlatforms.APNS_FLUTTER_VOIP + voipToken: <PushKit token>
|
|
221
|
+
// See cometchat-flutter-v6-calls for VoIP plumbing.
|
|
222
|
+
|
|
223
|
+
await CometChatNotifications.registerPushToken(
|
|
224
|
+
pushPlatform,
|
|
225
|
+
fcmToken: token,
|
|
226
|
+
providerId: AppCredentials.fcmProviderId, // your dashboard PushPlatform provider ID
|
|
227
|
+
onSuccess: (resp) => debugPrint('CometChat push registered: $resp'),
|
|
228
|
+
onError: (CometChatException e) => debugPrint('CometChat push register failed: ${e.message}'),
|
|
229
|
+
);
|
|
214
230
|
}
|
|
215
231
|
|
|
216
232
|
Future<void> _unregisterWithCometChat(String token) async {
|
|
217
|
-
//
|
|
218
|
-
|
|
233
|
+
// Distinct method on CometChatNotifications (chat-sdk-flutter lines 246-261).
|
|
234
|
+
// No token arg required — the SDK resolves the registration by the logged-in user's identity.
|
|
235
|
+
await CometChatNotifications.unregisterPushToken(
|
|
236
|
+
onSuccess: (_) => debugPrint('CometChat push unregistered'),
|
|
237
|
+
onError: (CometChatException e) => debugPrint('CometChat push unregister failed: ${e.message}'),
|
|
238
|
+
);
|
|
219
239
|
}
|
|
220
240
|
}
|
|
221
241
|
```
|
|
222
242
|
|
|
223
|
-
**
|
|
243
|
+
**Symbol note (2026-06-03, reversing 2026-05-14):** The kit's only public push surface is `CometChatNotifications.registerPushToken` / `unregisterPushToken` — verified in `chat-sdk-flutter/lib/notification/main/cometchat_notifications.dart` and cross-verified against the V5 sister skill (`cometchat-flutter-v5-push`) and the replit-template canonical skill. `PNRegistry.registerPNService` is a v5-sample-app extension (lives in `cometchat-uikit-flutter/sample_app_push_notifications/`, defined as `extension PNRegistry on CometChatService`) — it is NOT exported by any `cometchat_*` pub package. The previous 2026-05-14 audit treated a docs page that cites the sample-app helper as SDK ground truth; that audit has been reversed.
|
|
244
|
+
|
|
245
|
+
**Signature:** `CometChatNotifications.registerPushToken` is **named-arg only**: `(PushPlatforms platform, {String? fcmToken, String? deviceToken, String? voipToken, String? providerId, Function(String)? onSuccess, Function(CometChatException)? onError})`. The positional `(token, true, false)` shape from the v5 sample-app helper does not type-check against the SDK.
|
|
224
246
|
|
|
225
247
|
---
|
|
226
248
|
|
|
@@ -243,7 +265,7 @@ class _MyAppState extends State<MyApp> {
|
|
|
243
265
|
}
|
|
244
266
|
|
|
245
267
|
Future<void> _initCometChat() async {
|
|
246
|
-
final settings = (
|
|
268
|
+
final settings = (UIKitSettingsBuilder()
|
|
247
269
|
..appId = CometChatConfig.appId
|
|
248
270
|
..region = CometChatConfig.region
|
|
249
271
|
..authKey = CometChatConfig.authKey)
|
|
@@ -400,9 +422,9 @@ If migrating from v5:
|
|
|
400
422
|
|---|---|---|
|
|
401
423
|
| Listener pattern | GetX `Get.put` for push handlers | Bloc — handlers in app shell or a NotificationBloc |
|
|
402
424
|
| Init lifecycle | `CometChatUIKit.init` callback | Same shape — `onSuccess` / `onError` |
|
|
403
|
-
| Token registration API |
|
|
425
|
+
| Token registration API | `CometChatNotifications.registerPushToken(platform, {fcmToken, deviceToken, voipToken, providerId, onSuccess, onError})` | Same — namespace and signature unchanged in V6 chat-sdk-flutter; only the surrounding state-mgmt wiring differs (Bloc instead of GetX) |
|
|
404
426
|
| Background handler | `@pragma('vm:entry-point')` required | Unchanged — Flutter framework requirement |
|
|
405
|
-
| Calls VoIP push interaction | `cometchat_calls_uikit ^5` separate package | Calls bundled into `cometchat_chat_uikit ^6.0.
|
|
427
|
+
| Calls VoIP push interaction | `cometchat_calls_uikit ^5` separate package | Calls bundled into `cometchat_chat_uikit ^6.0.1`; VoIP push handled in `cometchat-flutter-v6-calls` references |
|
|
406
428
|
|
|
407
429
|
The migration is small for push specifically — the FCM/firebase_messaging stack is unchanged; the deltas are in the surrounding architecture.
|
|
408
430
|
|
|
@@ -433,7 +455,7 @@ The migration is small for push specifically — the FCM/firebase_messaging stac
|
|
|
433
455
|
- [ ] Android manifest: `POST_NOTIFICATIONS` permission + notification channel meta-data
|
|
434
456
|
- [ ] Background handler is top-level + `@pragma('vm:entry-point')`
|
|
435
457
|
- [ ] Background handler initialized via `FirebaseMessaging.onBackgroundMessage` BEFORE `runApp`
|
|
436
|
-
- [ ] FCM/APN token registered with CometChat via `
|
|
458
|
+
- [ ] FCM/APN token registered with CometChat via `CometChatNotifications.registerPushToken(PushPlatforms.FCM_FLUTTER_ANDROID, fcmToken: token, providerId: ..., onSuccess: ..., onError: ...)` (or `PushPlatforms.FCM_FLUTTER_IOS` / `APNS_FLUTTER_DEVICE` + `deviceToken:` / `APNS_FLUTTER_VOIP` + `voipToken:` equivalent) AFTER login resolves. `PNRegistry` in the vendor docs is a v5-sample-app extension, not a kit API.
|
|
437
459
|
- [ ] `onTokenRefresh` re-registers
|
|
438
460
|
- [ ] Foreground handler decides banner vs no-banner based on chat tab focus
|
|
439
461
|
- [ ] `onMessageOpenedApp` + `getInitialMessage` both navigate to the conversation
|
|
@@ -446,7 +468,7 @@ The migration is small for push specifically — the FCM/firebase_messaging stac
|
|
|
446
468
|
## 12. Pointers
|
|
447
469
|
|
|
448
470
|
- `cometchat-flutter-v5-push` — V5/GetX sister skill (FCM stack unchanged; client wiring different)
|
|
449
|
-
- `cometchat-flutter-v6-calls
|
|
471
|
+
- `cometchat-flutter-v6-calls` SKILL.md §1.2 + `references/server-push-bridge.md` — calls VoIP push (overlap; both can coexist)
|
|
450
472
|
- `cometchat-flutter-v6-core` — UIKitSettings, init/login order
|
|
451
473
|
- `cometchat-flutter-v6-troubleshooting` — push debugging (token never registers, background handler doesn't fire, FCM payload not received)
|
|
452
474
|
- `cometchat-flutter-v6-migration` — full V5→V6 migration recipe; push delta is one section
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: cometchat-flutter-v6-testing
|
|
3
|
-
description: Testing patterns for CometChat Flutter UIKit v6 (
|
|
3
|
+
description: Testing patterns for CometChat Flutter UIKit v6 (stable, Bloc-based). Covers flutter_test + bloc_test for Bloc unit tests, mocktail for SDK mocking, widget tests around the Bloc-driven CometChat widgets, integration_test for real-device flows, golden tests for theming, and CI on GitHub Actions / Codemagic. Sister skill of cometchat-flutter-v5-testing — the cohorts have different state-management primitives (GetX vs Bloc) so the patterns differ.
|
|
4
4
|
license: "MIT"
|
|
5
|
-
compatibility: "Flutter >= 2.5, Dart >= 3.0; flutter_test (built-in); bloc_test >= 9.0; mocktail >= 1.0; integration_test (built-in); cometchat_chat_uikit ^6.0.
|
|
6
|
-
allowed-tools: "shell, file-read, file-search, file-list, ask-user"
|
|
5
|
+
compatibility: "Flutter >= 2.5, Dart >= 3.0; flutter_test (built-in); bloc_test >= 9.0; mocktail >= 1.0; integration_test (built-in); cometchat_chat_uikit ^6.0.2"
|
|
7
6
|
metadata:
|
|
8
7
|
author: "CometChat"
|
|
9
8
|
version: "4.0.0"
|
|
@@ -12,14 +11,14 @@ metadata:
|
|
|
12
11
|
|
|
13
12
|
## Purpose
|
|
14
13
|
|
|
15
|
-
Test recipes for Flutter UIKit v6 (
|
|
14
|
+
Test recipes for Flutter UIKit v6 (stable, Bloc-based). Most of the v5 patterns carry over; the deltas are around state-management primitives (Bloc, not GetX) and the unified `cometchat_chat_uikit` package (calls bundled — see `cometchat-flutter-v6-calls`).
|
|
16
15
|
|
|
17
16
|
**Read these other skills first:**
|
|
18
17
|
- `cometchat-flutter-v6-core` — UIKitSettings, init/login order, hard rules
|
|
19
18
|
- `cometchat-flutter-v6-events` — Bloc-based event streams
|
|
20
19
|
- `cometchat-flutter-v5-testing` — patterns that aren't v6-specific (CI config, golden tests, mocktail intro) — read first if you haven't
|
|
21
20
|
|
|
22
|
-
**Ground truth:**
|
|
21
|
+
**Ground truth:** **Official docs:** https://www.cometchat.com/docs/ui-kit/flutter/overview · **Docs MCP:** `claude mcp add --transport http cometchat-docs https://www.cometchat.com/docs/mcp` (or fetch the URL directly without MCP).
|
|
23
22
|
- bloc_test — https://pub.dev/packages/bloc_test
|
|
24
23
|
- flutter_bloc — https://bloclibrary.dev/
|
|
25
24
|
|
|
@@ -70,7 +69,8 @@ abstract class CometChatService {
|
|
|
70
69
|
class CometChatServiceImpl implements CometChatService {
|
|
71
70
|
@override
|
|
72
71
|
Future<void> init() async {
|
|
73
|
-
|
|
72
|
+
// Class is UIKitSettingsBuilder (constructor), NOT UIKitSettings.builder() (verified shared_uikit/lib/src/cometchat_ui_kit/ui_kit_settings.dart).
|
|
73
|
+
final settings = (UIKitSettingsBuilder()
|
|
74
74
|
..appId = CometChatConfig.appId
|
|
75
75
|
..region = CometChatConfig.region
|
|
76
76
|
..authKey = CometChatConfig.authKey
|