@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
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
# Device management on Flutter V5 (GetX)
|
|
2
|
+
|
|
3
|
+
The Calls SDK exposes basic camera switching (`switchCamera()`); audio device management goes through platform-channel bridges to native AVAudioSession (iOS) / AudioManager (Android). For most apps, the kit's default control panel handles this; custom UI uses `flutter_callkit_incoming` or platform channels.
|
|
4
|
+
|
|
5
|
+
**Canonical docs:** https://www.cometchat.com/docs/calls/flutter/device-management
|
|
6
|
+
**Read first:** `cometchat-react-calls/references/device-management.md` — UX patterns; the SDK conceptual model carries over.
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## SDK API
|
|
11
|
+
|
|
12
|
+
```dart
|
|
13
|
+
import 'package:cometchat_calls_uikit/cometchat_calls_uikit.dart';
|
|
14
|
+
|
|
15
|
+
// Camera flip
|
|
16
|
+
CometChatCalls.switchCamera();
|
|
17
|
+
|
|
18
|
+
// Speaker toggle (iOS + Android — wraps native AudioManager / AVAudioSession)
|
|
19
|
+
CometChatCalls.setSpeakerEnabled(true);
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Audio routing — flutter_callkit_incoming
|
|
25
|
+
|
|
26
|
+
For Bluetooth / AirPods routing, integrate `flutter_callkit_incoming` which wraps native CallKit on iOS and ConnectionService on Android. It exposes the audio route picker:
|
|
27
|
+
|
|
28
|
+
```dart
|
|
29
|
+
import 'package:flutter_callkit_incoming/flutter_callkit_incoming.dart';
|
|
30
|
+
|
|
31
|
+
// Toggle speaker
|
|
32
|
+
await FlutterCallkitIncoming.setAudioRoute(AudioRoute.speaker);
|
|
33
|
+
await FlutterCallkitIncoming.setAudioRoute(AudioRoute.earpiece);
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
For deep AirPods / Bluetooth control, the recommended pattern is letting the OS handle it via the system audio picker (CallKit on iOS, ConnectionService on Android both expose audio route control natively).
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## Camera flip button
|
|
41
|
+
|
|
42
|
+
```dart
|
|
43
|
+
class CameraFlipButton extends StatelessWidget {
|
|
44
|
+
const CameraFlipButton({super.key});
|
|
45
|
+
|
|
46
|
+
@override
|
|
47
|
+
Widget build(BuildContext context) {
|
|
48
|
+
return IconButton(
|
|
49
|
+
icon: const Icon(Icons.flip_camera_ios),
|
|
50
|
+
onPressed: () {
|
|
51
|
+
CometChatCalls.switchCamera();
|
|
52
|
+
SemanticsService.announce('Camera flipped', TextDirection.ltr);
|
|
53
|
+
},
|
|
54
|
+
tooltip: 'Flip camera',
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## Speaker toggle
|
|
63
|
+
|
|
64
|
+
```dart
|
|
65
|
+
class SpeakerToggle extends GetView<CallController> {
|
|
66
|
+
const SpeakerToggle({super.key});
|
|
67
|
+
|
|
68
|
+
@override
|
|
69
|
+
Widget build(BuildContext context) {
|
|
70
|
+
return Obx(() => IconButton(
|
|
71
|
+
icon: Icon(controller.speakerOn.value
|
|
72
|
+
? Icons.volume_up
|
|
73
|
+
: Icons.hearing),
|
|
74
|
+
onPressed: () {
|
|
75
|
+
controller.toggleSpeaker();
|
|
76
|
+
},
|
|
77
|
+
tooltip: controller.speakerOn.value ? 'Switch to earpiece' : 'Switch to speaker',
|
|
78
|
+
));
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
class CallController extends GetxController {
|
|
83
|
+
final speakerOn = false.obs;
|
|
84
|
+
|
|
85
|
+
void toggleSpeaker() {
|
|
86
|
+
speakerOn.value = !speakerOn.value;
|
|
87
|
+
CometChatCalls.setSpeakerEnabled(speakerOn.value);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
## Anti-patterns
|
|
95
|
+
|
|
96
|
+
Web sister rules apply, plus Flutter-specific:
|
|
97
|
+
|
|
98
|
+
1. **Custom UI for audio device selection** instead of letting CallKit / ConnectionService handle it. System picker is what users expect.
|
|
99
|
+
2. **Calling `switchCamera` inline without await on the SDK promise.** Some platforms queue the switch; back-to-back calls drop.
|
|
100
|
+
3. **Forgetting `flutter_callkit_incoming.setAudioRoute` doesn't work without an active call session.** Call must be live.
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## Verification checklist
|
|
105
|
+
|
|
106
|
+
- [ ] Camera flip wired to `CometChatCalls.switchCamera()`
|
|
107
|
+
- [ ] Speaker toggle uses `setSpeakerEnabled`
|
|
108
|
+
- [ ] System audio route picker (CallKit / ConnectionService) preferred for Bluetooth
|
|
109
|
+
- [ ] Real-device smoke: speaker toggle works
|
|
110
|
+
- [ ] Real-device smoke: camera flip works
|
|
111
|
+
- [ ] AirPods smoke: connecting AirPods routes audio (CallKit/ConnectionService handles)
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
## Pointers
|
|
116
|
+
|
|
117
|
+
- `cometchat-react-calls/references/device-management.md` — sister web reference (UX shape)
|
|
118
|
+
- `cometchat-flutter-v5-calls` SKILL.md — V5 hard rules
|
|
119
|
+
- `references/voip-push-end-to-end.md` (if you have it) — flutter_callkit_incoming setup
|
|
120
|
+
- Canonical docs: https://www.cometchat.com/docs/calls/flutter/device-management
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
# Group calls — broadcast meeting pattern (Flutter V5)
|
|
2
|
+
|
|
3
|
+
Group calls use a **different signaling channel than 1:1 user calls**. The Ringing flow (`CometChat.initiateCall` → `onIncomingCallReceived` on peer) is **1:1 user only**. For groups, the kit broadcasts a **custom message of type `"meeting"`** to the group; receivers see a "Join meeting" card in `CometChatMessageList` (kit) or need an explicit `MessageListener.onCustomMessageReceived` (custom UI).
|
|
4
|
+
|
|
5
|
+
By-design kit behavior — same semantic across all CometChat kits.
|
|
6
|
+
|
|
7
|
+
**Canonical docs:** https://www.cometchat.com/docs/calls/flutter/group-calls
|
|
8
|
+
|
|
9
|
+
V5 specifics: Flutter V5 uses `cometchat_chat_uikit ^5.2` + `cometchat_calls_uikit ^5.0` (separate calls package). GetX-based state. The signaling semantic below is identical to Flutter V6.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Architecture
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
Caller (uidA, member of groupX) CometChat Receivers (members of groupX)
|
|
17
|
+
│ │ │
|
|
18
|
+
│ CometChatCallButtons sends │ │
|
|
19
|
+
│ CustomMessage(GUID, GROUP, "meeting", │ │
|
|
20
|
+
│ { callType, sessionId }) │ │
|
|
21
|
+
├──────────────────────────────────────>│ │
|
|
22
|
+
│ │ onCustomMessageReceived │
|
|
23
|
+
│ ├─────────────────────────────>│
|
|
24
|
+
│ caller pushes OngoingCallScreen │ receiver taps Join │
|
|
25
|
+
│ with sessionID = groupGuid │ → CometChatUIKitCalls │
|
|
26
|
+
│ │ .startSession(...) │
|
|
27
|
+
├──────────────────────────────────────>│ <─────────────────────────── │
|
|
28
|
+
│ ───── WebRTC session active (sessionId = group GUID) ─────│
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
| Channel | 1:1 user calls | Group calls |
|
|
32
|
+
|---|---|---|
|
|
33
|
+
| Signaling | `CometChat.initiateCall(call, callback)` | `CometChat.sendCustomMessage(message, callback)` (type="meeting") |
|
|
34
|
+
| Receiver event | `CallListener.onIncomingCallReceived` | `MessageListener.onCustomMessageReceived` |
|
|
35
|
+
| Session ID | server-generated unique | group's GUID (persistent) |
|
|
36
|
+
| Ring/decline | yes — `acceptCall` / `rejectCall` | no — receivers join or ignore |
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## Hard rules
|
|
41
|
+
|
|
42
|
+
1. **Group calls broadcast a custom message; they do NOT use the call listener.** Custom UI must add a `MessageListener`.
|
|
43
|
+
2. **Session ID = group GUID.** Persistent.
|
|
44
|
+
3. **`CometChatUIKitCalls.init()` must complete AFTER `CometChatUIKit.init()`** (CALLS_INIT_AFTER_CHAT_INIT rule from SKILL.md) — same as 1:1.
|
|
45
|
+
4. **No `CometChat.endCall` for groups.** Use `CometChatUIKitCalls.endSession()` only.
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## Caller side — kit-based
|
|
50
|
+
|
|
51
|
+
```dart
|
|
52
|
+
import 'package:cometchat_calls_uikit/cometchat_calls_uikit.dart';
|
|
53
|
+
|
|
54
|
+
// Inside a chat surface (e.g. inside CometChatMessageHeader):
|
|
55
|
+
CometChatCallButtons(
|
|
56
|
+
group: group,
|
|
57
|
+
)
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Tap → kit sends meeting `CustomMessage` + pushes outgoing-call screen → transitions to ongoing call with `sessionId = group.guid`.
|
|
61
|
+
|
|
62
|
+
## Caller side — custom UI
|
|
63
|
+
|
|
64
|
+
```dart
|
|
65
|
+
import 'package:flutter_chat_sdk/flutter_chat_sdk.dart';
|
|
66
|
+
|
|
67
|
+
Future<void> startGroupCall(String groupGuid, String callType) async {
|
|
68
|
+
final sessionId = groupGuid;
|
|
69
|
+
final customData = {'callType': callType, 'sessionId': sessionId};
|
|
70
|
+
|
|
71
|
+
final meetingMessage = CustomMessage(
|
|
72
|
+
receiverUid: groupGuid,
|
|
73
|
+
receiverType: CometChatReceiverType.group,
|
|
74
|
+
customData: customData,
|
|
75
|
+
type: 'meeting',
|
|
76
|
+
)
|
|
77
|
+
..category = MessageCategoryConstants.custom
|
|
78
|
+
..metadata = {
|
|
79
|
+
'incrementUnreadCount': true,
|
|
80
|
+
'pushNotification': 'meeting',
|
|
81
|
+
...customData,
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
await CometChat.sendCustomMessage(
|
|
85
|
+
meetingMessage,
|
|
86
|
+
onSuccess: (msg) {
|
|
87
|
+
// Navigate to OngoingCall screen with sessionId
|
|
88
|
+
Navigator.of(context).pushNamed('/ongoing-call', arguments: {
|
|
89
|
+
'sessionId': sessionId,
|
|
90
|
+
'callType': callType,
|
|
91
|
+
});
|
|
92
|
+
},
|
|
93
|
+
onError: (e) {/* surface error */},
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## Receiver side — kit-based
|
|
101
|
+
|
|
102
|
+
`CometChatMessageList(group: group)` auto-renders the meeting message as a "Join meeting" card. Tap → kit calls `generateToken` and pushes the ongoing-call screen with `sessionId = group.guid`.
|
|
103
|
+
|
|
104
|
+
## Receiver side — custom UI
|
|
105
|
+
|
|
106
|
+
```dart
|
|
107
|
+
import 'package:flutter_chat_sdk/flutter_chat_sdk.dart';
|
|
108
|
+
|
|
109
|
+
const groupMeetingListenerId = 'APP_ROOT_GROUP_MEETING_LISTENER';
|
|
110
|
+
|
|
111
|
+
void registerGroupMeetingListener() {
|
|
112
|
+
CometChat.addMessageListener(
|
|
113
|
+
groupMeetingListenerId,
|
|
114
|
+
MessageListener(
|
|
115
|
+
onCustomMessageReceived: (msg) {
|
|
116
|
+
if (msg.category != MessageCategoryConstants.custom) return;
|
|
117
|
+
if (msg.type != 'meeting') return;
|
|
118
|
+
|
|
119
|
+
final customData = msg.customData ?? {};
|
|
120
|
+
final sessionId = customData['sessionId'] as String? ?? msg.receiverUid;
|
|
121
|
+
final callType = customData['callType'] as String? ?? 'video';
|
|
122
|
+
final fromUid = msg.sender?.uid;
|
|
123
|
+
final groupGuid = msg.receiverUid;
|
|
124
|
+
|
|
125
|
+
// Update your state (GetX controller, Provider, Riverpod):
|
|
126
|
+
// Get.find<CallController>().receiveIncomingMeeting(
|
|
127
|
+
// sessionId: sessionId, callType: callType, fromUid: fromUid, groupGuid: groupGuid,
|
|
128
|
+
// );
|
|
129
|
+
},
|
|
130
|
+
),
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
void unregisterGroupMeetingListener() {
|
|
135
|
+
CometChat.removeMessageListener(groupMeetingListenerId);
|
|
136
|
+
}
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
Wire register in `initState` / GetX controller `onInit`, unregister in `dispose` / `onClose`. Register AFTER `CometChatUIKit.login()` succeeds.
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
## Edge cases
|
|
144
|
+
|
|
145
|
+
### Late joining
|
|
146
|
+
|
|
147
|
+
Meeting persists in chat. Tap any time to join the live session.
|
|
148
|
+
|
|
149
|
+
### Push notifications (FCM Android, APNs / VoIP iOS)
|
|
150
|
+
|
|
151
|
+
Meeting `CustomMessage.metadata.pushNotification = "meeting"` — delivered as regular FCM/APNs notification. To get CallKit (iOS) or ConnectionService (Android) ringing for meetings, intercept the push payload and route to `flutter_callkit_incoming` manually. Not auto-wired.
|
|
152
|
+
|
|
153
|
+
### `navigatorKey` requirement (V5 too)
|
|
154
|
+
|
|
155
|
+
If you use the kit's outgoing-call screen for groups, ensure `MaterialApp` has `navigatorKey: CallNavigationContext.navigatorKey` — same requirement as 1:1 (rule 1.7 in SKILL.md).
|
|
156
|
+
|
|
157
|
+
---
|
|
158
|
+
|
|
159
|
+
## Anti-patterns
|
|
160
|
+
|
|
161
|
+
1. **Only `CometChat.addCallListener` registered, expecting group calls to ring.** Add `addMessageListener` too.
|
|
162
|
+
2. **`CometChat.endCall(sessionId)` after a group hangup.** No call entity exists.
|
|
163
|
+
3. **Treating sessionId as ephemeral.** It IS the group's GUID.
|
|
164
|
+
4. **Registering `MessageListener` before login.** Listeners registered pre-login are silently dropped. Wire AFTER `CometChatUIKit.login` completes.
|
|
165
|
+
5. **Skipping the `navigatorKey` for the meeting flow.** Same context-navigation requirement as 1:1.
|
|
166
|
+
|
|
167
|
+
---
|
|
168
|
+
|
|
169
|
+
## Verification checklist
|
|
170
|
+
|
|
171
|
+
- [ ] If using kit caller: `CometChatCallButtons(group: group)` tap initiates meeting message
|
|
172
|
+
- [ ] If using custom caller: `CometChat.sendCustomMessage` called with `type: 'meeting'`, `category: MessageCategoryConstants.custom`, `customData: {callType, sessionId}`, `metadata: { pushNotification: 'meeting' }`
|
|
173
|
+
- [ ] If using kit receiver: `CometChatMessageList(group: group)` renders meeting card
|
|
174
|
+
- [ ] If using custom receiver: `CometChat.addMessageListener` registered with category+type filter, AFTER login
|
|
175
|
+
- [ ] `MaterialApp.navigatorKey = CallNavigationContext.navigatorKey` set (kit-driven UI path)
|
|
176
|
+
- [ ] On hangup: `CometChatUIKitCalls.endSession()` only (no `CometChat.endCall`)
|
|
177
|
+
- [ ] Late-joining tested
|
|
178
|
+
- [ ] Push notifications fire for offline members
|
|
179
|
+
|
|
180
|
+
---
|
|
181
|
+
|
|
182
|
+
## Pointers
|
|
183
|
+
|
|
184
|
+
- `ringing-integration.md` — 1:1 user calls (different signaling channel)
|
|
185
|
+
- `cometchat-flutter-v5-calls/SKILL.md` — V5 hard rules (cometchat_calls_uikit peer, Jetifier, etc.)
|
|
186
|
+
- Canonical docs: https://www.cometchat.com/docs/calls/flutter/group-calls
|
|
187
|
+
- Cross-platform reference (semantic ground-truth): `cometchat-react-calls/references/group-calls.md`
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# Idle timeout on Flutter V5 (GetX-based)
|
|
2
|
+
|
|
3
|
+
Same SDK API. Flutter-specific: `CallSettingsBuilder` setter API + `showDialog` / overlay for the prompt.
|
|
4
|
+
|
|
5
|
+
**Canonical docs:** https://www.cometchat.com/docs/calls/flutter/idle-timeout
|
|
6
|
+
**Read first:** `cometchat-react-calls/references/idle-timeout.md` — settings + archetype timeouts.
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## SDK API
|
|
11
|
+
|
|
12
|
+
```dart
|
|
13
|
+
import 'package:cometchat_calls_uikit/cometchat_calls_uikit.dart';
|
|
14
|
+
|
|
15
|
+
final settings = CallSettingsBuilder()
|
|
16
|
+
..setIdleTimeoutPeriodBeforePrompt = 60000
|
|
17
|
+
..setIdleTimeoutPeriodAfterPrompt = 120000;
|
|
18
|
+
final builtSettings = settings.build();
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Listener — implement on the GetX controller (cf. `references/raise-hand.md`):
|
|
22
|
+
|
|
23
|
+
```dart
|
|
24
|
+
class CallController extends GetxController implements CometChatCallsEventsListener {
|
|
25
|
+
@override
|
|
26
|
+
void onSessionTimedOut() {
|
|
27
|
+
Get.snackbar('Call ended', 'You were inactive for too long');
|
|
28
|
+
Get.until((route) => route.isFirst); // pop to home
|
|
29
|
+
}
|
|
30
|
+
// ... other handlers
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## Custom prompt — showDialog
|
|
37
|
+
|
|
38
|
+
```dart
|
|
39
|
+
Future<void> showIdleTimeoutPrompt(BuildContext context) async {
|
|
40
|
+
final result = await showDialog<String>(
|
|
41
|
+
context: context,
|
|
42
|
+
barrierDismissible: false, // prevent tap-outside dismiss
|
|
43
|
+
builder: (ctx) => AlertDialog(
|
|
44
|
+
title: const Text('Still there?'),
|
|
45
|
+
content: const Text("You're alone in this call. It'll end in 60 seconds."),
|
|
46
|
+
actions: [
|
|
47
|
+
TextButton(
|
|
48
|
+
onPressed: () => Navigator.pop(ctx, 'end'),
|
|
49
|
+
child: const Text('End now', style: TextStyle(color: Colors.red)),
|
|
50
|
+
),
|
|
51
|
+
FilledButton(
|
|
52
|
+
onPressed: () => Navigator.pop(ctx, 'stay'),
|
|
53
|
+
child: const Text('Stay'),
|
|
54
|
+
),
|
|
55
|
+
],
|
|
56
|
+
),
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
if (result == 'end') {
|
|
60
|
+
// CometChatCalls.endSession() does NOT exist on Flutter — use the CallSession instance.
|
|
61
|
+
await CallSession.getInstance().leaveSession();
|
|
62
|
+
} else {
|
|
63
|
+
// 'stay' or null — reset custom timer
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
`barrierDismissible: false` prevents accidental dismiss; user must explicitly pick.
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## Anti-patterns
|
|
73
|
+
|
|
74
|
+
Web sister rules apply, plus Flutter-specific:
|
|
75
|
+
|
|
76
|
+
1. **`Get.dialog` from inside a non-context method** without a captured BuildContext. Dialog opens but has no theme/context — looks broken.
|
|
77
|
+
2. **`Navigator.pop` with no result.** Subsequent code can't differentiate stay vs end. Always pass result.
|
|
78
|
+
3. **Showing prompt while ongoing-call view is being disposed.** Race condition. Check `mounted` before showing.
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## Verification checklist
|
|
83
|
+
|
|
84
|
+
- [ ] CallSettingsBuilder sets both idle periods
|
|
85
|
+
- [ ] `onSessionTimedOut` snackbar + nav cleanup
|
|
86
|
+
- [ ] Dialog `barrierDismissible: false`
|
|
87
|
+
- [ ] `mounted` check before showing prompt
|
|
88
|
+
- [ ] Real-device smoke: 2 devices, hangup one → prompt fires + nav home after timeout
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## Pointers
|
|
93
|
+
|
|
94
|
+
- `cometchat-react-calls/references/idle-timeout.md` — sister reference
|
|
95
|
+
- `cometchat-flutter-v5-calls` SKILL.md
|
|
96
|
+
- `cometchat-flutter-v5-calls/references/raise-hand.md` — sibling V5 GetX pattern
|
|
97
|
+
- Canonical docs: https://www.cometchat.com/docs/calls/flutter/idle-timeout
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
# In-call chat on Flutter V5 (GetX)
|
|
2
|
+
|
|
3
|
+
Same SDK shape. Flutter-specific: `showModalBottomSheet` with `isScrollControlled: true` for the panel + `MediaQuery.viewInsets` for keyboard handling.
|
|
4
|
+
|
|
5
|
+
**Canonical docs:** https://www.cometchat.com/docs/calls/flutter/in-call-chat
|
|
6
|
+
**Read first:** `cometchat-react-calls/references/in-call-chat.md` — group-as-session architecture.
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## SDK API
|
|
11
|
+
|
|
12
|
+
```dart
|
|
13
|
+
import 'package:cometchat_calls_uikit/cometchat_calls_uikit.dart';
|
|
14
|
+
import 'package:cometchat_chat_uikit/cometchat_chat_uikit.dart';
|
|
15
|
+
|
|
16
|
+
// Wire chat button visibility via the call settings builder
|
|
17
|
+
final settings = CallSettingsBuilder()
|
|
18
|
+
..hideChatButton = false;
|
|
19
|
+
|
|
20
|
+
// In your CometChatCallsEventsListener:
|
|
21
|
+
@override
|
|
22
|
+
void onChatButtonClicked() {
|
|
23
|
+
Get.find<CallController>().openChat();
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
CometChatCalls.setChatButtonUnreadCount(5);
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Group-as-session helper
|
|
32
|
+
|
|
33
|
+
```dart
|
|
34
|
+
Future<Group> ensureCallGroup(String sessionId) async {
|
|
35
|
+
try {
|
|
36
|
+
return await CometChatGroups.getGroup(sessionId);
|
|
37
|
+
} catch (_) {
|
|
38
|
+
final group = Group(
|
|
39
|
+
guid: sessionId,
|
|
40
|
+
name: 'Call $sessionId',
|
|
41
|
+
type: GroupTypeConstants.public,
|
|
42
|
+
);
|
|
43
|
+
return await CometChatGroups.createGroup(group);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## Modal bottom sheet panel
|
|
51
|
+
|
|
52
|
+
```dart
|
|
53
|
+
class CallController extends GetxController {
|
|
54
|
+
final unread = 0.obs;
|
|
55
|
+
Group? group;
|
|
56
|
+
|
|
57
|
+
Future<void> initChat(String sessionId) async {
|
|
58
|
+
group = await ensureCallGroup(sessionId);
|
|
59
|
+
// Track unread...
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
void openChat() {
|
|
63
|
+
if (group == null) return;
|
|
64
|
+
Get.bottomSheet(
|
|
65
|
+
InCallChatPanel(group: group!),
|
|
66
|
+
isScrollControlled: true, // allow full-height
|
|
67
|
+
barrierColor: Colors.transparent, // call view stays visible
|
|
68
|
+
enableDrag: true,
|
|
69
|
+
);
|
|
70
|
+
unread.value = 0;
|
|
71
|
+
CometChatCalls.setChatButtonUnreadCount(0);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
class InCallChatPanel extends StatelessWidget {
|
|
76
|
+
final Group group;
|
|
77
|
+
const InCallChatPanel({super.key, required this.group});
|
|
78
|
+
|
|
79
|
+
@override
|
|
80
|
+
Widget build(BuildContext context) {
|
|
81
|
+
final keyboardHeight = MediaQuery.of(context).viewInsets.bottom;
|
|
82
|
+
return Padding(
|
|
83
|
+
padding: EdgeInsets.only(bottom: keyboardHeight),
|
|
84
|
+
child: Container(
|
|
85
|
+
height: MediaQuery.of(context).size.height * 0.7,
|
|
86
|
+
decoration: const BoxDecoration(
|
|
87
|
+
color: Colors.white,
|
|
88
|
+
borderRadius: BorderRadius.vertical(top: Radius.circular(16)),
|
|
89
|
+
),
|
|
90
|
+
child: Column(
|
|
91
|
+
children: [
|
|
92
|
+
const ListTile(title: Text('Chat')),
|
|
93
|
+
Expanded(child: CometChatMessageList(group: group)),
|
|
94
|
+
CometChatMessageComposer(group: group),
|
|
95
|
+
],
|
|
96
|
+
),
|
|
97
|
+
),
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
`MediaQuery.viewInsets.bottom` accounts for keyboard height; the sheet pushes up correctly when typing.
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
## Anti-patterns
|
|
108
|
+
|
|
109
|
+
Web sister rules apply, plus Flutter-specific:
|
|
110
|
+
|
|
111
|
+
1. **`Get.bottomSheet` without `isScrollControlled: true`.** Sheet capped at half-screen, can't expand for full chat.
|
|
112
|
+
2. **`barrierColor: Colors.black54`.** Default dim; call view obscured. Use `Colors.transparent` for in-call.
|
|
113
|
+
3. **`Expanded` direct children of `Column` without considering composer height.** Padding via `MediaQuery.viewInsets` handles it cleanly.
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## Verification checklist
|
|
118
|
+
|
|
119
|
+
- [ ] `hideChatButton = false` in CallSettings
|
|
120
|
+
- [ ] `onChatButtonClicked` opens bottom sheet
|
|
121
|
+
- [ ] `Get.bottomSheet` uses `isScrollControlled: true` + transparent barrier
|
|
122
|
+
- [ ] `MediaQuery.viewInsets.bottom` padding for keyboard
|
|
123
|
+
- [ ] Group resolved before opening sheet
|
|
124
|
+
- [ ] Real-device smoke: keyboard opens during chat, sheet adjusts
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
## Pointers
|
|
129
|
+
|
|
130
|
+
- `cometchat-react-calls/references/in-call-chat.md` — sister
|
|
131
|
+
- `cometchat-flutter-v5-calls` SKILL.md
|
|
132
|
+
- Canonical docs: https://www.cometchat.com/docs/calls/flutter/in-call-chat
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
# CometChat Calls Flutter SDK v4 → v5 migration
|
|
2
|
+
|
|
3
|
+
`cometchat_calls_uikit: ^5.0.15` is the v5 calls package for Flutter — drop-in replacement for the v4 calls SDK.
|
|
4
|
+
|
|
5
|
+
**Important:** This migrates the **Calls SDK** (v4 → v5), not the UI Kit cohort (V5 GetX → V6 Bloc, which is `cometchat-flutter-v6-migration`). You can be on UI Kit V5 + Calls SDK v5 — they version independently.
|
|
6
|
+
|
|
7
|
+
**Canonical docs:** https://www.cometchat.com/docs/calls/flutter/migration-guide-v5
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Step 1 — Bump pubspec
|
|
12
|
+
|
|
13
|
+
```yaml
|
|
14
|
+
# pubspec.yaml
|
|
15
|
+
dependencies:
|
|
16
|
+
cometchat_calls_uikit: ^5.0.15
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
flutter pub get
|
|
21
|
+
cd ios && pod install # if you have iOS
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Step 2 — Migrate init
|
|
27
|
+
|
|
28
|
+
```diff
|
|
29
|
+
- final callSettings = CallAppSettingsBuilder()
|
|
30
|
+
- ..setAppId('APP_ID')
|
|
31
|
+
- ..setRegion('REGION');
|
|
32
|
+
- await CometChatCalls.init(callSettings);
|
|
33
|
+
|
|
34
|
+
+ final settings = CallAppSettings(appId: 'APP_ID', region: 'REGION');
|
|
35
|
+
+ await CometChatCalls.init(settings);
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## Step 3 — Add Calls SDK login
|
|
41
|
+
|
|
42
|
+
```dart
|
|
43
|
+
// After CometChat.login completes
|
|
44
|
+
final user = (await CometChatUIKit.getLoggedInUser())!;
|
|
45
|
+
final authToken = user.authToken;
|
|
46
|
+
await CometChatCalls.login(authToken: authToken);
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## Step 4 — Migrate session settings
|
|
52
|
+
|
|
53
|
+
```diff
|
|
54
|
+
- final callSettings = CallSettingsBuilder()
|
|
55
|
+
- ..setSessionType(SessionType.video)
|
|
56
|
+
- ..startWithAudioMuted(false)
|
|
57
|
+
- ..showRecordingButton(true);
|
|
58
|
+
|
|
59
|
+
+ final sessionSettings = SessionSettings(
|
|
60
|
+
+ sessionType: SessionType.video,
|
|
61
|
+
+ startAudioMuted: false,
|
|
62
|
+
+ hideRecordingButton: false, // INVERTED
|
|
63
|
+
+ layout: CallLayout.tile,
|
|
64
|
+
+ );
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## Step 5 — Migrate listener to event subscriptions
|
|
70
|
+
|
|
71
|
+
```diff
|
|
72
|
+
- class MyEvents implements CometChatCallsEventsListener {
|
|
73
|
+
- @override
|
|
74
|
+
- void onCallEnded() { /* ... */ }
|
|
75
|
+
- @override
|
|
76
|
+
- void onUserJoined(User user) { /* ... */ }
|
|
77
|
+
- // ...
|
|
78
|
+
- }
|
|
79
|
+
- CometChatCalls.addCallsEventsListener('id', MyEvents());
|
|
80
|
+
|
|
81
|
+
+ final unsub1 = CometChatCalls.addEventListener(CallEvent.sessionLeft, () { /* ... */ });
|
|
82
|
+
+ final unsub2 = CometChatCalls.addEventListener(CallEvent.participantJoined, (participant) { /* ... */ });
|
|
83
|
+
+ final unsub3 = CometChatCalls.addEventListener(CallEvent.participantLeft, (participant) { /* ... */ });
|
|
84
|
+
+
|
|
85
|
+
+ @override
|
|
86
|
+
+ void dispose() {
|
|
87
|
+
+ unsub1.call();
|
|
88
|
+
+ unsub2.call();
|
|
89
|
+
+ unsub3.call();
|
|
90
|
+
+ super.dispose();
|
|
91
|
+
+ }
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## Step 6 — Method renames + receiver shift
|
|
97
|
+
|
|
98
|
+
v5 moved most call-control APIs from static methods on `CometChatCalls` to **instance methods on `CallSession`** (the singleton fetched via `CallSession.getInstance()`). The static `endSession()` is preserved as a deprecated shim — the others were removed.
|
|
99
|
+
|
|
100
|
+
```diff
|
|
101
|
+
// session lifecycle — receiver changes from CometChatCalls (static) to CallSession (singleton)
|
|
102
|
+
- CometChatCalls.endSession()
|
|
103
|
+
+ await CallSession.getInstance()?.leaveSession()
|
|
104
|
+
|
|
105
|
+
// media controls — same receiver shift
|
|
106
|
+
- CometChatCalls.muteAudio(true)
|
|
107
|
+
+ CallSession.getInstance()?.muteAudio()
|
|
108
|
+
- CometChatCalls.muteAudio(false)
|
|
109
|
+
+ CallSession.getInstance()?.unmuteAudio()
|
|
110
|
+
|
|
111
|
+
- CometChatCalls.startScreenShare()
|
|
112
|
+
+ CallSession.getInstance()?.startScreenShare()
|
|
113
|
+
|
|
114
|
+
// layout stays static
|
|
115
|
+
- CometChatCalls.setMode(mode)
|
|
116
|
+
+ CometChatCalls.setLayout(layout)
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
**`CallSession.getInstance()` returns `CallSession?` (nullable)** — null when there's no active session. Use `?.` to safely chain; calling on null is a no-op.
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
## Step 7 — GetX state preservation
|
|
124
|
+
|
|
125
|
+
If you're using GetX controllers around the calls (per `cometchat-flutter-v5-calls/SKILL.md`), the state shape doesn't change — only the underlying SDK calls. Sample diff in a GetX controller:
|
|
126
|
+
|
|
127
|
+
```diff
|
|
128
|
+
class CallController extends GetxController {
|
|
129
|
+
void startCall(String sessionId) async {
|
|
130
|
+
- await CometChatCalls.startSession(sessionId, settings: callSettings);
|
|
131
|
+
+ await CometChatCalls.joinSession(sessionId, settings: sessionSettings);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
void endCall() async {
|
|
135
|
+
- CometChatCalls.endSession();
|
|
136
|
+
+ await CallSession.getInstance()?.leaveSession();
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
## Verification checklist
|
|
144
|
+
|
|
145
|
+
- [ ] `pubspec.yaml` lists `cometchat_calls_uikit: ^5.0.15` (or higher)
|
|
146
|
+
- [ ] `flutter pub get` + `pod install` succeed
|
|
147
|
+
- [ ] `CometChatCalls.login(authToken:)` called after `CometChat.login`
|
|
148
|
+
- [ ] CallSettingsBuilder replaced with `SessionSettings`
|
|
149
|
+
- [ ] CometChatCallsEventsListener replaced with `addEventListener`
|
|
150
|
+
- [ ] Method renames applied
|
|
151
|
+
- [ ] GetX controllers updated to v5 method names
|
|
152
|
+
- [ ] Real-device smoke: iOS + Android, incoming/outgoing/mute/screenshare
|
|
153
|
+
|
|
154
|
+
---
|
|
155
|
+
|
|
156
|
+
## Pointers
|
|
157
|
+
|
|
158
|
+
- Canonical migration: https://www.cometchat.com/docs/calls/flutter/migration-guide-v5
|
|
159
|
+
- `cometchat-flutter-v5-calls/SKILL.md` — Flutter calls architecture (GetX patterns)
|
|
160
|
+
- `cometchat-flutter-v6-calls/` — V6 cohort (Bloc); V6 starts on Calls SDK v5 — no migration needed
|