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