@cometchat/skills 4.2.1 → 4.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +33 -12
- package/bin/install.js +59 -4
- package/package.json +14 -1
- package/skills/cometchat/SKILL.md +460 -77
- package/skills/cometchat/references/asking-questions.md +48 -0
- package/skills/cometchat-a11y/SKILL.md +3 -2
- package/skills/cometchat-android-v5/SKILL.md +2 -1
- package/skills/cometchat-android-v5-calls/SKILL.md +36 -22
- package/skills/cometchat-android-v5-calls/references/README.md +1 -1
- package/skills/cometchat-android-v5-calls/references/add-calls-to-existing-chat.md +7 -5
- package/skills/cometchat-android-v5-calls/references/audio-controls.md +4 -4
- package/skills/cometchat-android-v5-calls/references/call-layouts.md +33 -25
- package/skills/cometchat-android-v5-calls/references/call-session.md +2 -2
- package/skills/cometchat-android-v5-calls/references/custom-ui.md +5 -5
- package/skills/cometchat-android-v5-calls/references/event-listeners.md +2 -2
- package/skills/cometchat-android-v5-calls/references/idle-timeout.md +20 -14
- package/skills/cometchat-android-v5-calls/references/in-call-chat.md +1 -1
- package/skills/cometchat-android-v5-calls/references/migration-v4-to-v5.md +43 -27
- package/skills/cometchat-android-v5-calls/references/participant-management.md +3 -3
- package/skills/cometchat-android-v5-calls/references/raise-hand.md +25 -19
- package/skills/cometchat-android-v5-calls/references/recording.md +2 -2
- package/skills/cometchat-android-v5-calls/references/ringing-integration.md +1 -1
- package/skills/cometchat-android-v5-calls/references/screen-sharing.md +5 -9
- package/skills/cometchat-android-v5-calls/references/session-settings.md +3 -3
- package/skills/cometchat-android-v5-calls/references/setup.md +1 -1
- package/skills/cometchat-android-v5-calls/references/share-invite.md +9 -4
- package/skills/cometchat-android-v5-calls/references/video-controls.md +4 -4
- package/skills/cometchat-android-v5-calls/references/voip-calling.md +2 -2
- package/skills/cometchat-android-v5-components/SKILL.md +4 -3
- package/skills/cometchat-android-v5-core/SKILL.md +20 -2
- package/skills/cometchat-android-v5-customization/SKILL.md +171 -7
- package/skills/cometchat-android-v5-extensions/SKILL.md +7 -4
- package/skills/cometchat-android-v5-features/SKILL.md +5 -4
- package/skills/cometchat-android-v5-placement/SKILL.md +2 -1
- package/skills/cometchat-android-v5-production/SKILL.md +2 -1
- package/skills/cometchat-android-v5-push/SKILL.md +2 -3
- package/skills/cometchat-android-v5-testing/SKILL.md +2 -1
- package/skills/cometchat-android-v5-theming/SKILL.md +2 -1
- package/skills/cometchat-android-v5-troubleshooting/SKILL.md +3 -2
- package/skills/cometchat-android-v6/SKILL.md +2 -1
- package/skills/cometchat-android-v6-builder-settings/SKILL.md +11 -7
- package/skills/cometchat-android-v6-calls/SKILL.md +79 -18
- package/skills/cometchat-android-v6-calls/references/advanced-features.md +87 -0
- package/skills/cometchat-android-v6-calls/references/call-layouts.md +24 -15
- package/skills/cometchat-android-v6-calls/references/call-session.md +2 -2
- package/skills/cometchat-android-v6-calls/references/device-management.md +17 -16
- package/skills/cometchat-android-v6-calls/references/idle-timeout.md +7 -4
- package/skills/cometchat-android-v6-calls/references/in-call-chat.md +13 -8
- package/skills/cometchat-android-v6-calls/references/raise-hand.md +6 -4
- package/skills/cometchat-android-v6-compose-components/SKILL.md +52 -29
- package/skills/cometchat-android-v6-compose-customization/SKILL.md +156 -1
- package/skills/cometchat-android-v6-compose-placement/SKILL.md +129 -40
- package/skills/cometchat-android-v6-compose-theming/SKILL.md +27 -1
- package/skills/cometchat-android-v6-core/SKILL.md +389 -9
- package/skills/cometchat-android-v6-events/SKILL.md +4 -1
- package/skills/cometchat-android-v6-extensions/SKILL.md +2 -1
- package/skills/cometchat-android-v6-features/SKILL.md +26 -2
- package/skills/cometchat-android-v6-kotlin-components/SKILL.md +31 -1
- package/skills/cometchat-android-v6-kotlin-customization/SKILL.md +172 -1
- package/skills/cometchat-android-v6-kotlin-placement/SKILL.md +20 -5
- package/skills/cometchat-android-v6-kotlin-theming/SKILL.md +36 -5
- package/skills/cometchat-android-v6-migration/SKILL.md +44 -42
- package/skills/cometchat-android-v6-production/SKILL.md +6 -3
- package/skills/cometchat-android-v6-push/SKILL.md +43 -2
- package/skills/cometchat-android-v6-testing/SKILL.md +11 -8
- package/skills/cometchat-android-v6-troubleshooting/SKILL.md +26 -5
- package/skills/cometchat-angular-calls/SKILL.md +256 -389
- package/skills/cometchat-angular-calls/references/add-calls-to-existing-chat.md +3 -2
- package/skills/cometchat-angular-calls/references/call-layouts.md +29 -12
- package/skills/cometchat-angular-calls/references/call-session.md +2 -2
- package/skills/cometchat-angular-calls/references/custom-ui.md +18 -10
- package/skills/cometchat-angular-calls/references/device-management.md +53 -34
- package/skills/cometchat-angular-calls/references/group-calls.md +45 -24
- package/skills/cometchat-angular-calls/references/idle-timeout.md +31 -15
- package/skills/cometchat-angular-calls/references/ngzone-and-async-callbacks.md +7 -6
- package/skills/cometchat-angular-calls/references/raise-hand.md +9 -4
- package/skills/cometchat-angular-calls/references/recording-screen-share.md +32 -39
- package/skills/cometchat-angular-calls/references/ringing-integration.md +3 -1
- package/skills/cometchat-angular-calls/references/share-invite.md +11 -5
- package/skills/cometchat-angular-calls/references/virtual-background.md +29 -0
- package/skills/cometchat-angular-components/SKILL.md +149 -620
- package/skills/cometchat-angular-core/SKILL.md +235 -293
- package/skills/cometchat-angular-customization/SKILL.md +415 -223
- package/skills/cometchat-angular-features/SKILL.md +216 -334
- package/skills/cometchat-angular-patterns/SKILL.md +168 -359
- package/skills/cometchat-angular-placement/SKILL.md +189 -560
- package/skills/cometchat-angular-production/SKILL.md +241 -92
- package/skills/cometchat-angular-push/SKILL.md +280 -294
- package/skills/cometchat-angular-testing/SKILL.md +430 -158
- package/skills/cometchat-angular-theming/SKILL.md +190 -265
- package/skills/cometchat-angular-troubleshooting/SKILL.md +192 -157
- package/skills/cometchat-astro-patterns/SKILL.md +22 -1
- package/skills/cometchat-calls/SKILL.md +25 -19
- package/skills/cometchat-calls/references/use-case-broadcast.md +15 -10
- package/skills/cometchat-calls/references/use-case-marketplace.md +2 -3
- package/skills/cometchat-calls/references/use-case-support.md +3 -4
- package/skills/cometchat-calls/references/use-case-team.md +23 -12
- package/skills/cometchat-calls/references/use-case-telehealth.md +3 -4
- package/skills/cometchat-components/SKILL.md +163 -25
- package/skills/cometchat-core/SKILL.md +412 -13
- package/skills/cometchat-customization/SKILL.md +50 -25
- package/skills/cometchat-features/SKILL.md +313 -34
- package/skills/cometchat-flutter-v5/SKILL.md +10 -4
- package/skills/cometchat-flutter-v5-calls/SKILL.md +188 -158
- package/skills/cometchat-flutter-v5-calls/references/add-calls-to-existing-chat.md +48 -24
- package/skills/cometchat-flutter-v5-calls/references/call-layouts.md +20 -15
- package/skills/cometchat-flutter-v5-calls/references/call-session.md +100 -145
- package/skills/cometchat-flutter-v5-calls/references/device-management.md +12 -8
- package/skills/cometchat-flutter-v5-calls/references/group-calls.md +30 -36
- package/skills/cometchat-flutter-v5-calls/references/idle-timeout.md +15 -13
- package/skills/cometchat-flutter-v5-calls/references/in-call-chat.md +12 -9
- package/skills/cometchat-flutter-v5-calls/references/migration-v4-to-v5.md +115 -65
- package/skills/cometchat-flutter-v5-calls/references/raise-hand.md +41 -30
- package/skills/cometchat-flutter-v5-calls/references/ringing-integration.md +17 -14
- package/skills/cometchat-flutter-v5-calls/references/share-invite.md +8 -2
- package/skills/cometchat-flutter-v5-conversations/SKILL.md +2 -1
- package/skills/cometchat-flutter-v5-core/SKILL.md +20 -2
- package/skills/cometchat-flutter-v5-customization/SKILL.md +136 -5
- package/skills/cometchat-flutter-v5-events/SKILL.md +2 -1
- package/skills/cometchat-flutter-v5-messages/SKILL.md +2 -1
- package/skills/cometchat-flutter-v5-production/SKILL.md +15 -6
- package/skills/cometchat-flutter-v5-push/SKILL.md +2 -1
- package/skills/cometchat-flutter-v5-testing/SKILL.md +17 -6
- package/skills/cometchat-flutter-v5-theming/SKILL.md +2 -1
- package/skills/cometchat-flutter-v5-troubleshooting/SKILL.md +7 -6
- package/skills/cometchat-flutter-v5-users-groups/SKILL.md +3 -2
- package/skills/cometchat-flutter-v6/SKILL.md +17 -16
- package/skills/cometchat-flutter-v6-calls/SKILL.md +78 -63
- package/skills/cometchat-flutter-v6-calls/references/add-calls-to-existing-chat.md +8 -6
- package/skills/cometchat-flutter-v6-calls/references/advanced-features.md +89 -0
- package/skills/cometchat-flutter-v6-calls/references/call-layouts.md +15 -12
- package/skills/cometchat-flutter-v6-calls/references/call-session.md +2 -2
- package/skills/cometchat-flutter-v6-calls/references/device-management.md +9 -3
- package/skills/cometchat-flutter-v6-calls/references/group-calls.md +10 -10
- package/skills/cometchat-flutter-v6-calls/references/idle-timeout.md +15 -7
- package/skills/cometchat-flutter-v6-calls/references/in-call-chat.md +6 -3
- package/skills/cometchat-flutter-v6-calls/references/raise-hand.md +23 -16
- package/skills/cometchat-flutter-v6-components/SKILL.md +32 -11
- package/skills/cometchat-flutter-v6-conversations/SKILL.md +39 -11
- package/skills/cometchat-flutter-v6-core/SKILL.md +348 -10
- package/skills/cometchat-flutter-v6-customization/SKILL.md +97 -25
- package/skills/cometchat-flutter-v6-events/SKILL.md +3 -2
- package/skills/cometchat-flutter-v6-features/SKILL.md +15 -6
- package/skills/cometchat-flutter-v6-messages/SKILL.md +111 -60
- package/skills/cometchat-flutter-v6-migration/SKILL.md +18 -25
- package/skills/cometchat-flutter-v6-placement/SKILL.md +79 -50
- package/skills/cometchat-flutter-v6-production/SKILL.md +13 -12
- package/skills/cometchat-flutter-v6-push/SKILL.md +43 -21
- package/skills/cometchat-flutter-v6-testing/SKILL.md +6 -6
- package/skills/cometchat-flutter-v6-theming/SKILL.md +38 -5
- package/skills/cometchat-flutter-v6-troubleshooting/SKILL.md +182 -17
- package/skills/cometchat-flutter-v6-users-groups/SKILL.md +12 -4
- package/skills/cometchat-i18n/SKILL.md +139 -78
- package/skills/cometchat-ios/SKILL.md +4 -2
- package/skills/cometchat-ios-calls/SKILL.md +225 -95
- package/skills/cometchat-ios-calls/references/add-calls-to-existing-chat.md +11 -9
- package/skills/cometchat-ios-calls/references/audio-modes-and-controls.md +45 -0
- package/skills/cometchat-ios-calls/references/avaudiosession-routing.md +6 -7
- package/skills/cometchat-ios-calls/references/call-layouts.md +31 -91
- package/skills/cometchat-ios-calls/references/call-session.md +51 -54
- package/skills/cometchat-ios-calls/references/callkit-and-pushkit.md +33 -29
- package/skills/cometchat-ios-calls/references/custom-ui.md +38 -38
- package/skills/cometchat-ios-calls/references/group-calls.md +33 -70
- package/skills/cometchat-ios-calls/references/idle-timeout.md +24 -25
- package/skills/cometchat-ios-calls/references/in-call-chat.md +19 -23
- package/skills/cometchat-ios-calls/references/migration-v4-to-v5.md +128 -70
- package/skills/cometchat-ios-calls/references/picture-in-picture.md +20 -20
- package/skills/cometchat-ios-calls/references/raise-hand.md +14 -227
- package/skills/cometchat-ios-calls/references/recording-screen-share.md +35 -122
- package/skills/cometchat-ios-calls/references/ringing-integration.md +17 -16
- package/skills/cometchat-ios-calls/references/share-invite.md +8 -12
- package/skills/cometchat-ios-calls/references/swiftui-uikit-hosting.md +4 -4
- package/skills/cometchat-ios-components/SKILL.md +200 -12
- package/skills/cometchat-ios-core/SKILL.md +281 -11
- package/skills/cometchat-ios-customization/SKILL.md +276 -110
- package/skills/cometchat-ios-features/SKILL.md +64 -36
- package/skills/cometchat-ios-placement/SKILL.md +15 -12
- package/skills/cometchat-ios-production/SKILL.md +12 -4
- package/skills/cometchat-ios-push/SKILL.md +53 -19
- package/skills/cometchat-ios-testing/SKILL.md +14 -9
- package/skills/cometchat-ios-theming/SKILL.md +39 -3
- package/skills/cometchat-ios-troubleshooting/SKILL.md +41 -21
- package/skills/cometchat-native-bare-patterns/SKILL.md +56 -18
- package/skills/cometchat-native-calls/SKILL.md +89 -19
- package/skills/cometchat-native-calls/references/add-calls-to-existing-chat.md +2 -2
- package/skills/cometchat-native-calls/references/call-layouts.md +15 -14
- package/skills/cometchat-native-calls/references/call-session.md +2 -2
- package/skills/cometchat-native-calls/references/custom-ui.md +12 -8
- package/skills/cometchat-native-calls/references/device-management.md +53 -30
- package/skills/cometchat-native-calls/references/group-calls.md +35 -30
- package/skills/cometchat-native-calls/references/idle-timeout.md +6 -6
- package/skills/cometchat-native-calls/references/in-call-chat.md +10 -8
- package/skills/cometchat-native-calls/references/migration-v4-to-v5.md +2 -2
- package/skills/cometchat-native-calls/references/raise-hand.md +15 -13
- package/skills/cometchat-native-calls/references/recording-screen-share.md +49 -170
- package/skills/cometchat-native-calls/references/share-invite.md +7 -5
- package/skills/cometchat-native-calls/references/voip-push-end-to-end.md +4 -2
- package/skills/cometchat-native-components/SKILL.md +91 -57
- package/skills/cometchat-native-core/SKILL.md +281 -9
- package/skills/cometchat-native-customization/SKILL.md +150 -28
- package/skills/cometchat-native-expo-patterns/SKILL.md +77 -27
- package/skills/cometchat-native-features/SKILL.md +79 -49
- package/skills/cometchat-native-placement/SKILL.md +19 -10
- package/skills/cometchat-native-production/SKILL.md +9 -3
- package/skills/cometchat-native-push/SKILL.md +2 -1
- package/skills/cometchat-native-testing/SKILL.md +1 -2
- package/skills/cometchat-native-theming/SKILL.md +54 -29
- package/skills/cometchat-native-troubleshooting/SKILL.md +71 -3
- package/skills/cometchat-nextjs-patterns/SKILL.md +48 -6
- package/skills/cometchat-placement/SKILL.md +42 -3
- package/skills/cometchat-production/SKILL.md +12 -5
- package/skills/cometchat-react-calls/SKILL.md +220 -10
- package/skills/cometchat-react-calls/references/add-calls-to-existing-chat.md +4 -3
- package/skills/cometchat-react-calls/references/call-layouts.md +5 -6
- package/skills/cometchat-react-calls/references/call-session.md +1 -1
- package/skills/cometchat-react-calls/references/custom-ui.md +61 -15
- package/skills/cometchat-react-calls/references/device-management.md +55 -51
- package/skills/cometchat-react-calls/references/group-calls.md +18 -23
- package/skills/cometchat-react-calls/references/idle-timeout.md +25 -12
- package/skills/cometchat-react-calls/references/in-call-chat.md +7 -7
- package/skills/cometchat-react-calls/references/migration-v4-to-v5.md +9 -11
- package/skills/cometchat-react-calls/references/raise-hand.md +14 -14
- package/skills/cometchat-react-calls/references/recording-screen-share.md +39 -38
- package/skills/cometchat-react-calls/references/ringing-integration.md +2 -2
- package/skills/cometchat-react-calls/references/share-invite.md +4 -5
- package/skills/cometchat-react-calls/references/testing-calls-on-web.md +20 -2
- package/skills/cometchat-react-calls/references/virtual-background.md +32 -0
- package/skills/cometchat-react-patterns/SKILL.md +57 -4
- package/skills/cometchat-react-push/SKILL.md +258 -72
- package/skills/cometchat-react-router-patterns/SKILL.md +43 -4
- package/skills/cometchat-react-testing/SKILL.md +14 -5
- package/skills/cometchat-theming/SKILL.md +181 -18
- package/skills/cometchat-troubleshooting/SKILL.md +40 -20
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: cometchat-android-v6-calls
|
|
3
|
-
description: CometChat Calls v6 integration for native Android (V6
|
|
3
|
+
description: "CometChat Calls v6 integration for native Android (V6 stable, GA 2026-05-25 — Compose + Kotlin Views). Works end-to-end on chatuikit-compose-android:6.0.0 (validated 2026-05-12 against web peer) — but only with FIVE non-obvious workarounds the kit itself doesn't ship — (1) explicit calls-sdk-android:5.0.+ peer dep, (2) annotations-java5 exclude, (3) stub classes for legacy com.cometchat.calls.{CometChatRTCView, model.RTCUser, model.RTCReceiver, model.RTCCallback} to satisfy chat-sdk's CallManager bytecode, (4) AVOID CometChatCallButtons (broken — captures first-rendered user globally; ignores per-row prop) — instead wire your own button to CometChat.initiateCall then CometChatCallActivity.Companion.launchOutgoingCallScreen(context, call, null), (5) Call constructor arg order CHANGED in chat-sdk 5.x — (receiverUid, receiverType, type) not (receiverUid, type, receiverType). Covers UIKitSettings calling configuration, surface-aware Compose+Views routing, foreground service correctness on Android 14+, ConnectionService + FCM VoIP push."
|
|
4
4
|
license: "MIT"
|
|
5
5
|
compatibility: "Android Studio Hedgehog+, JDK 17, Gradle 8+, AGP 8+, minSdk 28+ (V6 raised the floor); chatuikit-compose-android:6.0.+ OR chatuikit-kotlin-android:6.0.+ PAIRED with com.cometchat:calls-sdk-android:5.0.+ (peer dep required despite the V6 marketing — see §1.0)"
|
|
6
|
-
allowed-tools: "shell, file-read, file-search, file-list, ask-user"
|
|
7
6
|
metadata:
|
|
8
7
|
author: "CometChat"
|
|
9
8
|
version: "4.0.0"
|
|
10
|
-
tags: "cometchat android v6 calls voice video webrtc compose kotlin-views uikitsettings calling-configuration foreground-service voip fcm connectionservice
|
|
9
|
+
tags: "cometchat android v6 calls voice video webrtc compose kotlin-views uikitsettings calling-configuration foreground-service voip fcm connectionservice ga"
|
|
11
10
|
---
|
|
12
11
|
|
|
12
|
+
> **Ground truth:** `com.cometchat:chatuikit-{compose,kotlin}-android:6.x` (+ `calls-sdk-android:5.x`) — resolved AAR (javap) + `ui-kit/android/v6`. **Official docs:** https://www.cometchat.com/docs/calls/android/overview · **Docs MCP:** `claude mcp add --transport http cometchat-docs https://www.cometchat.com/docs/mcp` (or fetch the URL directly without MCP). Verify symbols against the installed package/source before relying on them.
|
|
13
|
+
|
|
13
14
|
## ⚠️ Five required workarounds for chatuikit-compose-android:6.0.0
|
|
14
15
|
|
|
15
|
-
Validated end-to-end on Pixel 3 (Android 12) ↔ Next.js peer on 2026-05-12. **All five must be applied** — the V6
|
|
16
|
+
Validated end-to-end on Pixel 3 (Android 12) ↔ Next.js peer on 2026-05-12. **All five must be applied** — the V6 calls artifacts ship without them and the app crashes on first call attempt without one of them in place. (V6 is GA since 2026-05-25; GA software can still need these workarounds — they were validated against the 6.0.0 line and are not yet confirmed removed on later patches.)
|
|
16
17
|
|
|
17
18
|
### W1 — `calls-sdk-android:5.0.+` is a REQUIRED peer dep
|
|
18
19
|
|
|
@@ -109,7 +110,7 @@ Bytecode-confirmed against chat-sdk-android:5.0.1: `arg1 → receiverUid`, `arg2
|
|
|
109
110
|
|
|
110
111
|
## Purpose
|
|
111
112
|
|
|
112
|
-
Production-grade voice + video calling for native Android v6 (
|
|
113
|
+
Production-grade voice + video calling for native Android v6 (stable, GA 2026-05-25). Loaded by `cometchat-calls` when `android_version === "v6"`. Routes to the **Compose** or **Kotlin Views** sub-flow based on the surface the project uses (already determined by `cometchat-android-v6-core` from the presence of `androidx.compose.ui:ui` / `compose.material3` in the dependency graph).
|
|
113
114
|
|
|
114
115
|
**⚠️ Important — V6 still needs `calls-sdk-android` on the classpath despite marketing claims.** The V6 chatuikit packages advertise "bundled calling," but at runtime `CometChatUIKit.init` references `com.cometchat.calls.core.CometChatCalls$SessionSettingsBuilder` — a class that lives in `com.cometchat:calls-sdk-android`, NOT in the chatuikit AAR. Without the peer dep, the app crashes on `Application.onCreate` with `ClassNotFoundException`. Always add:
|
|
115
116
|
|
|
@@ -129,19 +130,76 @@ The `UIKitSettings` builder must still call `.setEnableCalling(true)` to registe
|
|
|
129
130
|
- `cometchat-android-v6-{compose,kotlin}-components` — surface-specific component catalogs
|
|
130
131
|
|
|
131
132
|
**Ground truth:**
|
|
132
|
-
- SDK source — installed `chatuikit-{compose,kotlin}-android@6.0
|
|
133
|
+
- SDK source — installed `chatuikit-{compose,kotlin}-android@6.0.+` (GA) artifacts under `~/.gradle/caches/`
|
|
133
134
|
- V5 sibling skill — `cometchat-android-v5-calls` (different module shape, same hard rules)
|
|
134
135
|
- Public docs — https://www.cometchat.com/docs/calls/android/overview (note: V6 docs may still reference V5 module split)
|
|
135
136
|
|
|
137
|
+
## When to use
|
|
138
|
+
|
|
139
|
+
- Android V6 project (`chatuikit-compose-android:6.x` OR `chatuikit-kotlin-android:6.x` detected by `cometchat-android-v6-core`)
|
|
140
|
+
- The integration needs voice / video calling (ringing OR session OR additive on top of chat)
|
|
141
|
+
- The project is on `minSdk = 28` or higher (V6 floor)
|
|
142
|
+
|
|
143
|
+
## When NOT to use
|
|
144
|
+
|
|
145
|
+
- **Standalone session-mode meeting-room flow (no ringing, no chat UI Kit)** — load `cometchat-android-v6-calls` §4a only; W1–W5 do NOT apply. The chatuikit AAR is never loaded in this path, so the broken-CometChatCallButtons bug + the classloader stub issue never trigger.
|
|
146
|
+
- **`minSdk < 28`** — V6 is unsupported. Route back to `cometchat-android-v5-calls` (V5 supports minSdk 21+).
|
|
147
|
+
- **V5 chatuikit already in project** (`chat-uikit-android:5.x`) — do NOT introduce V6 calls alongside V5 chat; use `cometchat-android-v5-calls`. The two namespaces collide on `com.cometchat.chat.core.Call` resolution.
|
|
148
|
+
- **Mixed Compose + Kotlin Views surface in the same Activity** — pick one surface before continuing. Importing both `com.cometchat.uikit.compose.*` and `com.cometchat.uikit.kotlin.*` in the same call screen will compile but ship inconsistent UX. Confirm via `cometchat-android-v6-core` Step 1 surface-detection output.
|
|
149
|
+
- **iOS** — load `cometchat-ios-calls`.
|
|
150
|
+
- **Cross-platform mobile** (Flutter / React Native) — load `cometchat-flutter-v6-calls` or `cometchat-native-calls`.
|
|
151
|
+
|
|
152
|
+
## Common Rationalizations — and why they're wrong (HIGH-RISK: W1–W5 contradict vendor marketing)
|
|
153
|
+
|
|
154
|
+
W1–W5 directly contradict the published V6 release notes and the most discoverable kit API (`CometChatCallButtons`). An agent reading newer-sounding vendor docs mid-task will silently drop a workaround. Pre-rebut every excuse the agent might invent.
|
|
155
|
+
|
|
156
|
+
| Excuse the agent might invent | Reality |
|
|
157
|
+
|---|---|
|
|
158
|
+
| "V6 release notes say calling is bundled, so `calls-sdk-android:5.0.+` must be redundant" | **FALSE.** The chatuikit-compose AAR references `CometChatCalls$SessionSettingsBuilder` at bytecode level but doesn't ship it. Without the peer dep, the app crashes on `Application.onCreate` with `ClassNotFoundException`. Verify with `./gradlew :app:dependencies \| grep calls-sdk`. See W1. |
|
|
159
|
+
| "`CometChatCallButtons` is the documented composable, so W4's hand-wired button must be a workaround for an older version" | **FALSE.** Validated broken on `chatuikit-compose-android:6.0.0` on 2026-05-12 — the per-row `user` prop is captured-by-first-composition (ENG-35711). Re-test only after a confirmed 6.0.1+ release-notes entry that explicitly fixes per-row state. Until then: hand-wire your own button to `CometChat.initiateCall` then `CometChatCallActivity.Companion.launchOutgoingCallScreen`. See W4. |
|
|
160
|
+
| "I'll skip the `annotations-java5` exclude — build works locally" | **FALSE in CI.** The duplicate-class error only fires on clean builds; incremental local builds mask it. ENG-35701 — testers shipped to CI and the build failed there. The exclude is one line; the cost of skipping is a CI red. See W2. |
|
|
161
|
+
| "Stub classes are old V4 cruft — V5 calls-sdk doesn't need `com.cometchat.calls.{CometChatRTCView,model.RTCUser,...}`" | **FALSE.** The chat-sdk's `CallManager` references those legacy classes at bytecode level. Without the four no-op stubs, `Application.onCreate` throws `NoClassDefFoundError` even though you never call them. See W3 stubs — copy verbatim. |
|
|
162
|
+
| "I'll add `FOREGROUND_SERVICE_PHONE_CALL` permissions later — calling works without them in dev" | **FALSE on Android 14+.** Calls work in dev because the test device hasn't enforced the new permission model yet (or has the dev override). Production / Play Store devices on API 34+ silently kill the foreground service the second the user backgrounds the app. The four FOREGROUND_SERVICE_* permissions go in the manifest from day one. |
|
|
163
|
+
| "The `Call(uid, type, receiverType)` constructor is what the docs show, so I'll use that arg order" | **FALSE in chat-sdk 5.x.** Bytecode-confirmed against chat-sdk-android:5.0.1: the arg order is `Call(receiverUid, receiverType, callType)` — receiverType comes BEFORE callType, opposite of v4. Skipping yields server `ERR_BAD_REQUEST: Failed to validate the data sent with the request`. See W5. |
|
|
164
|
+
| "I'll use `CometChatCalls.endSession(callback)` to clean up — most APIs take a callback" | **FALSE.** `endSession()` is void/no-callback (ENG-35698). The v5 canonical teardown is `CallSession.getInstance().leaveSession()`. Passing a callback compiles in some versions but is silently ignored. |
|
|
165
|
+
|
|
166
|
+
## Red Flags — symptom → cause lookup
|
|
167
|
+
|
|
168
|
+
When debugging an Android V6 calls integration, match the symptom to the workaround you skipped:
|
|
169
|
+
|
|
170
|
+
| Symptom (in logcat or build output) | You skipped... |
|
|
171
|
+
|---|---|
|
|
172
|
+
| `java.lang.ClassNotFoundException: com.cometchat.calls.core.CometChatCalls$SessionSettingsBuilder` on app launch | **W1** — calls-sdk-android peer dep is missing. Add `implementation("com.cometchat:calls-sdk-android:5.0.+")`. |
|
|
173
|
+
| `Duplicate class org.jetbrains.annotations.NotNull` / `ApiStatus` / `ScheduledForRemoval` on clean build | **W2** — annotations-java5 exclude. Add `configurations.all { exclude(group = "org.jetbrains", module = "annotations-java5") }` to `app/build.gradle.kts`. |
|
|
174
|
+
| `java.lang.NoClassDefFoundError: com.cometchat.calls.CometChatRTCView` (or `RTCUser` / `RTCReceiver` / `RTCCallback`) on `Application.onCreate` | **W3** — the four legacy no-op stub classes. Copy verbatim from the §"Five required workarounds" W3 block. |
|
|
175
|
+
| Every call-button row dials the same person regardless of which row was tapped | **W4** — you used `CometChatCallButtons` instead of hand-wiring. The per-row `user` prop is captured-by-first-composition. Switch to manual `CometChat.initiateCall` + `CometChatCallActivity.Companion.launchOutgoingCallScreen`. |
|
|
176
|
+
| Server returns `ERR_BAD_REQUEST: Failed to validate the data sent with the request` on `initiateCall` | **W5** — `Call()` constructor arg order is v4-style. Switch to `Call(receiverUid, receiverType, callType)`. |
|
|
177
|
+
| Foreground service silently dies when user backgrounds the app on Android 14+ | The four `FOREGROUND_SERVICE_*` permissions are missing from `AndroidManifest.xml`. Add `FOREGROUND_SERVICE`, `FOREGROUND_SERVICE_PHONE_CALL`, `FOREGROUND_SERVICE_MICROPHONE`, `FOREGROUND_SERVICE_CAMERA`. |
|
|
178
|
+
| Outgoing call rings on the peer but never joins after accept | The accept→join handoff isn't wired. The `onIncomingCallReceived` listener must call `CometChat.acceptCall` THEN `CometChatCalls.joinSession` — and the receiver app needs the same workaround chain (W1–W5) to play back. |
|
|
179
|
+
| `endSession()` takes 0 args error | You passed a callback. v5 `CometChatCalls.endSession()` is void. For teardown with state, use `CallSession.getInstance().leaveSession()`. |
|
|
180
|
+
|
|
181
|
+
## Verification — before declaring this skill applied
|
|
182
|
+
|
|
183
|
+
- [ ] `grep -nE "implementation.*calls-sdk-android" app/build.gradle.kts` returns ≥ 1 match (W1).
|
|
184
|
+
- [ ] `grep -nE 'exclude.*annotations-java5' app/build.gradle.kts` returns ≥ 1 match (W2).
|
|
185
|
+
- [ ] `grep -rnE "class (CometChatRTCView|RTCUser|RTCReceiver|RTCCallback)" app/src/main/java/com/cometchat/calls/` returns 4 matches — the W3 stub classes are in place.
|
|
186
|
+
- [ ] **`grep -rnE "CometChatCallButtons\(" app/src/` returns ZERO matches** (W4 — the per-row global-state bug). If any matches exist, the agent regressed to vendor marketing.
|
|
187
|
+
- [ ] `grep -nE "Call\((\w+),\s*CometChatConstants.RECEIVER_TYPE_" app/src/` confirms `RECEIVER_TYPE_` is the SECOND arg (W5 — receiverType before callType).
|
|
188
|
+
- [ ] `AndroidManifest.xml` declares all four `FOREGROUND_SERVICE_*` permissions.
|
|
189
|
+
- [ ] App runs `./gradlew :app:assembleDebug` cleanly — no duplicate-class, no ClassNotFoundException, no compile errors.
|
|
190
|
+
- [ ] Pairwise test (caller + receiver, two devices or sim+device) confirms: outgoing call rings, accept→join handoff completes, both sides see WebRTC frames.
|
|
191
|
+
|
|
136
192
|
---
|
|
137
193
|
|
|
138
194
|
## 1. The seven hard rules — Android v6 specialization
|
|
139
195
|
|
|
140
196
|
The same seven non-negotiables from the dispatcher; v6 changes the *how* but not the *what*.
|
|
141
197
|
|
|
142
|
-
### 1.0 Calls SDK login
|
|
198
|
+
### 1.0 Calls SDK login — only the STANDALONE/raw-SDK path needs it
|
|
199
|
+
|
|
200
|
+
> ✅ **The additive UI-Kit path does NOT call `CometChatCalls.login`.** When you use the V6 UI Kit (the common case — `CometChatIncomingCall` + the auto call buttons in `CometChatMessageHeader`, with `.setEnableCalling(true)`), the kit registers the calling extension at init and chains the Calls-SDK auth off `CometChatUIKit.login` for you. **Both canonical Android v6 sample apps wire calls end-to-end with ZERO `CometChatCalls.login`** (verified: no `CometChatCalls.login` in `sample-app-kotlin`/`sample-app-compose`). Adding it yourself on the UI-Kit path is redundant. (Matches the standing finding: UI Kit login chains Calls-SDK login; the explicit step only fires on raw-SDK paths.)
|
|
143
201
|
|
|
144
|
-
|
|
202
|
+
**`CometChatCalls.login(uid, AUTH_KEY, ...)` is required ONLY on the STANDALONE / raw-Calls-SDK path** — when you call `CometChatCalls.generateToken` / `startSession` directly without the UI Kit's calling components. There, the Calls SDK has its own auth state separate from the Chat SDK: after `CometChat.login(uid, AUTH_KEY)` succeeds, also call `CometChatCalls.login(uid, AUTH_KEY, ...)` — without it the first raw calls API call throws **"auth token cannot be null"**.
|
|
145
203
|
|
|
146
204
|
```kotlin
|
|
147
205
|
import com.cometchat.calls.core.CometChatCalls
|
|
@@ -249,7 +307,7 @@ class MainActivity : ComponentActivity() {
|
|
|
249
307
|
}
|
|
250
308
|
```
|
|
251
309
|
|
|
252
|
-
In Kotlin Views, the equivalent is a top-level `FrameLayout` in the Activity's layout XML containing both the host `<fragment>` and `<com.cometchat.
|
|
310
|
+
In Kotlin Views, the equivalent is a top-level `FrameLayout` in the Activity's layout XML containing both the host `<fragment>` and `<com.cometchat.uikit.kotlin.presentation.incomingcall.CometChatIncomingCall>`.
|
|
253
311
|
|
|
254
312
|
---
|
|
255
313
|
|
|
@@ -259,12 +317,12 @@ V6 has no separate calls module. If `chatuikit-{compose,kotlin}-android` is alre
|
|
|
259
317
|
|
|
260
318
|
1. Adds calling configuration to `UIKitSettings`:
|
|
261
319
|
```kotlin
|
|
262
|
-
val settings = UIKitSettings.
|
|
320
|
+
val settings = UIKitSettings.UIKitSettingsBuilder()
|
|
263
321
|
.setAppId(BuildConfig.COMETCHAT_APP_ID)
|
|
264
322
|
.setRegion(BuildConfig.COMETCHAT_REGION)
|
|
265
323
|
.setAuthKey(BuildConfig.COMETCHAT_AUTH_KEY)
|
|
266
324
|
.subscribePresenceForAllUsers()
|
|
267
|
-
.
|
|
325
|
+
.setEnableCalling(true) // ← v6 flips calling on here (real method: setEnableCalling)
|
|
268
326
|
.build()
|
|
269
327
|
```
|
|
270
328
|
2. Ensures the four FOREGROUND_SERVICE permissions and the four call permissions are in `AndroidManifest.xml`.
|
|
@@ -278,7 +336,9 @@ Detailed V6 init order: `cometchat-android-v6-core`. UIKitSettings option-by-opt
|
|
|
278
336
|
|
|
279
337
|
Both surfaces ship the same five call components with the same parameter names. Surface determines which import you use.
|
|
280
338
|
|
|
281
|
-
### Compose (`com.cometchat.
|
|
339
|
+
### Compose (`com.cometchat.uikit.compose.presentation.<component>.ui.*`)
|
|
340
|
+
|
|
341
|
+
> Real namespace is `com.cometchat.uikit.compose.presentation.{incomingcall,callbuttons,ongoingcall,outgoingcall,calllogs}.ui.*` (NOT `com.cometchat.chatuikit.calling.*` — that package does not exist). Use the exact per-component import from `cometchat-android-v6-compose-components`.
|
|
282
342
|
|
|
283
343
|
| Composable | Purpose |
|
|
284
344
|
|---|---|
|
|
@@ -288,12 +348,12 @@ Both surfaces ship the same five call components with the same parameter names.
|
|
|
288
348
|
| `CometChatOngoingCall(callSettingsBuilder, sessionId)` | WebRTC view — handles camera/mic/end controls |
|
|
289
349
|
| `CometChatCallLogs(onItemClick)` | Paginated history; integrates with Compose Navigation |
|
|
290
350
|
|
|
291
|
-
### Kotlin Views (`com.cometchat.
|
|
351
|
+
### Kotlin Views (`com.cometchat.uikit.kotlin.presentation.<component>.*`)
|
|
292
352
|
|
|
293
|
-
Same names, different package. Inflate via XML or programmatically:
|
|
353
|
+
Same names, different package — real namespace `com.cometchat.uikit.kotlin.presentation.{incomingcall,callbuttons,ongoingcall.ui,outgoingcall,calllogs}.*` (NOT `com.cometchat.chatuikit.calling.*`). Use the exact per-component import from `cometchat-android-v6-kotlin-components`. Inflate via XML or programmatically:
|
|
294
354
|
|
|
295
355
|
```xml
|
|
296
|
-
<com.cometchat.
|
|
356
|
+
<com.cometchat.uikit.kotlin.presentation.callbuttons.CometChatCallButtons
|
|
297
357
|
android:id="@+id/callButtons"
|
|
298
358
|
android:layout_width="wrap_content"
|
|
299
359
|
android:layout_height="wrap_content" />
|
|
@@ -337,7 +397,7 @@ Dual-SDK + telecom + push + V6 chatuikit:
|
|
|
337
397
|
|
|
338
398
|
When chat is already integrated via V6. The skill:
|
|
339
399
|
|
|
340
|
-
- Adds `.
|
|
400
|
+
- Adds `.setEnableCalling(true)` to the existing `UIKitSettings.UIKitSettingsBuilder()` chain.
|
|
341
401
|
- Adds the four `FOREGROUND_SERVICE_*` permissions to manifest.
|
|
342
402
|
- Mounts `CometChatIncomingCall` at the root of the existing Activity (Compose: in `setContent`; Views: in the root layout XML).
|
|
343
403
|
- Wires call buttons inline — `CometChatMessageHeader` (V6) already renders them; the kit calls `initiateCall` automatically when calling is enabled.
|
|
@@ -345,7 +405,7 @@ When chat is already integrated via V6. The skill:
|
|
|
345
405
|
|
|
346
406
|
## 6. Anti-patterns
|
|
347
407
|
|
|
348
|
-
1. **
|
|
408
|
+
1. **Omitting the `calls-sdk-android:5.0.+` peer dep because "V6 folds calls in."** This is the OPPOSITE of the truth — see **W1**. Despite the V6 marketing, `chatuikit-{compose,kotlin}-android:6.0.0` bytecode-references `CometChatCalls.SessionSettingsBuilder`, which ships ONLY in `com.cometchat:calls-sdk-android:5.0.+`. Without that explicit dependency the app crashes at runtime (`NoClassDefFoundError`). `.setEnableCalling(true)` alone is NOT enough. (What you must NOT add is the separate V5 *calls UI Kit* — that's the module that conflicts; the bare `calls-sdk-android` peer dep is required.)
|
|
349
409
|
2. **Mounting `CometChatIncomingCall` inside the navigation graph.** Disappears on navigation events. Mount at root (rule 1.7).
|
|
350
410
|
3. **Activity theme not inheriting `CometChatTheme.DayNight` for V6 Kotlin Views.** Calls components extend `MaterialCardView` and crash with `Failed to resolve attribute at index N` if hosted in `Theme.AppCompat.*`. Compose surfaces are not affected. Already documented in `cometchat-android-v6-troubleshooting`; surfaced here because calls components are the canary that exposes the bug.
|
|
351
411
|
4. **Skipping the four `FOREGROUND_SERVICE_*` permissions** because the kit "already" registers the service. Manifest merge does not pull permissions — your app must declare them.
|
|
@@ -354,7 +414,7 @@ When chat is already integrated via V6. The skill:
|
|
|
354
414
|
## 7. Verification checklist
|
|
355
415
|
|
|
356
416
|
- [ ] `chatuikit-compose-android` OR `chatuikit-kotlin-android` (NOT both) in `app/build.gradle.kts` — V6 picks one surface
|
|
357
|
-
- [ ] `.
|
|
417
|
+
- [ ] `.setEnableCalling(true)` on `UIKitSettings.UIKitSettingsBuilder()`
|
|
358
418
|
- [ ] Activity theme is `CometChatTheme.DayNight` (Kotlin Views only)
|
|
359
419
|
- [ ] All four `FOREGROUND_SERVICE_*` permissions in `AndroidManifest.xml`
|
|
360
420
|
- [ ] All four call permissions (RECORD_AUDIO / CAMERA / POST_NOTIFICATIONS / MANAGE_OWN_CALLS)
|
|
@@ -368,6 +428,7 @@ When chat is already integrated via V6. The skill:
|
|
|
368
428
|
|
|
369
429
|
## 8. Pointers
|
|
370
430
|
|
|
431
|
+
- `references/advanced-features.md` — Recording, Picture-in-Picture, Screen-share (receive) — source-verified against `calls-sdk-android` 5.x
|
|
371
432
|
- `cometchat-android-v5-calls/references/` — VoIP push, foreground service, ConnectionService, FCM payload shape — all unchanged on V6
|
|
372
433
|
- `cometchat-android-v6-builder-settings` — every UIKitSettings option including calling block details
|
|
373
434
|
- `cometchat-android-v6-{compose,kotlin}-components` — full surface-specific component catalogs
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# Android V6 — advanced in-call features (Recording, PiP, Screen-share)
|
|
2
|
+
|
|
3
|
+
These use the same `calls-sdk-android:5.x` the rest of V6 calls relies on (the W1 peer dep). Every symbol below is verified against the decompiled `calls-sdk-android` 5.x API. Works in both the Compose and Kotlin-Views surfaces — drive UI state from a ViewModel; the SDK calls are surface-agnostic.
|
|
4
|
+
|
|
5
|
+
**Session handle:** `CallSession.getInstance()` returns the active `CallSession` singleton. Several controls also have static convenience methods directly on `CometChatCalls`.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 1. Recording
|
|
10
|
+
|
|
11
|
+
Server-gated — recording must be enabled for the app in the CometChat dashboard first; otherwise the calls below no-op.
|
|
12
|
+
|
|
13
|
+
```kotlin
|
|
14
|
+
// Start / stop on demand (static convenience)
|
|
15
|
+
CometChatCalls.startRecording()
|
|
16
|
+
CometChatCalls.stopRecording()
|
|
17
|
+
|
|
18
|
+
// …or on the active session
|
|
19
|
+
CallSession.getInstance().startRecording()
|
|
20
|
+
CallSession.getInstance().stopRecording()
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
**Auto-start + hide the default button** at session config time (both builders expose these):
|
|
24
|
+
|
|
25
|
+
```kotlin
|
|
26
|
+
val sessionSettings = CometChatCalls.SessionSettingsBuilder(activity) // or no-arg SessionSettingsBuilder()
|
|
27
|
+
.enableAutoStartRecording(true) // begin recording when the call connects
|
|
28
|
+
.hideRecordingButton(false) // keep the kit's built-in record toggle (default UI)
|
|
29
|
+
.build()
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
**React to recording state** via `MediaEventsListener` (registered the same way as the other call event listeners in this skill):
|
|
33
|
+
|
|
34
|
+
```kotlin
|
|
35
|
+
object : MediaEventsListener() {
|
|
36
|
+
override fun onRecordingStarted() { /* show REC indicator */ }
|
|
37
|
+
override fun onRecordingStopped() { /* hide REC indicator */ }
|
|
38
|
+
}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Verified: `CometChatCalls.startRecording()/stopRecording()` (static + `CallSession` instance), `SessionSettingsBuilder.enableAutoStartRecording(boolean)` + `hideRecordingButton(boolean)` (NOTE: `CallSettingsBuilder` is the deprecated v4 name, replaced by `SessionSettingsBuilder` in calls-sdk v5 — it no longer exists on android-v6), `MediaEventsListener.onRecordingStarted()/onRecordingStopped()`.
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## 2. Picture-in-Picture
|
|
46
|
+
|
|
47
|
+
Two distinct things — don't confuse them:
|
|
48
|
+
|
|
49
|
+
- **In-call compact layout** (the SDK shrinks the call grid to a floating tile *inside your app*): `CallSession.enablePictureInPictureLayout()` / `disablePictureInPictureLayout()`.
|
|
50
|
+
- **System PiP** (the OS floats the call over other apps when the user leaves): static `CometChatCalls.enterPIPMode()` / `exitPIPMode()`. For OS-level PiP you must also declare the Activity `android:supportsPictureInPicture="true"` in the manifest and call `enterPIPMode()` from `onUserLeaveHint()`.
|
|
51
|
+
|
|
52
|
+
```kotlin
|
|
53
|
+
// in-call compact layout
|
|
54
|
+
CallSession.getInstance().enablePictureInPictureLayout()
|
|
55
|
+
CallSession.getInstance().disablePictureInPictureLayout()
|
|
56
|
+
|
|
57
|
+
// system PiP (manifest: android:supportsPictureInPicture="true")
|
|
58
|
+
override fun onUserLeaveHint() {
|
|
59
|
+
super.onUserLeaveHint()
|
|
60
|
+
CometChatCalls.enterPIPMode()
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Verified: `CallSession.enablePictureInPictureLayout()/disablePictureInPictureLayout()`, static `CometChatCalls.enterPIPMode()/exitPIPMode()`.
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## 3. Screen sharing — receive only
|
|
69
|
+
|
|
70
|
+
**Android cannot locally INITIATE screen share** (that's a web-only capability). It *renders a remote participant's* shared screen automatically inside the call grid. You only wire a listener to react to it (e.g. switch to spotlight layout, show a banner):
|
|
71
|
+
|
|
72
|
+
```kotlin
|
|
73
|
+
object : ParticipantEventListener() {
|
|
74
|
+
override fun onParticipantStartedScreenShare(participant: Participant) {
|
|
75
|
+
// optional: CallSession.getInstance().setLayout(LayoutType.SPOTLIGHT)
|
|
76
|
+
}
|
|
77
|
+
override fun onParticipantStoppedScreenShare(participant: Participant) { }
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Verified: `ParticipantEventListener.onParticipantStartedScreenShare(Participant)/onParticipantStoppedScreenShare(Participant)`. There is NO local `startScreenShare` symbol in `calls-sdk-android` 5.x — do not author one.
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## Audio modes (cross-reference)
|
|
86
|
+
|
|
87
|
+
Speaker / earpiece / Bluetooth routing is already covered in `references/device-management.md` (`setAudioMode(AudioMode.SPEAKER/EARPIECE/BLUETOOTH/HEADPHONES)` + `MediaEventsListener.onAudioModeChanged`). Virtual Background is **not supported** by `calls-sdk-android` 5.x (no symbol) — it is a web / React Native / Flutter capability only; do not author it for Android.
|
|
@@ -9,27 +9,36 @@ Same SDK API as V5; V6 adds Compose-native `SegmentedButton` for the switcher.
|
|
|
9
9
|
|
|
10
10
|
## ViewModel
|
|
11
11
|
|
|
12
|
+
Layout is the `LayoutType` enum (`TILE` / `SIDEBAR` / `SPOTLIGHT`) — there is no `CometChatCallsConstants.LAYOUT_*` and `setLayout` is an instance method on the `CallSession` singleton (not a static on `CometChatCalls`).
|
|
13
|
+
|
|
12
14
|
```kotlin
|
|
15
|
+
import com.cometchat.calls.core.CallSession
|
|
16
|
+
import com.cometchat.calls.listeners.LayoutListener
|
|
17
|
+
import com.cometchat.calls.model.LayoutType
|
|
18
|
+
|
|
13
19
|
class CallLayoutViewModel : ViewModel() {
|
|
14
|
-
private val _layout = MutableStateFlow(
|
|
15
|
-
val layout: StateFlow<
|
|
20
|
+
private val _layout = MutableStateFlow(LayoutType.TILE)
|
|
21
|
+
val layout: StateFlow<LayoutType> = _layout
|
|
16
22
|
|
|
17
|
-
fun set(next:
|
|
18
|
-
|
|
23
|
+
fun set(next: LayoutType) {
|
|
24
|
+
CallSession.getInstance().setLayout(next)
|
|
19
25
|
_layout.value = next
|
|
20
26
|
}
|
|
21
27
|
|
|
22
|
-
fun onSDKChanged(next:
|
|
28
|
+
fun onSDKChanged(next: LayoutType) {
|
|
23
29
|
_layout.value = next // already updated by kit's switcher
|
|
24
30
|
}
|
|
25
31
|
}
|
|
26
32
|
|
|
27
|
-
//
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
33
|
+
// Register a LayoutListener via CallSession.addLayoutListener(lifecycleOwner, ...).
|
|
34
|
+
// onCallLayoutChanged is a LayoutListener member (NOT a CometChatCallsEventsListener one).
|
|
35
|
+
CallSession.getInstance().addLayoutListener(lifecycleOwner, object : LayoutListener() {
|
|
36
|
+
override fun onCallLayoutChanged(layout: LayoutType) {
|
|
37
|
+
Handler(Looper.getMainLooper()).post {
|
|
38
|
+
callLayoutViewModel.onSDKChanged(layout)
|
|
39
|
+
}
|
|
31
40
|
}
|
|
32
|
-
}
|
|
41
|
+
})
|
|
33
42
|
```
|
|
34
43
|
|
|
35
44
|
---
|
|
@@ -43,9 +52,9 @@ fun LayoutSwitcher(viewModel: CallLayoutViewModel = viewModel()) {
|
|
|
43
52
|
val layout by viewModel.layout.collectAsStateWithLifecycle()
|
|
44
53
|
|
|
45
54
|
val options = listOf(
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
55
|
+
LayoutType.TILE to "Tile",
|
|
56
|
+
LayoutType.SIDEBAR to "Sidebar",
|
|
57
|
+
LayoutType.SPOTLIGHT to "Spotlight",
|
|
49
58
|
)
|
|
50
59
|
|
|
51
60
|
SingleChoiceSegmentedButtonRow {
|
|
@@ -76,10 +85,10 @@ V5 sister rules apply, plus Compose-specific:
|
|
|
76
85
|
|
|
77
86
|
## Verification checklist
|
|
78
87
|
|
|
79
|
-
- [ ] `CallLayoutViewModel` exposes `StateFlow<
|
|
88
|
+
- [ ] `CallLayoutViewModel` exposes `StateFlow<LayoutType>`
|
|
80
89
|
- [ ] `SingleChoiceSegmentedButtonRow` wraps the layout options
|
|
81
90
|
- [ ] `collectAsStateWithLifecycle` (not `collectAsState`)
|
|
82
|
-
- [ ] `onCallLayoutChanged` syncs the ViewModel on main thread
|
|
91
|
+
- [ ] `LayoutListener.onCallLayoutChanged` (registered via `addLayoutListener`) syncs the ViewModel on main thread
|
|
83
92
|
- [ ] Real-device smoke: cycles all 3, survives rotation
|
|
84
93
|
|
|
85
94
|
---
|
|
@@ -6,7 +6,7 @@ V6 uses the same SDK (`com.cometchat.calls-sdk-android`) as V5. The canonical SD
|
|
|
6
6
|
- `cometchat-android-v5-calls/references/call-session.md` — canonical SDK API (single-call `joinSession`, `SessionSettingsBuilder`, `SessionStatusListener`, `CometChatOngoingCallService`)
|
|
7
7
|
- `cometchat-react-calls/references/call-session.md` — cross-platform architecture
|
|
8
8
|
|
|
9
|
-
**Source of truth:**
|
|
9
|
+
**Source of truth:** `calls-sdk-android-5/samples/sample-app/src/main/kotlin/com/cometchat/samplecalls/ui/activity/CallActivity.kt` (no Compose-specific upstream sample exists; the SDK surface is identical).
|
|
10
10
|
|
|
11
11
|
---
|
|
12
12
|
|
|
@@ -159,5 +159,5 @@ V5 checklist applies, plus Compose-specific:
|
|
|
159
159
|
- `cometchat-android-v5-calls/references/call-session.md` — canonical SDK API + Views patterns
|
|
160
160
|
- `cometchat-android-v6-calls/SKILL.md` — V6 Compose architecture (W1–W5 workarounds for the kit)
|
|
161
161
|
- `cometchat-android-v6-calls/references/share-invite.md` — App Links config
|
|
162
|
-
- Upstream Android sample —
|
|
162
|
+
- Upstream Android sample — `calls-sdk-android-5/samples/sample-app/src/main/kotlin/com/cometchat/samplecalls/ui/activity/CallActivity.kt`
|
|
163
163
|
- Canonical docs: https://www.cometchat.com/docs/calls/android/join-session
|
|
@@ -74,7 +74,7 @@ class CallControlsViewModel : ViewModel() {
|
|
|
74
74
|
fun toggleMic() {
|
|
75
75
|
val callSession = CallSession.getInstance()
|
|
76
76
|
if (_state.value.micMuted) {
|
|
77
|
-
callSession.
|
|
77
|
+
callSession.unmuteAudio()
|
|
78
78
|
} else {
|
|
79
79
|
callSession.muteAudio()
|
|
80
80
|
}
|
|
@@ -92,13 +92,10 @@ class CallControlsViewModel : ViewModel() {
|
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
fun flipCamera() {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
CameraFacing.FRONT
|
|
100
|
-
}
|
|
101
|
-
callSession.switchCamera(newFacing)
|
|
95
|
+
// switchCamera() takes NO argument — it toggles front/rear internally.
|
|
96
|
+
// (The enum, when you need it, is CameraFacing.{FRONT,REAR} — there is no BACK,
|
|
97
|
+
// and CallSession has no currentCameraFacing getter.)
|
|
98
|
+
CallSession.getInstance().switchCamera()
|
|
102
99
|
}
|
|
103
100
|
|
|
104
101
|
fun toggleSpeaker() {
|
|
@@ -121,23 +118,27 @@ class CallControlsViewModel : ViewModel() {
|
|
|
121
118
|
V6 still uses the V5 SDK's `MediaEventsListener` for audio mode change detection:
|
|
122
119
|
|
|
123
120
|
```kotlin
|
|
124
|
-
class CallControlsViewModel
|
|
121
|
+
class CallControlsViewModel(
|
|
122
|
+
lifecycleOwner: LifecycleOwner,
|
|
123
|
+
) : ViewModel(), MediaEventsListener {
|
|
125
124
|
init {
|
|
126
|
-
|
|
125
|
+
// addMediaEventsListener takes (LifecycleOwner, MediaEventsListener) — there is no String-keyed overload.
|
|
126
|
+
CallSession.getInstance().addMediaEventsListener(lifecycleOwner, this)
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
-
override fun
|
|
129
|
+
override fun onAudioModeChanged(mode: AudioMode) {
|
|
130
130
|
_state.update { it.copy(audioMode = mode) }
|
|
131
131
|
}
|
|
132
132
|
|
|
133
133
|
override fun onCleared() {
|
|
134
|
-
|
|
134
|
+
// There is no removeMediaEventsListener — clear all listeners on teardown.
|
|
135
|
+
CallSession.getInstance().clearAllListeners()
|
|
135
136
|
}
|
|
136
137
|
// ... other MediaEventsListener methods
|
|
137
138
|
}
|
|
138
139
|
```
|
|
139
140
|
|
|
140
|
-
When the user connects Bluetooth headphones mid-call, `
|
|
141
|
+
When the user connects Bluetooth headphones mid-call, `onAudioModeChanged(BLUETOOTH)` fires. Update the UI button accordingly. (Lifecycle-scoped registration auto-removes when the owner is destroyed; `clearAllListeners()` is the explicit teardown.)
|
|
141
142
|
|
|
142
143
|
---
|
|
143
144
|
|
|
@@ -147,7 +148,7 @@ V5 audio-controls + video-controls references list the SDK-level anti-patterns;
|
|
|
147
148
|
|
|
148
149
|
1. **`Icons.Filled.MicOff` without `tint`.** Default tint is theme-dependent; on dark call surfaces, the icon may be invisible.
|
|
149
150
|
2. **`collectAsState()` instead of `collectAsStateWithLifecycle()`.** State updates run while paused; CPU waste.
|
|
150
|
-
3. **
|
|
151
|
+
3. **Calling `switchCamera(CameraFacing)` with an argument.** No such overload exists — `switchCamera()` takes no arg and toggles front/rear internally. There is also no `currentCameraFacing` getter, and the enum is `CameraFacing.{FRONT,REAR}` (no `BACK`).
|
|
151
152
|
|
|
152
153
|
---
|
|
153
154
|
|
|
@@ -155,8 +156,8 @@ V5 audio-controls + video-controls references list the SDK-level anti-patterns;
|
|
|
155
156
|
|
|
156
157
|
- [ ] ViewModel uses `StateFlow` + `collectAsStateWithLifecycle()`
|
|
157
158
|
- [ ] All toggle buttons have `contentDescription` (a11y)
|
|
158
|
-
- [ ] `MediaEventsListener` registered
|
|
159
|
-
- [ ]
|
|
159
|
+
- [ ] `MediaEventsListener` registered via `addMediaEventsListener(lifecycleOwner, this)`
|
|
160
|
+
- [ ] Listeners cleared in `onCleared()` via `clearAllListeners()`
|
|
160
161
|
- [ ] Real-device smoke: mute / camera / flip / speaker all work
|
|
161
162
|
- [ ] Bluetooth smoke: connect headphones → audio mode icon updates
|
|
162
163
|
|
|
@@ -9,14 +9,17 @@ Same SDK API as V5. V6-specific: Compose `AlertDialog` for new code, ViewModel +
|
|
|
9
9
|
|
|
10
10
|
## SDK API (same as V5)
|
|
11
11
|
|
|
12
|
+
There is a single `setIdleTimeoutPeriod(int)` — there is no separate before/after-prompt pair. `SessionSettingsBuilder` has only `()` and `(Activity)` constructors (no `(context, container)` form).
|
|
13
|
+
|
|
12
14
|
```kotlin
|
|
13
|
-
val settings = SessionSettingsBuilder(
|
|
15
|
+
val settings = SessionSettingsBuilder(activity) // or no-arg SessionSettingsBuilder()
|
|
14
16
|
.setSessionType(SessionType.VIDEO)
|
|
15
|
-
.
|
|
16
|
-
.setIdleTimeoutPeriodAfterPrompt(120_000)
|
|
17
|
+
.setIdleTimeoutPeriod(60) // SECONDS (= 60s); default 300
|
|
17
18
|
.build()
|
|
18
19
|
```
|
|
19
20
|
|
|
21
|
+
> **⚠ Unit footgun — Android takes SECONDS, not milliseconds.** `setIdleTimeoutPeriod(int)` is in **seconds** (default `300` = 5 min; docs: calls/android/idle-timeout). The **web / React Native / Angular** Calls SDK uses **milliseconds** for `SessionSettings.idleTimeoutPeriodBeforePrompt/AfterPrompt` — copying a web value like `60000` here is a ~16.7-hour timeout, not 60 seconds. Use `60` for one minute.
|
|
22
|
+
|
|
20
23
|
---
|
|
21
24
|
|
|
22
25
|
## Compose prompt
|
|
@@ -91,7 +94,7 @@ V5 sister rules apply, plus V6-specific:
|
|
|
91
94
|
|
|
92
95
|
## Verification checklist
|
|
93
96
|
|
|
94
|
-
- [ ] SessionSettingsBuilder sets
|
|
97
|
+
- [ ] SessionSettingsBuilder sets `setIdleTimeoutPeriod(int)`
|
|
95
98
|
- [ ] Compose AlertDialog `onDismissRequest = { }` (empty)
|
|
96
99
|
- [ ] `collectAsStateWithLifecycle()` for state binding
|
|
97
100
|
- [ ] LaunchedEffect on specific field, not whole state
|
|
@@ -73,12 +73,12 @@ class InCallChatViewModel : ViewModel(), MessageListener {
|
|
|
73
73
|
if (message.receiverType != CometChatConstants.RECEIVER_TYPE_GROUP) return
|
|
74
74
|
if (message.receiverUid != _state.value.group?.guid) return
|
|
75
75
|
_state.update { it.copy(unread = it.unread + 1) }
|
|
76
|
-
|
|
76
|
+
CallSession.getInstance().setChatButtonUnreadCount(_state.value.unread)
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
fun open() {
|
|
80
80
|
_state.update { it.copy(open = true, unread = 0) }
|
|
81
|
-
|
|
81
|
+
CallSession.getInstance().setChatButtonUnreadCount(0)
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
fun close() {
|
|
@@ -95,15 +95,20 @@ class InCallChatViewModel : ViewModel(), MessageListener {
|
|
|
95
95
|
|
|
96
96
|
## Triggering from SDK event
|
|
97
97
|
|
|
98
|
-
|
|
98
|
+
`onChatButtonClicked()` is a `ButtonClickListener` member (NOT on `CometChatCallsEventsListener`). Register it via `CallSession.addButtonClickListener(lifecycleOwner, ...)`:
|
|
99
99
|
|
|
100
100
|
```kotlin
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
101
|
+
import com.cometchat.calls.core.CallSession
|
|
102
|
+
import com.cometchat.calls.listeners.ButtonClickListener
|
|
103
|
+
|
|
104
|
+
CallSession.getInstance().addButtonClickListener(lifecycleOwner, object : ButtonClickListener() {
|
|
105
|
+
override fun onChatButtonClicked() {
|
|
106
|
+
// Listener is on background thread — dispatch to UI
|
|
107
|
+
Handler(Looper.getMainLooper()).post {
|
|
108
|
+
inCallChatViewModel.open()
|
|
109
|
+
}
|
|
105
110
|
}
|
|
106
|
-
}
|
|
111
|
+
})
|
|
107
112
|
```
|
|
108
113
|
|
|
109
114
|
---
|
|
@@ -10,14 +10,16 @@ V6 ships the same SDK API as V5 with two key delta: (1) Compose-first surface fo
|
|
|
10
10
|
## SDK API (same as V5)
|
|
11
11
|
|
|
12
12
|
```kotlin
|
|
13
|
-
import com.cometchat.calls.core.
|
|
13
|
+
import com.cometchat.calls.core.CallSession
|
|
14
14
|
import com.cometchat.calls.listeners.CometChatCallsEventsListener
|
|
15
15
|
import com.cometchat.calls.model.Participant
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
// raiseHand / lowerHand are instance methods on the CallSession singleton.
|
|
18
|
+
CallSession.getInstance().raiseHand()
|
|
19
|
+
CallSession.getInstance().lowerHand()
|
|
19
20
|
|
|
20
|
-
|
|
21
|
+
// SessionSettingsBuilder has only () and (Activity) constructors — no (context, container) form.
|
|
22
|
+
val settings = SessionSettingsBuilder(activity) // or no-arg SessionSettingsBuilder()
|
|
21
23
|
.setSessionType(SessionType.VIDEO)
|
|
22
24
|
.hideRaiseHandButton(true)
|
|
23
25
|
.build()
|