@cometchat/skills 4.0.0 → 4.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +42 -2
- package/bin/install.js +448 -57
- package/package.json +1 -1
- package/skills/cometchat/SKILL.md +337 -80
- package/skills/cometchat-a11y/SKILL.md +476 -0
- package/skills/cometchat-android-v5/SKILL.md +1 -1
- package/skills/cometchat-android-v5-calls/SKILL.md +413 -0
- package/skills/cometchat-android-v5-calls/references/README.md +53 -0
- package/skills/cometchat-android-v5-calls/references/add-calls-to-existing-chat.md +195 -0
- package/skills/cometchat-android-v5-calls/references/audio-controls.md +91 -0
- package/skills/cometchat-android-v5-calls/references/background-handling.md +168 -0
- package/skills/cometchat-android-v5-calls/references/call-layouts.md +123 -0
- package/skills/cometchat-android-v5-calls/references/call-logs.md +113 -0
- package/skills/cometchat-android-v5-calls/references/call-session.md +274 -0
- package/skills/cometchat-android-v5-calls/references/custom-ui.md +150 -0
- package/skills/cometchat-android-v5-calls/references/event-listeners.md +123 -0
- package/skills/cometchat-android-v5-calls/references/group-calls.md +205 -0
- package/skills/cometchat-android-v5-calls/references/idle-timeout.md +111 -0
- package/skills/cometchat-android-v5-calls/references/in-call-chat.md +134 -0
- package/skills/cometchat-android-v5-calls/references/join-session.md +120 -0
- package/skills/cometchat-android-v5-calls/references/migration-v4-to-v5.md +206 -0
- package/skills/cometchat-android-v5-calls/references/participant-management.md +110 -0
- package/skills/cometchat-android-v5-calls/references/picture-in-picture.md +106 -0
- package/skills/cometchat-android-v5-calls/references/raise-hand.md +242 -0
- package/skills/cometchat-android-v5-calls/references/recording.md +101 -0
- package/skills/cometchat-android-v5-calls/references/ringing-integration.md +152 -0
- package/skills/cometchat-android-v5-calls/references/screen-sharing.md +82 -0
- package/skills/cometchat-android-v5-calls/references/server-fcm-voip.md +215 -0
- package/skills/cometchat-android-v5-calls/references/session-settings.md +121 -0
- package/skills/cometchat-android-v5-calls/references/setup.md +137 -0
- package/skills/cometchat-android-v5-calls/references/share-invite.md +151 -0
- package/skills/cometchat-android-v5-calls/references/video-controls.md +87 -0
- package/skills/cometchat-android-v5-calls/references/voip-calling.md +526 -0
- package/skills/cometchat-android-v5-components/SKILL.md +1 -1
- package/skills/cometchat-android-v5-core/SKILL.md +1 -1
- package/skills/cometchat-android-v5-customization/SKILL.md +1 -1
- package/skills/cometchat-android-v5-extensions/SKILL.md +1 -1
- package/skills/cometchat-android-v5-features/SKILL.md +1 -1
- package/skills/cometchat-android-v5-placement/SKILL.md +1 -1
- package/skills/cometchat-android-v5-production/SKILL.md +1 -1
- package/skills/cometchat-android-v5-push/SKILL.md +1 -1
- package/skills/cometchat-android-v5-testing/SKILL.md +1 -1
- package/skills/cometchat-android-v5-theming/SKILL.md +1 -1
- package/skills/cometchat-android-v5-troubleshooting/SKILL.md +1 -1
- package/skills/cometchat-android-v6/SKILL.md +1 -1
- package/skills/cometchat-android-v6-builder-settings/SKILL.md +1 -1
- package/skills/cometchat-android-v6-calls/SKILL.md +375 -0
- package/skills/cometchat-android-v6-calls/references/add-calls-to-existing-chat.md +97 -0
- package/skills/cometchat-android-v6-calls/references/call-layouts.md +91 -0
- package/skills/cometchat-android-v6-calls/references/call-session.md +163 -0
- package/skills/cometchat-android-v6-calls/references/device-management.md +171 -0
- package/skills/cometchat-android-v6-calls/references/group-calls.md +191 -0
- package/skills/cometchat-android-v6-calls/references/idle-timeout.md +107 -0
- package/skills/cometchat-android-v6-calls/references/in-call-chat.md +136 -0
- package/skills/cometchat-android-v6-calls/references/raise-hand.md +186 -0
- package/skills/cometchat-android-v6-calls/references/ringing-integration.md +176 -0
- package/skills/cometchat-android-v6-calls/references/server-fcm-voip.md +127 -0
- package/skills/cometchat-android-v6-calls/references/share-invite.md +105 -0
- package/skills/cometchat-android-v6-compose-components/SKILL.md +2 -2
- package/skills/cometchat-android-v6-compose-customization/SKILL.md +1 -1
- package/skills/cometchat-android-v6-compose-placement/SKILL.md +1 -1
- package/skills/cometchat-android-v6-compose-theming/SKILL.md +1 -1
- package/skills/cometchat-android-v6-core/SKILL.md +1 -1
- package/skills/cometchat-android-v6-events/SKILL.md +1 -1
- package/skills/cometchat-android-v6-extensions/SKILL.md +1 -1
- package/skills/cometchat-android-v6-features/SKILL.md +1 -1
- package/skills/cometchat-android-v6-kotlin-components/SKILL.md +1 -1
- package/skills/cometchat-android-v6-kotlin-customization/SKILL.md +1 -1
- package/skills/cometchat-android-v6-kotlin-placement/SKILL.md +1 -1
- package/skills/cometchat-android-v6-kotlin-theming/SKILL.md +1 -1
- package/skills/cometchat-android-v6-migration/SKILL.md +398 -0
- package/skills/cometchat-android-v6-production/SKILL.md +1 -1
- package/skills/cometchat-android-v6-push/SKILL.md +1 -1
- package/skills/cometchat-android-v6-testing/SKILL.md +1 -1
- package/skills/cometchat-android-v6-troubleshooting/SKILL.md +1 -1
- package/skills/cometchat-angular-calls/SKILL.md +511 -0
- package/skills/cometchat-angular-calls/references/add-calls-to-existing-chat.md +95 -0
- package/skills/cometchat-angular-calls/references/call-layouts.md +106 -0
- package/skills/cometchat-angular-calls/references/call-session.md +167 -0
- package/skills/cometchat-angular-calls/references/custom-ui.md +231 -0
- package/skills/cometchat-angular-calls/references/device-management.md +135 -0
- package/skills/cometchat-angular-calls/references/group-calls.md +412 -0
- package/skills/cometchat-angular-calls/references/idle-timeout.md +145 -0
- package/skills/cometchat-angular-calls/references/in-call-chat.md +148 -0
- package/skills/cometchat-angular-calls/references/lazy-loading-pitfalls.md +205 -0
- package/skills/cometchat-angular-calls/references/migration-v4-to-v5.md +53 -0
- package/skills/cometchat-angular-calls/references/ngzone-and-async-callbacks.md +183 -0
- package/skills/cometchat-angular-calls/references/picture-in-picture.md +285 -0
- package/skills/cometchat-angular-calls/references/raise-hand.md +167 -0
- package/skills/cometchat-angular-calls/references/recording-screen-share.md +267 -0
- package/skills/cometchat-angular-calls/references/ringing-integration.md +131 -0
- package/skills/cometchat-angular-calls/references/server-web-push-vapid.md +100 -0
- package/skills/cometchat-angular-calls/references/share-invite.md +116 -0
- package/skills/cometchat-angular-components/SKILL.md +1 -1
- package/skills/cometchat-angular-core/SKILL.md +1 -1
- package/skills/cometchat-angular-customization/SKILL.md +1 -1
- package/skills/cometchat-angular-features/SKILL.md +1 -1
- package/skills/cometchat-angular-patterns/SKILL.md +1 -1
- package/skills/cometchat-angular-placement/SKILL.md +1 -1
- package/skills/cometchat-angular-production/SKILL.md +1 -1
- package/skills/cometchat-angular-push/SKILL.md +403 -0
- package/skills/cometchat-angular-testing/SKILL.md +333 -0
- package/skills/cometchat-angular-theming/SKILL.md +1 -1
- package/skills/cometchat-angular-troubleshooting/SKILL.md +1 -1
- package/skills/cometchat-astro-patterns/SKILL.md +1 -1
- package/skills/cometchat-calls/SKILL.md +358 -0
- package/skills/cometchat-calls/references/use-case-broadcast.md +194 -0
- package/skills/cometchat-calls/references/use-case-marketplace.md +158 -0
- package/skills/cometchat-calls/references/use-case-support.md +190 -0
- package/skills/cometchat-calls/references/use-case-team.md +169 -0
- package/skills/cometchat-calls/references/use-case-telehealth.md +154 -0
- package/skills/cometchat-components/SKILL.md +1 -1
- package/skills/cometchat-core/SKILL.md +1 -1
- package/skills/cometchat-customization/SKILL.md +2 -2
- package/skills/cometchat-features/SKILL.md +2 -2
- package/skills/cometchat-flutter-v5/SKILL.md +1 -1
- package/skills/cometchat-flutter-v5-calls/SKILL.md +325 -94
- package/skills/cometchat-flutter-v5-calls/references/add-calls-to-existing-chat.md +169 -0
- package/skills/cometchat-flutter-v5-calls/references/call-layouts.md +98 -0
- package/skills/cometchat-flutter-v5-calls/references/call-session.md +330 -0
- package/skills/cometchat-flutter-v5-calls/references/device-management.md +120 -0
- package/skills/cometchat-flutter-v5-calls/references/group-calls.md +187 -0
- package/skills/cometchat-flutter-v5-calls/references/idle-timeout.md +97 -0
- package/skills/cometchat-flutter-v5-calls/references/in-call-chat.md +132 -0
- package/skills/cometchat-flutter-v5-calls/references/migration-v4-to-v5.md +160 -0
- package/skills/cometchat-flutter-v5-calls/references/raise-hand.md +244 -0
- package/skills/cometchat-flutter-v5-calls/references/ringing-integration.md +193 -0
- package/skills/cometchat-flutter-v5-calls/references/server-push-bridge.md +101 -0
- package/skills/cometchat-flutter-v5-calls/references/share-invite.md +142 -0
- package/skills/cometchat-flutter-v5-conversations/SKILL.md +1 -1
- package/skills/cometchat-flutter-v5-core/SKILL.md +1 -1
- package/skills/cometchat-flutter-v5-customization/SKILL.md +1 -1
- package/skills/cometchat-flutter-v5-events/SKILL.md +1 -1
- package/skills/cometchat-flutter-v5-messages/SKILL.md +1 -1
- package/skills/cometchat-flutter-v5-production/SKILL.md +1 -1
- package/skills/cometchat-flutter-v5-push/SKILL.md +1 -1
- package/skills/cometchat-flutter-v5-testing/SKILL.md +390 -0
- package/skills/cometchat-flutter-v5-theming/SKILL.md +1 -1
- package/skills/cometchat-flutter-v5-troubleshooting/SKILL.md +1 -1
- package/skills/cometchat-flutter-v5-users-groups/SKILL.md +1 -1
- package/skills/cometchat-flutter-v6/SKILL.md +1 -1
- package/skills/cometchat-flutter-v6-calls/SKILL.md +308 -243
- package/skills/cometchat-flutter-v6-calls/references/add-calls-to-existing-chat.md +134 -0
- package/skills/cometchat-flutter-v6-calls/references/call-layouts.md +102 -0
- package/skills/cometchat-flutter-v6-calls/references/call-session.md +229 -0
- package/skills/cometchat-flutter-v6-calls/references/device-management.md +99 -0
- package/skills/cometchat-flutter-v6-calls/references/group-calls.md +190 -0
- package/skills/cometchat-flutter-v6-calls/references/idle-timeout.md +80 -0
- package/skills/cometchat-flutter-v6-calls/references/in-call-chat.md +122 -0
- package/skills/cometchat-flutter-v6-calls/references/raise-hand.md +268 -0
- package/skills/cometchat-flutter-v6-calls/references/ringing-integration.md +171 -0
- package/skills/cometchat-flutter-v6-calls/references/server-push-bridge.md +93 -0
- package/skills/cometchat-flutter-v6-calls/references/share-invite.md +102 -0
- package/skills/cometchat-flutter-v6-components/SKILL.md +1 -1
- package/skills/cometchat-flutter-v6-conversations/SKILL.md +1 -1
- package/skills/cometchat-flutter-v6-core/SKILL.md +1 -1
- package/skills/cometchat-flutter-v6-customization/SKILL.md +1 -1
- package/skills/cometchat-flutter-v6-events/SKILL.md +1 -1
- package/skills/cometchat-flutter-v6-features/SKILL.md +1 -1
- package/skills/cometchat-flutter-v6-messages/SKILL.md +1 -1
- package/skills/cometchat-flutter-v6-migration/SKILL.md +1 -1
- package/skills/cometchat-flutter-v6-placement/SKILL.md +1 -1
- package/skills/cometchat-flutter-v6-production/SKILL.md +1 -1
- package/skills/cometchat-flutter-v6-push/SKILL.md +452 -0
- package/skills/cometchat-flutter-v6-testing/SKILL.md +319 -0
- package/skills/cometchat-flutter-v6-theming/SKILL.md +1 -1
- package/skills/cometchat-flutter-v6-troubleshooting/SKILL.md +1 -1
- package/skills/cometchat-flutter-v6-users-groups/SKILL.md +1 -1
- package/skills/cometchat-i18n/SKILL.md +358 -0
- package/skills/cometchat-ios/SKILL.md +5 -5
- package/skills/cometchat-ios-calls/SKILL.md +409 -0
- package/skills/cometchat-ios-calls/references/add-calls-to-existing-chat.md +172 -0
- package/skills/cometchat-ios-calls/references/avaudiosession-routing.md +189 -0
- package/skills/cometchat-ios-calls/references/call-layouts.md +136 -0
- package/skills/cometchat-ios-calls/references/call-session.md +221 -0
- package/skills/cometchat-ios-calls/references/callkit-and-pushkit.md +353 -0
- package/skills/cometchat-ios-calls/references/custom-ui.md +322 -0
- package/skills/cometchat-ios-calls/references/device-management.md +171 -0
- package/skills/cometchat-ios-calls/references/group-calls.md +396 -0
- package/skills/cometchat-ios-calls/references/idle-timeout.md +185 -0
- package/skills/cometchat-ios-calls/references/in-call-chat.md +183 -0
- package/skills/cometchat-ios-calls/references/migration-v4-to-v5.md +138 -0
- package/skills/cometchat-ios-calls/references/picture-in-picture.md +246 -0
- package/skills/cometchat-ios-calls/references/raise-hand.md +239 -0
- package/skills/cometchat-ios-calls/references/recording-screen-share.md +339 -0
- package/skills/cometchat-ios-calls/references/ringing-integration.md +142 -0
- package/skills/cometchat-ios-calls/references/server-apns-pushkit.md +267 -0
- package/skills/cometchat-ios-calls/references/share-invite.md +152 -0
- package/skills/cometchat-ios-calls/references/swiftui-uikit-hosting.md +246 -0
- package/skills/cometchat-ios-calls/references/voip-cert-setup.md +166 -0
- package/skills/cometchat-ios-components/SKILL.md +1 -1
- package/skills/cometchat-ios-core/SKILL.md +1 -1
- package/skills/cometchat-ios-customization/SKILL.md +1 -1
- package/skills/cometchat-ios-features/SKILL.md +1 -1
- package/skills/cometchat-ios-placement/SKILL.md +1 -1
- package/skills/cometchat-ios-production/SKILL.md +1 -1
- package/skills/cometchat-ios-push/SKILL.md +1 -1
- package/skills/cometchat-ios-testing/SKILL.md +371 -0
- package/skills/cometchat-ios-theming/SKILL.md +1 -1
- package/skills/cometchat-ios-troubleshooting/SKILL.md +1 -1
- package/skills/cometchat-native-bare-patterns/SKILL.md +45 -3
- package/skills/cometchat-native-calls/SKILL.md +599 -0
- package/skills/cometchat-native-calls/references/add-calls-to-existing-chat.md +203 -0
- package/skills/cometchat-native-calls/references/call-layouts.md +124 -0
- package/skills/cometchat-native-calls/references/call-session.md +182 -0
- package/skills/cometchat-native-calls/references/custom-ui.md +250 -0
- package/skills/cometchat-native-calls/references/device-management.md +135 -0
- package/skills/cometchat-native-calls/references/expo-vs-bare.md +179 -0
- package/skills/cometchat-native-calls/references/group-calls.md +291 -0
- package/skills/cometchat-native-calls/references/idle-timeout.md +128 -0
- package/skills/cometchat-native-calls/references/in-call-chat.md +143 -0
- package/skills/cometchat-native-calls/references/migration-v4-to-v5.md +72 -0
- package/skills/cometchat-native-calls/references/picture-in-picture.md +276 -0
- package/skills/cometchat-native-calls/references/raise-hand.md +203 -0
- package/skills/cometchat-native-calls/references/recording-screen-share.md +290 -0
- package/skills/cometchat-native-calls/references/ringing-integration.md +118 -0
- package/skills/cometchat-native-calls/references/server-push-bridge.md +135 -0
- package/skills/cometchat-native-calls/references/server-push-payloads.md +193 -0
- package/skills/cometchat-native-calls/references/share-invite.md +144 -0
- package/skills/cometchat-native-calls/references/voip-push-end-to-end.md +317 -0
- package/skills/cometchat-native-components/SKILL.md +1 -1
- package/skills/cometchat-native-core/SKILL.md +1 -1
- package/skills/cometchat-native-customization/SKILL.md +1 -1
- package/skills/cometchat-native-expo-patterns/SKILL.md +18 -1
- package/skills/cometchat-native-features/SKILL.md +1 -1
- package/skills/cometchat-native-placement/SKILL.md +1 -1
- package/skills/cometchat-native-production/SKILL.md +1 -1
- package/skills/cometchat-native-push/SKILL.md +1 -1
- package/skills/cometchat-native-testing/SKILL.md +1 -1
- package/skills/cometchat-native-theming/SKILL.md +1 -1
- package/skills/cometchat-native-troubleshooting/SKILL.md +1 -1
- package/skills/cometchat-nextjs-patterns/SKILL.md +1 -1
- package/skills/cometchat-placement/SKILL.md +29 -1
- package/skills/cometchat-production/SKILL.md +1 -1
- package/skills/cometchat-react-calls/SKILL.md +539 -0
- package/skills/cometchat-react-calls/references/add-calls-to-existing-chat.md +145 -0
- package/skills/cometchat-react-calls/references/call-layouts.md +161 -0
- package/skills/cometchat-react-calls/references/call-session.md +235 -0
- package/skills/cometchat-react-calls/references/custom-ui.md +201 -0
- package/skills/cometchat-react-calls/references/device-management.md +206 -0
- package/skills/cometchat-react-calls/references/group-calls.md +262 -0
- package/skills/cometchat-react-calls/references/idle-timeout.md +175 -0
- package/skills/cometchat-react-calls/references/in-call-chat.md +212 -0
- package/skills/cometchat-react-calls/references/migration-v4-to-v5.md +172 -0
- package/skills/cometchat-react-calls/references/picture-in-picture.md +245 -0
- package/skills/cometchat-react-calls/references/raise-hand.md +238 -0
- package/skills/cometchat-react-calls/references/recording-screen-share.md +143 -0
- package/skills/cometchat-react-calls/references/ringing-integration.md +255 -0
- package/skills/cometchat-react-calls/references/server-web-push-vapid.md +241 -0
- package/skills/cometchat-react-calls/references/share-invite.md +176 -0
- package/skills/cometchat-react-calls/references/testing-calls-on-web.md +198 -0
- package/skills/cometchat-react-calls/references/voip-and-web-push.md +165 -0
- package/skills/cometchat-react-patterns/SKILL.md +56 -8
- package/skills/cometchat-react-push/SKILL.md +448 -0
- package/skills/cometchat-react-router-patterns/SKILL.md +1 -1
- package/skills/cometchat-react-testing/SKILL.md +404 -0
- package/skills/cometchat-theming/SKILL.md +3 -3
- package/skills/cometchat-troubleshooting/SKILL.md +2 -2
|
@@ -3,7 +3,7 @@ name: cometchat-customization
|
|
|
3
3
|
description: Customize a CometChat React UI Kit integration beyond what `cometchat init` and `cometchat apply-feature` produce — custom message bubbles, custom header views, custom subtitle views, custom empty/loading states, custom action menus, request builder filters, event listeners, and component composition. Picks up where the framework skills end (after Phase A init succeeds).
|
|
4
4
|
license: "MIT"
|
|
5
5
|
compatibility: "Node.js >=18; @cometchat/chat-uikit-react ^6"
|
|
6
|
-
allowed-tools: "
|
|
6
|
+
allowed-tools: "shell, file-read, file-search, file-list, grep"
|
|
7
7
|
metadata:
|
|
8
8
|
author: "CometChat"
|
|
9
9
|
version: "3.0.0"
|
|
@@ -20,7 +20,7 @@ metadata:
|
|
|
20
20
|
|
|
21
21
|
## Use this skill when
|
|
22
22
|
|
|
23
|
-
The user has already run `/cometchat` (Phase A complete — there's a
|
|
23
|
+
The user has already run `/cometchat` (or invoked the cometchat skill via their agent's mechanism — keyword "cometchat" or "integrate chat" works in most agents) (Phase A complete — there's a
|
|
24
24
|
working integration with `.cometchat/state.json`) and wants to **change
|
|
25
25
|
how a component looks or behaves** beyond what the CLI's deterministic
|
|
26
26
|
commands handle.
|
|
@@ -3,7 +3,7 @@ name: cometchat-features
|
|
|
3
3
|
description: Add features (calls, reactions, polls, file sharing, presence, etc.) to an already-integrated CometChat project. Routes to the right sub-flow based on feature type — default (already enabled), extension (API toggle), ai-feature (API toggle + OpenAI key), dashboard-only (third-party config), package-install (calls), or component-swap (rich text).
|
|
4
4
|
license: "MIT"
|
|
5
5
|
compatibility: "Node.js >=18; @cometchat/chat-uikit-react ^6; integration must already be applied"
|
|
6
|
-
allowed-tools: "
|
|
6
|
+
allowed-tools: "shell, file-read, file-search, file-list"
|
|
7
7
|
metadata:
|
|
8
8
|
author: "CometChat"
|
|
9
9
|
version: "3.0.0"
|
|
@@ -31,7 +31,7 @@ is prevents unnecessary work.
|
|
|
31
31
|
The user wants to add a specific feature to an already-integrated CometChat
|
|
32
32
|
project. Trigger phrases:
|
|
33
33
|
|
|
34
|
-
- `/cometchat features`
|
|
34
|
+
- `/cometchat features` (or invoke the cometchat-features skill via your agent's mechanism — keyword "cometchat feature" or "add chat feature" works in most agents)
|
|
35
35
|
- `/cometchat features <name>` (e.g. `/cometchat features reactions`)
|
|
36
36
|
- `/cometchat <feature>` (e.g. `/cometchat polls`, `/cometchat calls`)
|
|
37
37
|
- "add reactions to my chat"
|
|
@@ -3,7 +3,7 @@ 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: "
|
|
6
|
+
allowed-tools: "shell, file-read, file-search, file-list"
|
|
7
7
|
metadata:
|
|
8
8
|
author: "CometChat"
|
|
9
9
|
version: "3.0.0"
|
|
@@ -1,41 +1,84 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: cometchat-flutter-v5-calls
|
|
3
|
-
description:
|
|
3
|
+
description: CometChat Calls integration for Flutter UIKit v5 (GetX-based, cometchat_calls_uikit separate package). Covers package wiring (cometchat_calls_uikit ^5.0.15 alongside cometchat_chat_uikit ^5.2), CometChatCallingExtension via UIKitSettingsBuilder, CallNavigationContext.navigatorKey, the kit's CometChatCallButtons / CometChatIncomingCall / CometChatOutgoingCall / CometChatOngoingCall / CometChatCallLogs widgets, dual-SDK ringing (CometChat.initiateCall + CometChatUIKitCalls.joinSession), Android FCM + ConnectionService for VoIP push, iOS CallKit + PushKit, foreground service correctness on Android 14+, hangup cleanup, and additive-vs-standalone modes.
|
|
4
4
|
license: "MIT"
|
|
5
|
-
compatibility: "cometchat_calls_uikit ^5.0.15; cometchat_calls_sdk ^4.2.2; cometchat_sdk ^4.1.2"
|
|
6
|
-
allowed-tools: "
|
|
5
|
+
compatibility: "Flutter >= 2.5, Dart >= 2.17; cometchat_chat_uikit ^5.2.14; cometchat_calls_uikit ^5.0.15; cometchat_calls_sdk ^4.2.2; cometchat_sdk ^4.1.2"
|
|
6
|
+
allowed-tools: "shell, file-read, file-search, file-list, ask-user"
|
|
7
7
|
metadata:
|
|
8
8
|
author: "CometChat"
|
|
9
|
-
version: "
|
|
10
|
-
tags: "cometchat flutter v5 calls voice video incoming outgoing ongoing logs"
|
|
9
|
+
version: "4.0.0"
|
|
10
|
+
tags: "cometchat flutter v5 calls voice video webrtc getx incoming outgoing ongoing call-logs callkit pushkit connectionservice fcm voip-push foreground-service navigatorkey calling-extension"
|
|
11
11
|
---
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
## Purpose
|
|
14
14
|
|
|
15
|
-
|
|
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:
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
- **Standalone** — calls is the product. `cometchat_chat_sdk` (signaling) + `cometchat_calls_sdk` (WebRTC) without the `cometchat_chat_uikit` UI Kit. Custom call screens (or hand-roll the kit's call widgets without the conversation kit). **VoIP push is mandatory** — same rule as native iOS / Android.
|
|
18
|
+
- **Additive** — calls layered onto an existing v5 chat integration. Adds `cometchat_calls_uikit` package, configures the calling extension via `UIKitSettingsBuilder.callingExtension`, sets `CallNavigationContext.navigatorKey` on `MaterialApp`, mounts the global incoming-call listener at the app shell.
|
|
18
19
|
|
|
19
|
-
|
|
20
|
+
**Read these other skills first:**
|
|
21
|
+
- `cometchat-calls` — dispatcher (modes, hard rules, anti-patterns)
|
|
22
|
+
- `cometchat-flutter-v5-core` — UIKitSettingsBuilder, init/login order, GetX scope rules, app entry conventions
|
|
23
|
+
- `cometchat-flutter-v5-events` — CometChatMessageEvents / CometChatCallEvents subscription patterns
|
|
20
24
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
25
|
+
**Ground truth:**
|
|
26
|
+
- SDK source — `~/Downloads/calls-sdk/calls-sdk-flutter-5/sdk/`
|
|
27
|
+
- Sample app — `~/Downloads/calls-sdk/calls-sdk-flutter-5/sample-apps/`
|
|
28
|
+
- Public docs — https://www.cometchat.com/docs/calls/flutter/overview
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## 1. The seven hard rules — Flutter v5 specialization
|
|
33
|
+
|
|
34
|
+
### 1.0 Calls SDK login is its own step (v5+)
|
|
35
|
+
|
|
36
|
+
The v5 Calls SDK has its own auth state, separate from the Chat SDK. After `CometChat.login` succeeds, you MUST also call `CometChatCalls.login` — without it, the FIRST calls API call throws **"auth token cannot be null"**.
|
|
37
|
+
|
|
38
|
+
```dart
|
|
39
|
+
import 'package:cometchat_sdk/cometchat_sdk.dart';
|
|
40
|
+
import 'package:cometchat_calls_sdk/cometchat_calls_sdk.dart';
|
|
41
|
+
|
|
42
|
+
CometChat.login(uid, AUTH_KEY,
|
|
43
|
+
onSuccess: (User user) {
|
|
44
|
+
// Chat SDK ready — now login Calls SDK
|
|
45
|
+
CometChatCalls.login(
|
|
46
|
+
uid: uid,
|
|
47
|
+
authKey: AUTH_KEY,
|
|
48
|
+
onSuccess: (User? callUser) {
|
|
49
|
+
// both ready
|
|
50
|
+
},
|
|
51
|
+
onError: (CometChatException e) {
|
|
52
|
+
// surface to user
|
|
53
|
+
},
|
|
54
|
+
);
|
|
55
|
+
},
|
|
56
|
+
onError: (CometChatException e) {
|
|
57
|
+
// chat login failed
|
|
58
|
+
},
|
|
59
|
+
);
|
|
24
60
|
```
|
|
25
61
|
|
|
26
|
-
|
|
62
|
+
For production with server-minted tokens:
|
|
63
|
+
|
|
27
64
|
```dart
|
|
28
|
-
|
|
65
|
+
CometChatCalls.loginWithAuthToken(
|
|
66
|
+
authToken: tokenFromBackend,
|
|
67
|
+
onSuccess: (User? user) { /* … */ },
|
|
68
|
+
onError: (CometChatException e) { /* … */ },
|
|
69
|
+
);
|
|
29
70
|
```
|
|
30
71
|
|
|
31
|
-
|
|
72
|
+
**Surprises:**
|
|
73
|
+
- Chat SDK persists login via shared preferences across launches. The **Calls SDK does NOT** — always check `CometChatCalls.getLoggedInUser()` on app start and re-login if it returns null.
|
|
74
|
+
- The Calls SDK's onSuccess hands back `User?` (nullable) — guard before using.
|
|
32
75
|
|
|
33
|
-
|
|
76
|
+
### 1.1 Dual-SDK contract — `CometChatCallingExtension` hides it (additive); standalone code sees both
|
|
34
77
|
|
|
35
|
-
|
|
78
|
+
In additive mode, the `CometChatCallingExtension` registered via `UIKitSettingsBuilder.callingExtension` wires both SDKs internally — your code rarely touches `CometChatUIKitCalls` directly. In standalone mode (no UI Kit), you call both SDKs explicitly:
|
|
36
79
|
|
|
37
80
|
```dart
|
|
38
|
-
//
|
|
81
|
+
// ✓ RIGHT — additive mode (calling extension owns the dual-SDK split)
|
|
39
82
|
final settings = (UIKitSettingsBuilder()
|
|
40
83
|
..appId = 'APP_ID'
|
|
41
84
|
..region = 'us'
|
|
@@ -43,86 +86,152 @@ final settings = (UIKitSettingsBuilder()
|
|
|
43
86
|
..subscriptionType = CometChatSubscriptionType.allUsers
|
|
44
87
|
..callingExtension = CometChatCallingExtension())
|
|
45
88
|
.build();
|
|
46
|
-
|
|
47
89
|
CometChatUIKit.init(uiKitSettings: settings);
|
|
48
90
|
```
|
|
49
91
|
|
|
50
|
-
|
|
92
|
+
```dart
|
|
93
|
+
// ✓ RIGHT — standalone mode (explicit dual-SDK)
|
|
94
|
+
import 'package:cometchat_chat_sdk/cometchat_chat_sdk.dart';
|
|
95
|
+
import 'package:cometchat_calls_sdk/cometchat_calls_sdk.dart';
|
|
96
|
+
|
|
97
|
+
// Chat SDK — initiate ringing
|
|
98
|
+
final outgoing = Call(receiverUid, CometChatReceiverType.user, CometChatCallType.video);
|
|
99
|
+
final initiated = await CometChat.initiateCall(call: outgoing);
|
|
100
|
+
|
|
101
|
+
// Calls SDK — join WebRTC session after acceptance.
|
|
102
|
+
// Use SessionSettingsBuilder + callback shape — matches the upstream sample
|
|
103
|
+
// at calls-sdk-flutter-5/sample-apps/cometchat-calls-sample-app-flutter/.
|
|
104
|
+
// CallSettingsBuilder is the chat-side type; SessionSettingsBuilder is what
|
|
105
|
+
// session/joinSession accepts.
|
|
106
|
+
final sessionSettings = (SessionSettingsBuilder()
|
|
107
|
+
.setTitle('CometChat Call')
|
|
108
|
+
.startVideoPaused(false)
|
|
109
|
+
.startAudioMuted(false))
|
|
110
|
+
.build();
|
|
51
111
|
|
|
52
|
-
|
|
112
|
+
CometChatCalls.joinSession(
|
|
113
|
+
sessionId: sessionId,
|
|
114
|
+
sessionSettings: sessionSettings,
|
|
115
|
+
onSuccess: (Widget? widget) {
|
|
116
|
+
// render widget via SizedBox.expand; register SessionStatusListeners
|
|
117
|
+
},
|
|
118
|
+
onError: (CometChatCallsException err) {
|
|
119
|
+
debugPrint('joinSession failed: ${err.message}');
|
|
120
|
+
},
|
|
121
|
+
);
|
|
122
|
+
```
|
|
53
123
|
|
|
54
|
-
|
|
124
|
+
### 1.2 VoIP push — `flutter_callkit_incoming` + `firebase_messaging` + platform-channel bridges
|
|
55
125
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
)
|
|
126
|
+
Standalone mode requires working VoIP push end-to-end. The Flutter stack:
|
|
127
|
+
|
|
128
|
+
- **`flutter_callkit_incoming`** — bridges CallKit (iOS) and a custom heads-up notification (Android). Single Dart API for "ring this device".
|
|
129
|
+
- **`firebase_messaging`** — FCM data messages on Android (priority `high`, `data` payload — NOT `notification`).
|
|
130
|
+
- **iOS PushKit** — Flutter doesn't have a first-party PushKit plugin; the skill ships a tiny platform-channel bridge in `ios/Runner/AppDelegate.swift` registering `PKPushRegistry.voIP` and forwarding payloads through a `MethodChannel` to Dart.
|
|
131
|
+
- **Server side** — same split as native: PushKit (VoIP cert) for iOS, FCM data-message for Android.
|
|
132
|
+
|
|
133
|
+
In additive mode, this is opt-in but recommended.
|
|
134
|
+
|
|
135
|
+
### 1.3 Foreground service — Android 14+ rules apply unchanged
|
|
136
|
+
|
|
137
|
+
**⚠️ Android build prerequisite — Jetifier is mandatory.** One of the `cometchat_calls_uikit` transitive deps pulls in the legacy `com.android.support:support-compat:26.1.0` AAR. Without Jetifier, AGP fails the assembleDebug step with dozens of `Duplicate class android.support.v4.*` errors against `androidx.core`. Set in `android/gradle.properties`:
|
|
138
|
+
|
|
139
|
+
```properties
|
|
140
|
+
android.useAndroidX=true
|
|
141
|
+
android.enableJetifier=true
|
|
60
142
|
```
|
|
61
143
|
|
|
62
|
-
|
|
144
|
+
Flutter 3.x scaffolds omit `enableJetifier=true` by default — the build blows up on the first `flutter build apk` if you skip this. The error is loud but the fix is one line.
|
|
63
145
|
|
|
64
|
-
|
|
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).
|
|
65
147
|
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
|
|
148
|
+
```xml
|
|
149
|
+
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
|
150
|
+
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_PHONE_CALL" />
|
|
151
|
+
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MICROPHONE" />
|
|
152
|
+
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_CAMERA" />
|
|
153
|
+
<uses-permission android:name="android.permission.MANAGE_OWN_CALLS" />
|
|
154
|
+
<uses-permission android:name="android.permission.BIND_TELECOM_CONNECTION_SERVICE"
|
|
155
|
+
tools:ignore="ProtectedPermissions" />
|
|
69
156
|
```
|
|
70
157
|
|
|
71
|
-
|
|
158
|
+
Silent crash on Android 14+ if `FOREGROUND_SERVICE_PHONE_CALL` is missing. The `tools` namespace must be declared on the `<manifest>` element.
|
|
159
|
+
|
|
160
|
+
### 1.4 Server-minted auth tokens
|
|
72
161
|
|
|
73
|
-
|
|
162
|
+
`cometchat-flutter-v5-production` covers the token-endpoint pattern. Production calls path uses `CometChatUIKit.loginWithAuthToken(token)`, not `loginWithAuthKey(uid, authKey)`. The Calls SDK piggybacks on the Chat SDK auth context — there is no separate calls-only token.
|
|
74
163
|
|
|
75
|
-
|
|
164
|
+
### 1.5 Hangup cleanup — Dart + native + system call UI
|
|
76
165
|
|
|
77
166
|
```dart
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
167
|
+
Future<void> endCall(String sessionId) async {
|
|
168
|
+
// 1. End the Calls SDK session — releases WebRTC tracks.
|
|
169
|
+
// CometChatCalls.endSession() does NOT exist on Flutter — use the
|
|
170
|
+
// CallSession singleton's leaveSession().
|
|
171
|
+
await CallSession.getInstance().leaveSession();
|
|
172
|
+
await CometChatOngoingCallService.abort();
|
|
173
|
+
|
|
174
|
+
// 2. Tell the OS-level call UI the call ended
|
|
175
|
+
await FlutterCallkitIncoming.endAllCalls();
|
|
176
|
+
|
|
177
|
+
// 3. Pop the call screen
|
|
178
|
+
if (mounted) {
|
|
179
|
+
Navigator.of(context, rootNavigator: true).popUntil((r) => r.isFirst);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
// 4. After logout flows: reset ServiceLocator if it was used directly
|
|
183
|
+
// (UIKit handles this for additive mode)
|
|
184
|
+
}
|
|
88
185
|
```
|
|
89
186
|
|
|
90
|
-
|
|
187
|
+
Skipping `FlutterCallkitIncoming.endAllCalls` leaves the lock-screen/heads-up call UI stuck. Skipping the `Navigator.popUntil` strands the Dart-side call screen with WebRTC views still in the tree.
|
|
91
188
|
|
|
92
|
-
|
|
189
|
+
### 1.6 Permissions — `permission_handler` + Info.plist + AndroidManifest
|
|
93
190
|
|
|
94
|
-
|
|
191
|
+
```dart
|
|
192
|
+
import 'package:permission_handler/permission_handler.dart';
|
|
95
193
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
- `CometChatOngoingCall(callSettingsBuilder: ..., sessionId: ...)`
|
|
194
|
+
await [Permission.camera, Permission.microphone, Permission.notification].request();
|
|
195
|
+
```
|
|
99
196
|
|
|
100
|
-
|
|
197
|
+
iOS — `ios/Runner/Info.plist`:
|
|
198
|
+
```xml
|
|
199
|
+
<key>NSCameraUsageDescription</key>
|
|
200
|
+
<string>So you can be seen during video calls.</string>
|
|
201
|
+
<key>NSMicrophoneUsageDescription</key>
|
|
202
|
+
<string>So you can talk during voice and video calls.</string>
|
|
203
|
+
<key>UIBackgroundModes</key>
|
|
204
|
+
<array>
|
|
205
|
+
<string>audio</string>
|
|
206
|
+
<string>voip</string>
|
|
207
|
+
<string>remote-notification</string>
|
|
208
|
+
</array>
|
|
209
|
+
```
|
|
101
210
|
|
|
102
|
-
|
|
103
|
-
2. `CometChatOutgoingCall` screen pushed
|
|
104
|
-
3. Recipient accepts → `CometChatOngoingCall` replaces outgoing
|
|
105
|
-
4. Call ends → screens pop back
|
|
211
|
+
Android — manifest as above (rule 1.3) plus runtime requests via `permission_handler`.
|
|
106
212
|
|
|
107
|
-
|
|
213
|
+
### 1.7 IncomingCall mounted at app root + `CallNavigationContext.navigatorKey`
|
|
108
214
|
|
|
109
|
-
|
|
110
|
-
2. `CometChatIncomingCall` overlay displayed via `CallNavigationContext.navigatorKey`
|
|
111
|
-
3. Accept → `CometChatUIKitCalls.acceptCall(sessionId)` → `CometChatOngoingCall`
|
|
112
|
-
4. Decline → `CometChatUIKitCalls.rejectCall(sessionId, status)`
|
|
215
|
+
V5 uses GetX's navigator key pattern. `CallNavigationContext.navigatorKey` MUST be set on `MaterialApp.navigatorKey` so call overlays can navigate even when a call is initiated from a sub-route:
|
|
113
216
|
|
|
114
|
-
|
|
217
|
+
```dart
|
|
218
|
+
// ✓ RIGHT
|
|
219
|
+
MaterialApp(
|
|
220
|
+
navigatorKey: CallNavigationContext.navigatorKey,
|
|
221
|
+
// ...
|
|
222
|
+
);
|
|
223
|
+
```
|
|
115
224
|
|
|
116
|
-
|
|
225
|
+
Global call listener registration (incoming calls fire app-wide) belongs in the app shell's State, not in a feature screen:
|
|
117
226
|
|
|
118
227
|
```dart
|
|
119
|
-
class
|
|
228
|
+
class AppShellState extends State<AppShell>
|
|
120
229
|
with CallListener, CometChatCallEventListener {
|
|
230
|
+
static const _listenerId = 'app-shell-call-listener';
|
|
121
231
|
|
|
122
232
|
@override
|
|
123
233
|
void initState() {
|
|
124
234
|
super.initState();
|
|
125
|
-
_listenerId = 'calls_${DateTime.now().millisecondsSinceEpoch}';
|
|
126
235
|
CometChat.addCallListener(_listenerId, this);
|
|
127
236
|
CometChatCallEvents.addCallEventsListener(_listenerId, this);
|
|
128
237
|
}
|
|
@@ -136,57 +245,179 @@ class _DashboardState extends State<Dashboard>
|
|
|
136
245
|
|
|
137
246
|
@override
|
|
138
247
|
void onIncomingCallReceived(Call call) {
|
|
139
|
-
//
|
|
248
|
+
// Route through CallNavigationContext or flutter_callkit_incoming
|
|
140
249
|
}
|
|
141
250
|
}
|
|
142
251
|
```
|
|
143
252
|
|
|
144
|
-
|
|
253
|
+
Use a stable string ID for the listener — duplicate IDs overwrite, distinct IDs fire both (double-ring bug).
|
|
145
254
|
|
|
146
|
-
|
|
255
|
+
---
|
|
147
256
|
|
|
148
|
-
|
|
149
|
-
|
|
257
|
+
## 2. Setup
|
|
258
|
+
|
|
259
|
+
```yaml
|
|
260
|
+
# pubspec.yaml
|
|
261
|
+
dependencies:
|
|
262
|
+
flutter:
|
|
263
|
+
sdk: flutter
|
|
264
|
+
cometchat_chat_uikit: ^5.2.14 # additive mode — already there
|
|
265
|
+
cometchat_calls_uikit: ^5.0.15 # adds the calling extension + widgets
|
|
266
|
+
permission_handler: ^11.0.0 # rule 1.6
|
|
267
|
+
flutter_callkit_incoming: ^2.0.0 # standalone — VoIP UI bridge
|
|
268
|
+
firebase_messaging: ^14.0.0 # standalone — Android FCM
|
|
269
|
+
firebase_core: ^2.0.0 # firebase_messaging peer
|
|
150
270
|
```
|
|
151
271
|
|
|
152
|
-
|
|
272
|
+
Hosted source if pub.dev resolution lags:
|
|
273
|
+
|
|
274
|
+
```yaml
|
|
275
|
+
cometchat_calls_uikit:
|
|
276
|
+
hosted: https://dart.cloudsmith.io/cometchat/cometchat/
|
|
277
|
+
version: ^5.0.15
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
Init order — calling extension flows the dual-SDK init internally:
|
|
153
281
|
|
|
154
282
|
```dart
|
|
155
|
-
// 1. Configure calling extension
|
|
156
283
|
final settings = (UIKitSettingsBuilder()
|
|
157
|
-
..appId =
|
|
158
|
-
..region =
|
|
159
|
-
..authKey =
|
|
284
|
+
..appId = CometChatConfig.appId
|
|
285
|
+
..region = CometChatConfig.region
|
|
286
|
+
..authKey = CometChatConfig.authKey
|
|
160
287
|
..subscriptionType = CometChatSubscriptionType.allUsers
|
|
161
|
-
..callingExtension = CometChatCallingExtension())
|
|
288
|
+
..callingExtension = CometChatCallingExtension()) // ← rule 1.1 (additive)
|
|
162
289
|
.build();
|
|
163
290
|
|
|
164
|
-
|
|
165
|
-
|
|
291
|
+
await CometChatUIKit.init(uiKitSettings: settings);
|
|
292
|
+
```
|
|
166
293
|
|
|
167
|
-
|
|
168
|
-
MaterialApp(navigatorKey: CallNavigationContext.navigatorKey)
|
|
294
|
+
In standalone mode (no UI Kit), use the SDKs directly:
|
|
169
295
|
|
|
170
|
-
|
|
296
|
+
```dart
|
|
297
|
+
await CometChat.init(CometChatConfig.appId, AppSettings.builder
|
|
298
|
+
..setRegion(CometChatConfig.region)
|
|
299
|
+
..subscribePresenceForAllUsers());
|
|
300
|
+
|
|
301
|
+
await CometChatCalls.init(CallAppSettings.builder
|
|
302
|
+
..setAppId(CometChatConfig.appId)
|
|
303
|
+
..setRegion(CometChatConfig.region));
|
|
171
304
|
```
|
|
172
305
|
|
|
173
|
-
|
|
306
|
+
---
|
|
307
|
+
|
|
308
|
+
## 3. Components catalog (UI Kit widgets)
|
|
309
|
+
|
|
310
|
+
Imports (additive mode — barrel re-exports `cometchat_uikit_shared`, `cometchat_sdk`, `cometchat_calls_sdk`):
|
|
174
311
|
|
|
175
312
|
```dart
|
|
176
|
-
|
|
177
|
-
|
|
313
|
+
import 'package:cometchat_calls_uikit/cometchat_calls_uikit.dart';
|
|
314
|
+
```
|
|
178
315
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
316
|
+
| Widget | Purpose |
|
|
317
|
+
|---|---|
|
|
318
|
+
| `CometChatCallButtons(user: ..., group: ...)` | Voice + video buttons. Drop into `CometChatMessageHeader` trailing slot or anywhere in the tree. Mutually exclusive `user` / `group`. |
|
|
319
|
+
| `CometChatIncomingCall(call:, onAccept:, onDecline:)` | Foreground in-app ring UI (additive mode). **Callbacks take `(BuildContext, Call)`, NOT `(Call)` alone** — common mistake. |
|
|
320
|
+
| `CometChatOutgoingCall(call:, user: OR group:, onCancelled:)` | Dialing UI. `call:` is the result of `CometChatUIKitCalls.initiateCall(...)`. Callbacks `(BuildContext, Call)?`. |
|
|
321
|
+
| `CometChatOngoingCall(callSettingsBuilder:, sessionId:)` | Active call view, hosts WebRTC. |
|
|
322
|
+
| `CometChatCallLogs(onItemClick:, callLogsRequestBuilder:)` | Paginated history. **`CometChatCallLogDetails` is NOT a UIKit export** — copy the sample-app pattern from `~/Downloads/calls-sdk/calls-sdk-flutter-5/sample-apps/.../call_log_details/` for the detail screen. |
|
|
323
|
+
|
|
324
|
+
`CometChatUIKitCalls` API:
|
|
325
|
+
|
|
326
|
+
| Method | Purpose |
|
|
327
|
+
|---|---|
|
|
328
|
+
| `CometChatUIKitCalls.initiateCall(call)` | Start a call (wraps Chat SDK `initiateCall` + Calls SDK preflight) |
|
|
329
|
+
| `CometChatUIKitCalls.acceptCall(sessionId)` | Accept incoming |
|
|
330
|
+
| `CometChatUIKitCalls.rejectCall(sessionId, status)` | Reject / cancel |
|
|
331
|
+
| `CometChatUIKitCalls.generateToken(sessionId)` | Mint session-scoped RTC token |
|
|
332
|
+
| `CometChatUIKitCalls.startSession(sessionId, settings)` | Start WebRTC |
|
|
333
|
+
| `CometChatUIKitCalls.endSession()` | End and cleanup |
|
|
182
334
|
|
|
183
|
-
|
|
184
|
-
|
|
335
|
+
---
|
|
336
|
+
|
|
337
|
+
## 4. Standalone integration
|
|
338
|
+
|
|
339
|
+
When `product === "voice-video"` and there is no v5 chat integration.
|
|
340
|
+
|
|
341
|
+
**Split by calling mode:**
|
|
342
|
+
|
|
343
|
+
### 4a. Standalone — Session mode (meeting-room UX, no ringing)
|
|
344
|
+
|
|
345
|
+
Calls SDK ONLY. NO Chat SDK. Matches `~/Downloads/calls-sdk/calls-sdk-flutter-5/sample-apps/cometchat-calls-sample-app-flutter/`. Scaffold:
|
|
346
|
+
|
|
347
|
+
1. **`pubspec.yaml`** — `cometchat_calls_sdk: ^5.0.0` ONLY. No `cometchat_chat_sdk` / `cometchat_uikit_chat`.
|
|
348
|
+
2. **`lib/main.dart`** — `CometChatCalls.init(appId, region, authKey)` + `permission_handler` flow.
|
|
349
|
+
3. **`lib/screens/call_screen.dart`** — `StatefulWidget implements SessionStatusListeners, ButtonClickListeners`. `CometChatCalls.joinSession(sessionId:, sessionSettings: SessionSettingsBuilder().build(), onSuccess:, onError:)`. `CometChatOngoingCallService.launch/abort`. See `references/call-session.md`.
|
|
350
|
+
4. **Native config** — Camera + microphone permissions only (no PushKit, no FCM for VoIP).
|
|
351
|
+
|
|
352
|
+
**Why no Chat SDK / no VoIP push:** session mode never touches a Chat SDK call entity. No ringing.
|
|
353
|
+
|
|
354
|
+
### 4b. Standalone — Ringing mode (CallKit + FCM + UIKit-driven UI)
|
|
355
|
+
|
|
356
|
+
Dual-SDK: Chat SDK signaling + Calls SDK media. Scaffold:
|
|
357
|
+
|
|
358
|
+
1. **`lib/main.dart`** — Chat SDK + Calls SDK init (no UIKit). Permission_handler request flow. PushKit + FCM listener registration.
|
|
359
|
+
2. **`lib/services/voip_service.dart`** — Combines `flutter_callkit_incoming` events + `firebase_messaging` + iOS platform-channel PushKit. On payload → `FlutterCallkitIncoming.showCallkitIncoming(...)`. On accept → navigate to ongoing-call screen.
|
|
360
|
+
3. **`lib/widgets/call_button.dart`** — Voice + video icon buttons rendered next to a user / contact.
|
|
361
|
+
4. **`lib/screens/ongoing_call_screen.dart`** — `CometChatCalls.joinSession(sessionId:, sessionSettings:, onSuccess:, onError:)` with the returned Widget rendered via `SizedBox.expand`. Implements rule 1.5 cleanup. Sets `resizeToAvoidBottomInset: false`.
|
|
362
|
+
5. **`lib/screens/call_logs_screen.dart`** — `/calls` route. Paginated via `CallLogsRequestBuilder`.
|
|
363
|
+
6. **`MaterialApp.navigatorKey: CallNavigationContext.navigatorKey`** — rule 1.7.
|
|
364
|
+
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
|
+
|
|
366
|
+
## 5. Additive integration
|
|
367
|
+
|
|
368
|
+
When chat is already integrated. The skill:
|
|
369
|
+
|
|
370
|
+
1. Adds `cometchat_calls_uikit` to `pubspec.yaml`.
|
|
371
|
+
2. Patches the existing `UIKitSettingsBuilder` to add `..callingExtension = CometChatCallingExtension()`.
|
|
372
|
+
3. Sets `CallNavigationContext.navigatorKey` on `MaterialApp.navigatorKey` (rule 1.7).
|
|
373
|
+
4. Mounts the global call listener in the app-shell `State` (rule 1.7).
|
|
374
|
+
5. Confirms `CometChatMessageHeader` already shows call buttons (auto-rendered when `user` / `group` is passed).
|
|
375
|
+
6. Optionally adds `CometChatCallLogs` as a tab/screen if user picked dedicated history.
|
|
376
|
+
7. VoIP push: opt-in (substantial native config).
|
|
377
|
+
|
|
378
|
+
## 6. Anti-patterns
|
|
379
|
+
|
|
380
|
+
1. **`MaterialApp` without `CallNavigationContext.navigatorKey`.** Call overlays can't navigate; in-app ring works but accept-into-ongoing breaks. Rule 1.7.
|
|
381
|
+
2. **Forgetting `..callingExtension = CometChatCallingExtension()`** on `UIKitSettingsBuilder`. Calls compile but `CometChatMessageHeader` doesn't show call icons; nothing rings. Most common additive-mode mistake.
|
|
382
|
+
3. **`onAccept` / `onDecline` typed as `Function(Call)`** instead of `Function(BuildContext, Call)`. Compile errors are obvious; the dangerous case is when an agent wraps an existing chat screen's accept handler and silently mismatches signatures.
|
|
383
|
+
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
|
+
5. **Skipping `resizeToAvoidBottomInset: false`** on Scaffolds with call UI. Keyboard-show during a call resizes WebRTC views and breaks layout.
|
|
385
|
+
6. **Mixing `cometchat_chat_uikit ^5.x` with `cometchat_calls_uikit ^4.x`** (or vice versa). Internal SDK pin clash. Both UI Kit packages must be on matching majors.
|
|
386
|
+
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
|
+
|
|
388
|
+
## 7. Verification checklist
|
|
389
|
+
|
|
390
|
+
**Static:**
|
|
391
|
+
|
|
392
|
+
- [ ] `cometchat_calls_uikit ^5.0.15` in `pubspec.yaml` (additive) OR `cometchat_calls_sdk ^4.2.2` + `cometchat_sdk ^4.1.2` (standalone)
|
|
393
|
+
- [ ] `..callingExtension = CometChatCallingExtension()` on `UIKitSettingsBuilder` (additive)
|
|
394
|
+
- [ ] `MaterialApp.navigatorKey` is `CallNavigationContext.navigatorKey`
|
|
395
|
+
- [ ] Global call listener attached in app-shell State, removed in `dispose`
|
|
396
|
+
- [ ] Listener uses a stable string ID
|
|
397
|
+
- [ ] Camera + microphone + notification permissions requested via `permission_handler`
|
|
398
|
+
- [ ] iOS `Info.plist`: NSCameraUsageDescription + NSMicrophoneUsageDescription + UIBackgroundModes (audio + voip + remote-notification)
|
|
399
|
+
- [ ] Android manifest: four FOREGROUND_SERVICE_* permissions + MANAGE_OWN_CALLS + BIND_TELECOM_CONNECTION_SERVICE
|
|
400
|
+
- [ ] Hangup path: `endSession()` + `FlutterCallkitIncoming.endAllCalls()` + `Navigator.popUntil` (rule 1.5)
|
|
401
|
+
- [ ] **Standalone only:** Firebase configured (`google-services.json` + `GoogleService-Info.plist`)
|
|
402
|
+
- [ ] **Standalone only:** `flutter_callkit_incoming` + `firebase_messaging` + iOS PushKit platform-channel bridge
|
|
403
|
+
|
|
404
|
+
**Runtime (real devices, both platforms):**
|
|
405
|
+
|
|
406
|
+
- [ ] iOS — terminated app, lock-screen rings on incoming call
|
|
407
|
+
- [ ] iOS — answer from lock screen → opens app, joins ongoing call
|
|
408
|
+
- [ ] Android — terminated app, heads-up notification rings on incoming call
|
|
409
|
+
- [ ] Android — answer from heads-up → opens app, joins ongoing call
|
|
410
|
+
- [ ] Both — outgoing call connects, two-way audio + video
|
|
411
|
+
- [ ] Both — hangup releases camera + mic, no system call UI stuck
|
|
412
|
+
- [ ] Android 14+: ongoing-call notification visible, swipe-up doesn't kill the call
|
|
413
|
+
- [ ] Keyboard-show during call doesn't break WebRTC view (rule from anti-pattern 5)
|
|
185
414
|
|
|
186
|
-
##
|
|
415
|
+
## 8. Pointers
|
|
187
416
|
|
|
188
|
-
-
|
|
189
|
-
-
|
|
190
|
-
-
|
|
191
|
-
-
|
|
192
|
-
-
|
|
417
|
+
- `cometchat-calls` — dispatcher
|
|
418
|
+
- `cometchat-flutter-v5-core` — UIKitSettingsBuilder, init/login order, GetX scope
|
|
419
|
+
- `cometchat-flutter-v5-events` — CometChatCallEvents subscription patterns
|
|
420
|
+
- `cometchat-flutter-v5-push` — FCM/APNs for chat (overlap with VoIP push but distinct paths)
|
|
421
|
+
- `cometchat-flutter-v5-production` — server-minted tokens, ProGuard, environment config
|
|
422
|
+
- `cometchat-flutter-v5-troubleshooting` — pubspec conflicts, GetX issues, Pod errors, runtime crashes
|
|
423
|
+
- `cometchat-flutter-v6-calls` + `cometchat-flutter-v6-migration` — when migrating to V6 (calls fold into the unified package, Bloc replaces GetX)
|