@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
|
@@ -2,14 +2,15 @@
|
|
|
2
2
|
name: cometchat-android-v6-core
|
|
3
3
|
description: "CometChat Android UIKit v6 core setup — Gradle dependencies, SDK initialization, login/logout, and message sending"
|
|
4
4
|
license: "MIT"
|
|
5
|
-
compatibility: "Android 9.0+ (API 28); Kotlin
|
|
6
|
-
allowed-tools: "shell, file-read, file-search, file-list"
|
|
5
|
+
compatibility: "Android 9.0+ (API 28); Kotlin 2.2.0+; AGP 8.9.1+; JDK 17; com.cometchat:chatuikit-compose-android:6.x / com.cometchat:chatuikit-kotlin-android:6.x (+ chat-sdk-android:5.x). File-based init (CometChatUIKit.initFromSettings + app/src/main/assets/cometchat-settings.json — ENG-35866 Skills Telemetry) ships in chatuikit-*-android >= 6.0.2 GA on the public cometchat/cometchat Maven repo."
|
|
7
6
|
metadata:
|
|
8
7
|
author: "CometChat"
|
|
9
8
|
version: "3.0.1"
|
|
10
9
|
tags: "cometchat, android, init, login, gradle, setup, core"
|
|
11
10
|
---
|
|
12
11
|
|
|
12
|
+
> **Ground truth:** `com.cometchat:chatuikit-compose-android:6.x` / `chatuikit-kotlin-android:6.x` (+ `chat-sdk-android:5.x`, `calls-sdk-android:5.x`) — `javap` the resolved AARs from the Gradle cache + `docs/ui-kit/android/v6`. **Official docs:** https://www.cometchat.com/docs/ui-kit/android/v6/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 resolved AAR before relying on them.
|
|
13
|
+
|
|
13
14
|
> **Companion skills:** cometchat (dispatcher), cometchat-android-v6-builder-settings (detailed UIKitSettings config), cometchat-android-v6-events (event system)
|
|
14
15
|
|
|
15
16
|
## Purpose
|
|
@@ -48,20 +49,24 @@ dependencyResolutionManagement {
|
|
|
48
49
|
|
|
49
50
|
### 1.2 Add Dependencies
|
|
50
51
|
|
|
51
|
-
Choose the stack you need in your module's `build.gradle.kts
|
|
52
|
+
Choose the stack you need in your module's `build.gradle.kts`. **Always resolve `6.0.+` (latest patch) — never hard-pin `6.0.0-beta2` or any earlier preview (ENG-35701).** V6 went GA on 2026-05-25; testers shipped with `-beta2` strings copy-pasted from older docs and missed two bug-fix patches. The dynamic `6.0.+` pin tracks GA forward without manual bumps.
|
|
52
53
|
|
|
53
54
|
```kotlin
|
|
54
55
|
// Jetpack Compose stack (includes core transitively)
|
|
55
|
-
implementation("com.cometchat:chatuikit-compose-android:6.0
|
|
56
|
+
implementation("com.cometchat:chatuikit-compose-android:6.0.+")
|
|
56
57
|
|
|
57
58
|
// Kotlin Views stack (includes core transitively)
|
|
58
|
-
implementation("com.cometchat:chatuikit-kotlin-android:6.0
|
|
59
|
+
implementation("com.cometchat:chatuikit-kotlin-android:6.0.+")
|
|
59
60
|
|
|
60
61
|
// Core only (no UI — for shared modules or custom UI)
|
|
61
|
-
implementation("com.cometchat:chatuikit-core-android:6.0
|
|
62
|
+
implementation("com.cometchat:chatuikit-core-android:6.0.+")
|
|
62
63
|
```
|
|
63
64
|
|
|
64
|
-
### 1.3 SDK Requirements
|
|
65
|
+
### 1.3 SDK + toolchain Requirements
|
|
66
|
+
|
|
67
|
+
> **Toolchain floor (verified building `6.0.2` GA to an APK):** the kit's transitive deps are newer than a default Arctic-Fox-era scaffold, so a fresh project on older tooling fails to build. The build needs:
|
|
68
|
+
> - **AGP ≥ 8.9.1** and **`compileSdk = 36`** — `chatuikit-core` pulls `androidx.core:core(-ktx):1.18.0`, which refuses AGP 8.7.x / compileSdk 35 (`requires Android Gradle plugin 8.9.1 or higher` / `compile against version 36 or later`).
|
|
69
|
+
> - **Kotlin ≥ 2.2.0** — the kit classes ship **Kotlin 2.2.0 metadata**; on Kotlin 1.9 the build fails with `Class 'com.cometchat.uikit.core.CometChatUIKit' was compiled with an incompatible version of Kotlin … metadata version is 2.2.0, but the compiler version 1.9.0 can read versions up to 2.0.0`.
|
|
65
70
|
|
|
66
71
|
```kotlin
|
|
67
72
|
android {
|
|
@@ -79,6 +84,13 @@ android {
|
|
|
79
84
|
}
|
|
80
85
|
```
|
|
81
86
|
|
|
87
|
+
> ⚠️ **Toolchain floors — verified against the published `chatuikit-kotlin-android:6.0.1` in a real `./gradlew :app:assembleDebug` (do NOT understate these):**
|
|
88
|
+
> - **Kotlin ≥ 2.1.0** (NOT "1.9+"). The 6.0.1 kit classes carry Kotlin metadata 2.1.0 and pull `kotlin-stdlib` 2.2.x; a Kotlin 1.9.x or 2.0.x project fails `compileDebugKotlin` with ~20 errors: *"Class … was compiled with an incompatible version of Kotlin. The actual metadata version is 2.1.0, but the compiler … can read versions up to 2.0.0."*
|
|
89
|
+
> - **AGP ≥ 8.9.1.** The kit transitively pulls `androidx.core:1.18.0` (needs AGP 8.9.1+) and `androidx.lifecycle:…-compose:2.9.2` (needs 8.6.0+); on AGP 8.5.x a fresh project fails at `:app:checkDebugAarMetadata`. `compileSdk = 36` already implies a recent AGP.
|
|
90
|
+
> - **Gradle JVM = JDK 17.** AGP 8.9.1 rejects JDK 11/20 as the Gradle JVM in common configs; build with JDK 17. (`compileOptions`/`jvmTarget` above stay at 11 for *your* code — that's the source/bytecode target, distinct from the Gradle daemon's JVM.)
|
|
91
|
+
>
|
|
92
|
+
> A default Android Studio project on AGP 8.5.x + Kotlin 1.9/2.0 hits two hard failures before any CometChat code runs. Bump `settings.gradle`/`build.gradle` plugin versions to `com.android.application` ≥ 8.9.1 and `org.jetbrains.kotlin.android` ≥ 2.1.0.
|
|
93
|
+
|
|
82
94
|
### 1.3a AndroidX + Jetifier (REQUIRED — non-negotiable)
|
|
83
95
|
|
|
84
96
|
The CometChat Chat SDK transitively depends on the legacy `com.android.support:support-compat` library. Modern Android Studio projects (Arctic Fox+) default to `androidx.core` instead. Without Jetifier, Gradle sees the same classes (`android.support.v4.os.ResultReceiver`, etc.) declared in both libraries and fails the build with:
|
|
@@ -90,14 +102,17 @@ Duplicate class android.support.v4.os.ResultReceiver$1 found in modules
|
|
|
90
102
|
(com.android.support:support-compat:26.1.0)
|
|
91
103
|
```
|
|
92
104
|
|
|
93
|
-
**Add these
|
|
105
|
+
**Add these three lines to `gradle.properties` at the project root** before any UI Kit code is wired in:
|
|
94
106
|
|
|
95
107
|
```properties
|
|
108
|
+
org.gradle.jvmargs=-Xmx4096m -XX:MaxMetaspaceSize=1024m
|
|
96
109
|
android.useAndroidX=true
|
|
97
110
|
android.enableJetifier=true
|
|
98
111
|
```
|
|
99
112
|
|
|
100
|
-
|
|
113
|
+
All three are **mandatory**. Jetifier rewrites the legacy `android.support.*` references in the CometChat SDK's transitive deps to their `androidx.*` equivalents at build time, so the duplicate-class error doesn't happen.
|
|
114
|
+
|
|
115
|
+
**Why the heap setting matters (F47, 2026-05-22)**: a fresh Android Studio scaffold's default `org.gradle.jvmargs=-Xmx2048m` is **insufficient** when calls features are enabled — `com.cometchat:calls-sdk-android:5.0.+` (the V6 calls peer dep — see `cometchat-android-v6-calls` W1) transitively pulls `react-native` and other heavy deps that Jetifier has to rewrite. The first `assembleDebug` OOMs partway through with `OutOfMemoryError: Java heap space`. Bumping to `4096m` + `MaxMetaspaceSize=1024m` is the validated minimum. If you skip this, the customer sees a confusing mid-build crash with no actionable error.
|
|
101
116
|
|
|
102
117
|
A freshly-created Android Studio project usually has `android.useAndroidX=true` already (Arctic Fox+) but **Jetifier is OFF by default** since it's deprecated in newer SDK landscapes. Both V5 and V6 CometChat SDKs still need it. If `gradle.properties` doesn't have either line, append both. If it has `useAndroidX=true` but no Jetifier line, add the Jetifier line. Idempotent.
|
|
103
118
|
|
|
@@ -123,6 +138,21 @@ configurations.all {
|
|
|
123
138
|
|
|
124
139
|
This is mandatory for both V5 and V6, both Compose and Kotlin Views. Idempotent — if the block already exists, leave it.
|
|
125
140
|
|
|
141
|
+
### 1.3c App theme MUST extend `CometChatTheme.DayNight` (Kotlin Views — REQUIRED)
|
|
142
|
+
|
|
143
|
+
For the **Kotlin Views** stack, the app/activity theme must extend the kit's `CometChatTheme.DayNight` (parent `Theme.MaterialComponents.DayNight.NoActionBar`). The component layouts reference `cometchat*` theme attributes that only that theme defines — a plain `Theme.AppCompat` / `Theme.Material3` / bare `Theme.MaterialComponents` theme makes the **first component inflate crash** (`CometChatConversations` → `MaterialButton`/`MaterialCardView` → `UnsupportedOperationException: Failed to resolve attribute …` or `requires your app theme to be Theme.MaterialComponents`). A default `flutter create`-style or Empty-Activity scaffold does NOT use this theme, so set it explicitly.
|
|
144
|
+
|
|
145
|
+
```xml
|
|
146
|
+
<!-- app/src/main/res/values/themes.xml -->
|
|
147
|
+
<style name="AppTheme" parent="CometChatTheme.DayNight" />
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
```xml
|
|
151
|
+
<!-- AndroidManifest.xml → <application android:theme="@style/AppTheme"> -->
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
(Customizing colors/typography on top of this theme → `cometchat-android-v6-kotlin-theming`. The Compose stack themes via `CometChatTheme { }` composables instead — see `cometchat-android-v6-compose-theming`.) Verified by building + running on-device, 2026-06-11.
|
|
155
|
+
|
|
126
156
|
### 1.4 Credentials → `local.properties` → `BuildConfig`
|
|
127
157
|
|
|
128
158
|
V6 has no runtime `.env` lookup; credentials are injected at compile time as `BuildConfig` fields. Do NOT hardcode App ID / Region / Auth Key in source files.
|
|
@@ -171,6 +201,61 @@ If `npx @cometchat/skills-cli provision setup --framework android` ran first, it
|
|
|
171
201
|
|
|
172
202
|
Initialize once in your `Application` class or splash screen — never in every Activity.
|
|
173
203
|
|
|
204
|
+
### File-based init with `cometchat-settings.json` (recommended)
|
|
205
|
+
|
|
206
|
+
> **Version requirement (ENG-35866 — Skills Telemetry).** `CometChatUIKit.initFromSettings(context, callback)` ships in **`chatuikit-{kotlin,compose}-android` ≥ `6.0.2` GA** on the public `cometchat/cometchat` Maven repo (pulls `chatuikit-core-android:6.0.2` + `chat-sdk-android:5.0.3`). It reads `app/src/main/assets/cometchat-settings.json` and lets the SDK self-report `integrationSource = "ai-agent"`. On an older kit (`< 6.0.2`) the method does not exist — use the **`UIKitSettingsBuilder` fallback** below.
|
|
207
|
+
|
|
208
|
+
**Step 1 — create `app/src/main/assets/cometchat-settings.json`** (create the `assets/` dir if it doesn't exist). Fill `appId` / `region` / `credentials.authKey`; leave everything else at the defaults below. These are the **same credentials** used everywhere else in the app — this file is the single source.
|
|
209
|
+
|
|
210
|
+
```json
|
|
211
|
+
{
|
|
212
|
+
"appId": "APP_ID_HERE",
|
|
213
|
+
"region": "us",
|
|
214
|
+
"credentials": {
|
|
215
|
+
"authKey": "AUTH_KEY_HERE"
|
|
216
|
+
},
|
|
217
|
+
"chatSDK": {
|
|
218
|
+
"presenceSubscription": {
|
|
219
|
+
"type": "ALL_USERS",
|
|
220
|
+
"roles": []
|
|
221
|
+
},
|
|
222
|
+
"autoEstablishSocketConnection": true,
|
|
223
|
+
"adminHost": null,
|
|
224
|
+
"clientHost": null
|
|
225
|
+
},
|
|
226
|
+
"callsSDK": {
|
|
227
|
+
"host": null,
|
|
228
|
+
"adminHost": null,
|
|
229
|
+
"clientHost": null,
|
|
230
|
+
"callsHost": null
|
|
231
|
+
},
|
|
232
|
+
"uiKit": {
|
|
233
|
+
"subscribePresenceForAllUsers": true
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
> Do NOT gitignore `cometchat-settings.json` — the dev-mode `authKey` it holds is no more exposed than a `BuildConfig.COMETCHAT_AUTH_KEY` value.
|
|
239
|
+
|
|
240
|
+
**Step 2 — init in `Application.onCreate()`.** No `UIKitSettingsBuilder` — the SDK reads `app/src/main/assets/cometchat-settings.json` itself:
|
|
241
|
+
|
|
242
|
+
```kotlin
|
|
243
|
+
import com.cometchat.uikit.core.CometChatUIKit
|
|
244
|
+
import com.cometchat.chat.core.CometChat
|
|
245
|
+
import com.cometchat.chat.exceptions.CometChatException
|
|
246
|
+
|
|
247
|
+
CometChatUIKit.initFromSettings(context, object : CometChat.CallbackListener<String>() {
|
|
248
|
+
override fun onSuccess(result: String) {
|
|
249
|
+
// SDK ready — proceed to login
|
|
250
|
+
}
|
|
251
|
+
override fun onError(e: CometChatException) {
|
|
252
|
+
// Handle initialization error
|
|
253
|
+
}
|
|
254
|
+
})
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
### `UIKitSettingsBuilder` init (fallback — any kit before `6.0.2`)
|
|
258
|
+
|
|
174
259
|
```kotlin
|
|
175
260
|
import com.cometchat.uikit.core.CometChatUIKit
|
|
176
261
|
import com.cometchat.uikit.core.UIKitSettings
|
|
@@ -211,6 +296,11 @@ See `cometchat-android-v6-builder-settings` for all `UIKitSettingsBuilder` optio
|
|
|
211
296
|
### 3.1 Login with UID (Development Only)
|
|
212
297
|
|
|
213
298
|
```kotlin
|
|
299
|
+
import com.cometchat.uikit.core.CometChatUIKit
|
|
300
|
+
import com.cometchat.chat.core.CometChat // for CometChat.CallbackListener
|
|
301
|
+
import com.cometchat.chat.models.User
|
|
302
|
+
import com.cometchat.chat.exceptions.CometChatException
|
|
303
|
+
|
|
214
304
|
CometChatUIKit.login("user_uid", object : CometChat.CallbackListener<User>() {
|
|
215
305
|
override fun onSuccess(user: User) {
|
|
216
306
|
// User logged in — show chat UI
|
|
@@ -221,6 +311,8 @@ CometChatUIKit.login("user_uid", object : CometChat.CallbackListener<User>() {
|
|
|
221
311
|
})
|
|
222
312
|
```
|
|
223
313
|
|
|
314
|
+
> The login/logout/send snippets in §3 use `CometChat.CallbackListener` — its import (`com.cometchat.chat.core.CometChat`) is shown in the §2 init block but a fresh agent copying only a §3 block needs it too. The four imports above carry it; reuse them across §3.1–§3.4.
|
|
315
|
+
|
|
224
316
|
### 3.2 Login with Auth Token (Production)
|
|
225
317
|
|
|
226
318
|
```kotlin
|
|
@@ -352,3 +444,291 @@ All send methods automatically:
|
|
|
352
444
|
- `compileSdk` should be 36 for full compatibility
|
|
353
445
|
- Both UI stacks depend on `chatuikit-core` transitively — do NOT add core as a separate dependency when using a UI stack
|
|
354
446
|
- `gradle.properties` MUST contain `android.useAndroidX=true` AND `android.enableJetifier=true` — see § 1.3a. Without Jetifier, the build fails with "Duplicate class android.support.v4.os.ResultReceiver$1" because the CometChat SDK's transitive `com.android.support:support-compat` collides with `androidx.core` in any modern Android Studio project
|
|
447
|
+
|
|
448
|
+
## Visual Builder integration
|
|
449
|
+
|
|
450
|
+
> **⚠ The Visual Builder emits V5-shaped code.** The canonical builder repo at the Android Visual Builder ZIP (download from https://preview.cometchat.com/downloads/cometchat-builder-android.zip) uses `com.cometchat:chat-uikit-android:5.2.6` — the **V5** Android UI Kit. There is no V6-native Visual Builder canonical from vendor side yet ([F22 finding, 2026-05-22](https://github.com/cometchat/cometchat-skills/issues)). When a V6 project picks the Visually path, skills emits V5 deps (`chat-uikit-android:5.+`) into `app/build.gradle` — your V6 Compose / Kotlin Views code in the rest of the project is untouched, but the Visual-Builder-emitted screens are V5-flavored. Treat as transitional until vendor publishes a V6 canonical. V6 customers preferring a single-version dep tree should use the In-code path.
|
|
451
|
+
>
|
|
452
|
+
> The recipe below is identical to what `cometchat-android-v5-core` §"Visual Builder integration" prescribes (both reference the same canonical). This page kept for V6 customers who still hit the Visually flow.
|
|
453
|
+
|
|
454
|
+
> ⚠️ **NAMESPACE WARNING (ENG-35698):** code below imports `com.cometchat.chatuikit.*` (the V5 namespace) because the Visual Builder canonical IS V5-shaped. **Do NOT copy these imports into your V6-native Compose / Kotlin Views code** — V6 Compose uses `com.cometchat.uikit.compose.*` and V6 Kotlin Views uses different module paths. The two namespaces export classes with identical short names but completely different APIs. If you're scaffolding a V6 chat surface elsewhere in the project, use the V6 paths from `cometchat-android-v6-compose-components` / `cometchat-android-v6-kotlin-components` — keep the Visual-Builder-emitted V5 `chat-uikit-android:5.+` module isolated to the screens it generates.
|
|
455
|
+
|
|
456
|
+
When the dispatcher's Step 3.1 sets `customize=visual` and the platform resolves to `android`, skills runs **`cometchat builder export --platform android`** — a single CLI command that downloads the canonical static template ZIP from `preview.cometchat.com/downloads/cometchat-builder-android.zip`, fetches the per-builder settings JSON, applies F3 + F10 missing-field defaults, and writes **3 files/dirs** to `--output` (default: `cometchat/`):
|
|
457
|
+
|
|
458
|
+
- `BuilderSettingsHelper.kt` — verbatim helper (with original `package com.cometchat.builder` declaration; **skills patches the package to the customer's app package** before final placement at `app/src/main/java/<package>/cometchat/`)
|
|
459
|
+
- `cometchat-builder-settings.json` — **envelope-shape JSON** `{ builderId, name, settings: {...} }` (no sentinel — JSON forbids `//` comments)
|
|
460
|
+
- `font/` — 12 font files (Arial / Inter / Roboto / Times — regular/medium/bold), moved to `app/src/main/res/font/` (see the Place + patch table)
|
|
461
|
+
|
|
462
|
+
### 1. Run `cometchat builder export`
|
|
463
|
+
|
|
464
|
+
```bash
|
|
465
|
+
cometchat builder export --platform android --json
|
|
466
|
+
```
|
|
467
|
+
|
|
468
|
+
Defaults to `--output cometchat/`. The CLI emits the helper with the original `com.cometchat.builder` package declaration. **You must then move the files** to the customer's project + rewrite the package, per the table below:
|
|
469
|
+
|
|
470
|
+
### 2. Place + patch (after `builder export`)
|
|
471
|
+
|
|
472
|
+
| Source (from `--output`) | Destination | Notes |
|
|
473
|
+
|---|---|---|
|
|
474
|
+
| `cometchat/cometchat-builder-settings.json` | `app/cometchat-builder-settings.json` | Move to app module root (sibling of `build.gradle.kts`). The Gradle plugin requires the envelope shape — already provided by the CLI. |
|
|
475
|
+
| `cometchat/BuilderSettingsHelper.kt` | `app/src/main/java/<customer-package>/cometchat/BuilderSettingsHelper.kt` | **Move + 3 transforms** — see F50/F51 below. |
|
|
476
|
+
| `cometchat/font/*` | `app/src/main/res/font/*` | 12 font files (Arial / Inter / Roboto / Times — regular/medium/bold). Auto-emitted by `builder export --platform android` since F48 (2026-05-22). Just move them. |
|
|
477
|
+
| (skills-emitted, not from ZIP) | `app/src/main/java/<customer-package>/cometchat/MessagesActivity.kt` | **DEFAULT — Views/viewBinding `AppCompatActivity`** mirroring the canonical builder repo's `MessagesActivity` (which is pure Views, **zero Compose**). Mounts the kit's `CometChatMessageHeader` / `CometChatMessageList` / `CometChatMessageComposer` via viewBinding and applies `BuilderSettingsHelper.applySettingsTo*` to each. This is the canonical-matching surface — see "The default surface (Views)" below. |
|
|
478
|
+
|
|
479
|
+
#### F50 + F51 — BuilderSettingsHelper.kt requires 3 transforms on move (NON-NEGOTIABLE)
|
|
480
|
+
|
|
481
|
+
After moving `cometchat/BuilderSettingsHelper.kt` to
|
|
482
|
+
`app/src/main/java/<customer-package>/cometchat/BuilderSettingsHelper.kt`,
|
|
483
|
+
the file needs these 3 transforms before it compiles:
|
|
484
|
+
|
|
485
|
+
**1. Rewrite the package line:**
|
|
486
|
+
|
|
487
|
+
```kotlin
|
|
488
|
+
package com.cometchat.builder // before
|
|
489
|
+
package com.example.myapp.cometchat // after (match customer's applicationId + .cometchat suffix)
|
|
490
|
+
```
|
|
491
|
+
|
|
492
|
+
**2. Add 3 explicit imports** under the existing import block:
|
|
493
|
+
|
|
494
|
+
```kotlin
|
|
495
|
+
import com.cometchat.builder.CometChatBuilderSettings // auto-generated constants class — stays at original package
|
|
496
|
+
import com.example.myapp.BuildConfig // customer's BuildConfig — must use their applicationId
|
|
497
|
+
import com.example.myapp.R // customer's R class — same applicationId
|
|
498
|
+
```
|
|
499
|
+
|
|
500
|
+
Without these, the file fails to compile with `Unresolved reference 'R'`, `Unresolved reference 'BuildConfig'`, `Unresolved reference 'CometChatBuilderSettings'`. (When the file was in the original `com.cometchat.builder` package, these resolved implicitly via same-package; after the rewrite, they need explicit imports.)
|
|
501
|
+
|
|
502
|
+
**3. Strip the entire `applySettingsToBottomNavigationView` method** (per README option 2 — skills doesn't emit the bottom-nav shape). The method references `R.id.nav_chats`, `R.id.nav_calls`, `R.id.nav_users`, `R.id.nav_groups` which don't exist in the customer's `res/menu/`. Removing the method removes the references.
|
|
503
|
+
|
|
504
|
+
```kotlin
|
|
505
|
+
// Delete the entire function from `fun applySettingsToBottomNavigationView(...)` to its closing `}` —
|
|
506
|
+
// roughly lines 27-54 in the canonical file. Leave a comment in its place so future readers
|
|
507
|
+
// understand why:
|
|
508
|
+
//
|
|
509
|
+
// // applySettingsToBottomNavigationView removed per cometchat-android-v6-core
|
|
510
|
+
// // SKILL.md (README option 2 — no bottom-nav module in app integration).
|
|
511
|
+
```
|
|
512
|
+
|
|
513
|
+
Validated on a fresh builder-demo Android app (2026-05-25) — after all 3 transforms, `./gradlew :app:assembleDebug` → `BUILD SUCCESSFUL in 6s`. F50 + F51 findings.
|
|
514
|
+
|
|
515
|
+
The Gradle plugin REQUIRES the `{ builderId, settings: {...} }` envelope — writing the raw settings blob produces an empty `CometChatBuilderSettings` constants class and Kotlin compile fails with `Unresolved reference 'ChatFeatures'` / `'CallFeatures'`. The CLI always writes the envelope shape.
|
|
516
|
+
|
|
517
|
+
Resync = re-run `cometchat builder export --platform android --force`. Re-apply the move+package-rewrite each time (Skills should automate this in a future release).
|
|
518
|
+
|
|
519
|
+
### Files patched
|
|
520
|
+
|
|
521
|
+
| Path | Patch |
|
|
522
|
+
|---|---|
|
|
523
|
+
| `settings.gradle.kts` | Add `maven("https://dl.cloudsmith.io/public/cometchat/cometchat/maven/")` to BOTH `pluginManagement.repositories` AND `dependencyResolutionManagement.repositories` |
|
|
524
|
+
| `app/build.gradle.kts` | Add `id("com.cometchat.builder.settings") version "5.0.1"` to the `plugins { }` block. Add `implementation("com.cometchat:chat-uikit-android:5.2.6")` (the version the canonical builder app pins). Add `implementation("com.cometchat:calls-sdk-android:4.3.1")` if `cometchat-builder-settings.json` has any call feature enabled |
|
|
525
|
+
| `gradle.properties` | `android.useAndroidX=true` + `android.enableJetifier=true` per §1.3a (non-negotiable) |
|
|
526
|
+
| `AndroidManifest.xml` | Set `android:theme="@style/CometChat.Builder.Theme"` on `<application>`. Add `RECORD_AUDIO` + `CAMERA` permissions if any `CallFeatures.*` flag is true. **Do NOT hand-author that style** — the `generateBuilderThemeXml` Gradle task auto-writes `res/values/themes.xml` + `res/values-night/themes.xml` (defining `CometChat.Builder.Theme`) into the host module at build time; you only *reference* it here (authoring your own collides with the generated file). Verified live 2026-06-14. |
|
|
527
|
+
| `Application` subclass | Call `CometChatUIKit.init(this, uiKitSettings)` in `onCreate()` per §2 — credentials from `BuildConfig.COMETCHAT_*` via §1.4 |
|
|
528
|
+
|
|
529
|
+
### Init flow (build-time + runtime)
|
|
530
|
+
|
|
531
|
+
**Build time** — the Gradle plugin:
|
|
532
|
+
1. Reads `app/cometchat-builder-settings.json`
|
|
533
|
+
2. Generates `com.cometchat.builder.CometChatBuilderSettings` (typed Kotlin constants: `ChatFeatures.CoreMessagingExperience.PHOTOSSHARING`, `Style.Color.BRANDCOLOR`, etc.)
|
|
534
|
+
3. Injects style values into `@style/CometChat.Builder.Theme` so the kit's `CometChatTheme` resolves builder tokens automatically
|
|
535
|
+
|
|
536
|
+
**Runtime** — customer code accesses both:
|
|
537
|
+
```kotlin
|
|
538
|
+
import com.cometchat.builder.CometChatBuilderSettings // generated by plugin
|
|
539
|
+
import <package>.cometchat.BuilderSettingsHelper // copied helper
|
|
540
|
+
|
|
541
|
+
if (CometChatBuilderSettings.ChatFeatures.CoreMessagingExperience.PHOTOSSHARING) {
|
|
542
|
+
// photo attachment enabled
|
|
543
|
+
}
|
|
544
|
+
BuilderSettingsHelper.applySettingsToMessageList(binding.messageList)
|
|
545
|
+
```
|
|
546
|
+
|
|
547
|
+
### The default surface (Views) — matches the canonical builder repo
|
|
548
|
+
|
|
549
|
+
The canonical builder repo (`chat-builder/` inside the Android Visual Builder ZIP) is **pure Views** — viewBinding + Activities/Fragments, **zero Compose**. Its `MessagesActivity` extends `AppCompatActivity`, inflates a viewBinding layout, sets `user`/`group` on the kit's View components, and calls `BuilderSettingsHelper.applySettingsTo*` on each. The default surface skills emits mirrors that shape so it drops into a Views-only host with no Compose build setup.
|
|
550
|
+
|
|
551
|
+
```kotlin
|
|
552
|
+
// app/src/main/java/<package>/cometchat/MessagesActivity.kt
|
|
553
|
+
package <package>.cometchat
|
|
554
|
+
|
|
555
|
+
import android.os.Bundle
|
|
556
|
+
import androidx.appcompat.app.AppCompatActivity
|
|
557
|
+
import com.cometchat.builder.BuilderSettingsHelper // copied helper — stays at original package
|
|
558
|
+
import com.cometchat.chat.models.Group
|
|
559
|
+
import com.cometchat.chat.models.User
|
|
560
|
+
import <package>.databinding.ActivityMessagesBinding // viewBinding for your layout
|
|
561
|
+
|
|
562
|
+
/**
|
|
563
|
+
* Views/viewBinding chat surface for the Visual Builder Visually path —
|
|
564
|
+
* mirrors the canonical builder repo's MessagesActivity (pure Views, no Compose).
|
|
565
|
+
*
|
|
566
|
+
* CometChatUIKit.init(...) must have been called in Application.onCreate()
|
|
567
|
+
* BEFORE this Activity launches — see §2.
|
|
568
|
+
*
|
|
569
|
+
* The layout (activity_messages.xml) hosts, top-to-bottom:
|
|
570
|
+
* <com.cometchat.chatuikit.messageheader.CometChatMessageHeader android:id="@+id/messageHeader" .../>
|
|
571
|
+
* <com.cometchat.chatuikit.messagelist.CometChatMessageList android:id="@+id/messageList" .../> (weight=1)
|
|
572
|
+
* <com.cometchat.chatuikit.messagecomposer.CometChatMessageComposer android:id="@+id/messageComposer" .../>
|
|
573
|
+
*/
|
|
574
|
+
class MessagesActivity : AppCompatActivity() {
|
|
575
|
+
private lateinit var binding: ActivityMessagesBinding
|
|
576
|
+
private var user: User? = null
|
|
577
|
+
private var group: Group? = null
|
|
578
|
+
|
|
579
|
+
override fun onCreate(savedInstanceState: Bundle?) {
|
|
580
|
+
super.onCreate(savedInstanceState)
|
|
581
|
+
binding = ActivityMessagesBinding.inflate(layoutInflater)
|
|
582
|
+
setContentView(binding.root)
|
|
583
|
+
|
|
584
|
+
// Deserialize the selected user/group from the launching Intent
|
|
585
|
+
// (see the builder repo's MessagesActivity for the Gson/JSON pattern).
|
|
586
|
+
|
|
587
|
+
if (user != null) {
|
|
588
|
+
binding.messageHeader.user = user!!
|
|
589
|
+
binding.messageList.user = user
|
|
590
|
+
binding.messageComposer.user = user
|
|
591
|
+
} else if (group != null) {
|
|
592
|
+
binding.messageHeader.group = group!!
|
|
593
|
+
binding.messageList.group = group
|
|
594
|
+
binding.messageComposer.group = group
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
binding.messageHeader.setOnBackButtonPressed { finish() }
|
|
598
|
+
|
|
599
|
+
// Apply builder settings to each component (verbatim helper from the repo)
|
|
600
|
+
BuilderSettingsHelper.applySettingsToMessageHeader(binding.messageHeader)
|
|
601
|
+
BuilderSettingsHelper.applySettingsToMessageList(binding.messageList)
|
|
602
|
+
BuilderSettingsHelper.applySettingsToMessageComposer(binding.messageComposer)
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
```
|
|
606
|
+
|
|
607
|
+
A `CometChatConversations` list (gated by `BuilderSettingsHelper.applySettingsToConversations(...)`) lives in its own Fragment/Activity that launches `MessagesActivity` on item click — again mirroring the repo's `ChatsFragment` → `MessagesActivity` flow.
|
|
608
|
+
|
|
609
|
+
`BuilderSettingsHelper.kt` is copied verbatim from the builder repo. Methods used above:
|
|
610
|
+
- `applySettingsToConversations(...)` → user-status / receipts / search-box visibility
|
|
611
|
+
- `applySettingsToMessageHeader(...)` → voice/video call buttons + user-status visibility (group vs user-aware)
|
|
612
|
+
- `applySettingsToMessageList(...)` → edit/delete/reply-in-thread/reactions/translation/conversation-starter/smart-replies/message-privately visibility
|
|
613
|
+
- `applySettingsToMessageComposer(...)` → attachment/voice-note/poll/sticker/etc. visibility
|
|
614
|
+
|
|
615
|
+
### Compose-only alternative
|
|
616
|
+
|
|
617
|
+
**Only if the host app already uses Jetpack Compose** (it has `buildFeatures { compose = true }`, the Compose BOM, and the `org.jetbrains.kotlin.plugin.compose` plugin), you may instead emit a `@Composable` wrapper that hosts the kit's View components via `AndroidView`. Do NOT emit this on a Views-only app — it won't compile without the Compose build setup, and the canonical repo is Views, not Compose.
|
|
618
|
+
|
|
619
|
+
If the host is Views-only and you (or the customer) still want the Compose wrapper, you must first add the Compose-enable patch to `app/build.gradle.kts`:
|
|
620
|
+
|
|
621
|
+
```kotlin
|
|
622
|
+
plugins {
|
|
623
|
+
// ...existing plugins...
|
|
624
|
+
id("org.jetbrains.kotlin.plugin.compose") // required for Kotlin 2.0+
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
android {
|
|
628
|
+
buildFeatures { compose = true }
|
|
629
|
+
composeOptions {
|
|
630
|
+
// omit kotlinCompilerExtensionVersion when using the Kotlin Compose plugin (2.0+)
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
dependencies {
|
|
635
|
+
val composeBom = platform("androidx.compose:compose-bom:2024.09.00")
|
|
636
|
+
implementation(composeBom)
|
|
637
|
+
implementation("androidx.compose.foundation:foundation")
|
|
638
|
+
implementation("androidx.compose.ui:ui")
|
|
639
|
+
implementation("androidx.activity:activity-compose:1.9.3")
|
|
640
|
+
}
|
|
641
|
+
```
|
|
642
|
+
|
|
643
|
+
Then the Compose wrapper:
|
|
644
|
+
|
|
645
|
+
```kotlin
|
|
646
|
+
// app/src/main/java/<package>/cometchat/CometChatApp.kt — COMPOSE-ONLY alternative
|
|
647
|
+
package <package>.cometchat
|
|
648
|
+
|
|
649
|
+
import androidx.compose.foundation.layout.Column
|
|
650
|
+
import androidx.compose.foundation.layout.fillMaxSize
|
|
651
|
+
import androidx.compose.runtime.Composable
|
|
652
|
+
import androidx.compose.runtime.getValue
|
|
653
|
+
import androidx.compose.runtime.mutableStateOf
|
|
654
|
+
import androidx.compose.runtime.remember
|
|
655
|
+
import androidx.compose.runtime.setValue
|
|
656
|
+
import androidx.compose.ui.Modifier
|
|
657
|
+
import androidx.compose.ui.viewinterop.AndroidView
|
|
658
|
+
import com.cometchat.chat.models.Group
|
|
659
|
+
import com.cometchat.chat.models.User
|
|
660
|
+
import com.cometchat.chatuikit.conversations.CometChatConversations
|
|
661
|
+
import com.cometchat.chatuikit.messagecomposer.CometChatMessageComposer
|
|
662
|
+
import com.cometchat.chatuikit.messageheader.CometChatMessageHeader
|
|
663
|
+
import com.cometchat.chatuikit.messagelist.CometChatMessageList
|
|
664
|
+
|
|
665
|
+
/**
|
|
666
|
+
* Compose-ONLY alternative to MessagesActivity above. Use this ONLY if the host
|
|
667
|
+
* app already enables Compose. Hosts the kit's View-based components via AndroidView;
|
|
668
|
+
* BuilderSettingsHelper wires CometChatBuilderSettings → component visibility.
|
|
669
|
+
*
|
|
670
|
+
* CometChatUIKit.init(...) must have been called in Application.onCreate()
|
|
671
|
+
* BEFORE this composable mounts — see §2.
|
|
672
|
+
*/
|
|
673
|
+
@Composable
|
|
674
|
+
fun CometChatApp() {
|
|
675
|
+
var selectedUser by remember { mutableStateOf<User?>(null) }
|
|
676
|
+
var selectedGroup by remember { mutableStateOf<Group?>(null) }
|
|
677
|
+
val hasSelection = selectedUser != null || selectedGroup != null
|
|
678
|
+
|
|
679
|
+
if (!hasSelection) {
|
|
680
|
+
AndroidView(
|
|
681
|
+
modifier = Modifier.fillMaxSize(),
|
|
682
|
+
factory = { ctx ->
|
|
683
|
+
CometChatConversations(ctx).apply {
|
|
684
|
+
BuilderSettingsHelper.applySettingsToConversations(this)
|
|
685
|
+
setOnItemClickListener { _, conversation ->
|
|
686
|
+
when (val entity = conversation.conversationWith) {
|
|
687
|
+
is User -> { selectedUser = entity; selectedGroup = null }
|
|
688
|
+
is Group -> { selectedUser = null; selectedGroup = entity }
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
},
|
|
693
|
+
)
|
|
694
|
+
return
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
Column(Modifier.fillMaxSize()) {
|
|
698
|
+
AndroidView(factory = { ctx ->
|
|
699
|
+
CometChatMessageHeader(ctx).apply {
|
|
700
|
+
user = selectedUser
|
|
701
|
+
group = selectedGroup
|
|
702
|
+
BuilderSettingsHelper.applySettingsToMessageHeader(this)
|
|
703
|
+
}
|
|
704
|
+
})
|
|
705
|
+
AndroidView(modifier = Modifier.weight(1f), factory = { ctx ->
|
|
706
|
+
CometChatMessageList(ctx).apply {
|
|
707
|
+
user = selectedUser
|
|
708
|
+
group = selectedGroup
|
|
709
|
+
BuilderSettingsHelper.applySettingsToMessageList(this)
|
|
710
|
+
}
|
|
711
|
+
})
|
|
712
|
+
AndroidView(factory = { ctx ->
|
|
713
|
+
CometChatMessageComposer(ctx).apply {
|
|
714
|
+
user = selectedUser
|
|
715
|
+
group = selectedGroup
|
|
716
|
+
BuilderSettingsHelper.applySettingsToMessageComposer(this)
|
|
717
|
+
}
|
|
718
|
+
})
|
|
719
|
+
}
|
|
720
|
+
}
|
|
721
|
+
```
|
|
722
|
+
|
|
723
|
+
For a Compose-native UI Kit stack (`chatuikit-compose-android` instead of `chatuikit-android` Views), skip the `AndroidView` + `BuilderSettingsHelper` indirection and read `CometChatBuilderSettings.ChatFeatures.*` constants directly into the Compose components' visibility/feature props — see `cometchat-android-v6-compose-components`. The default Views path above matches the canonical builder repo, which is Views-based.
|
|
724
|
+
|
|
725
|
+
### Calls + builder
|
|
726
|
+
|
|
727
|
+
If any `CometChatBuilderSettings.CallFeatures.*` flag is true:
|
|
728
|
+
1. Init Calls SDK in `Application.onCreate()` alongside UI Kit (see `cometchat-android-v6-calls`)
|
|
729
|
+
2. Mount `CometChatIncomingCall` overlay — the builder repo's `BuilderApplication.kt` registers `ActivityLifecycleCallbacks` and shows a `Snackbar`-hosted incoming-call view at the top of the foreground activity. Copy that pattern verbatim from `chat-builder/src/main/java/com/cometchat/builder/utils/BuilderApplication.kt` (inside the Android Visual Builder ZIP at https://preview.cometchat.com/downloads/cometchat-builder-android.zip)
|
|
730
|
+
3. FCM data-message wiring — defer to `cometchat-android-v6-push`
|
|
731
|
+
|
|
732
|
+
### What is NOT honored in v1
|
|
733
|
+
|
|
734
|
+
The builder repo's `HomeActivity` exposes a `BottomNavigationView` with up to 4 tabs (Chats / Calls / Users / Groups) driven by `CometChatBuilderSettings.Layout.TABS`. Skills emits a single conversations → `MessagesActivity` surface, not the tabbed shape. The corresponding `applySettingsToBottomNavigationView` method is also **intentionally removed** when emitting `BuilderSettingsHelper.kt` (per README option 2). Theme + typography + chat-feature toggles ARE honored. For the full tabbed shape, copy the builder repo's `HomeActivity` + per-tab fragments alongside skills' emission (or use README option 1 — "Import as module").
|
|
@@ -3,13 +3,14 @@ name: cometchat-android-v6-events
|
|
|
3
3
|
description: "CometChat Android UIKit v6 event system — SharedFlow-based reactive event bus for messages, calls, users, groups, conversations, and UI events"
|
|
4
4
|
license: "MIT"
|
|
5
5
|
compatibility: "Android 9.0+ (API 28); Kotlin 1.9+; com.cometchat:chatuikit-core-android:6.x"
|
|
6
|
-
allowed-tools: "shell, file-read, file-search, file-list"
|
|
7
6
|
metadata:
|
|
8
7
|
author: "CometChat"
|
|
9
8
|
version: "3.0.0"
|
|
10
9
|
tags: "cometchat, android, events, sharedflow, kotlin-flow, reactive"
|
|
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/ui-kit/android/v6/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
|
> **Companion skills:** cometchat-android-v6-core (init/login), cometchat-android-v6-kotlin-customization, cometchat-android-v6-compose-customization
|
|
14
15
|
|
|
15
16
|
## Purpose
|
|
@@ -175,6 +176,8 @@ All emit functions are thread-safe — they launch on `Dispatchers.Default` inte
|
|
|
175
176
|
|---|---|---|
|
|
176
177
|
| `CallAccepted` | `call: Call` | Incoming call accepted |
|
|
177
178
|
| `CallRejected` | `call: Call` | Call rejected |
|
|
179
|
+
| `CallEnded` | `call: Call` | Call ended |
|
|
180
|
+
| `OutgoingCall` | `call: Call` | Outgoing call initiated |
|
|
178
181
|
|
|
179
182
|
### 4.3 CometChatUserEvent (sealed class)
|
|
180
183
|
|
|
@@ -3,13 +3,14 @@ name: cometchat-android-v6-extensions
|
|
|
3
3
|
description: "CometChat Android UIKit v6 extension architecture — DataSource/Repository pattern, custom message types, and data-layer overrides"
|
|
4
4
|
license: "MIT"
|
|
5
5
|
compatibility: "Android 9.0+ (API 28); Kotlin 1.9+; com.cometchat:chatuikit-core-android:6.x"
|
|
6
|
-
allowed-tools: "shell, file-read, file-search, file-list"
|
|
7
6
|
metadata:
|
|
8
7
|
author: "CometChat"
|
|
9
8
|
version: "3.0.0"
|
|
10
9
|
tags: "cometchat, android, extensions, datasource, repository, clean-architecture"
|
|
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/fundamentals/extensions-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
|
> **Companion skills:** cometchat-android-v6-features (feature catalog), cometchat-android-v6-kotlin-customization, cometchat-android-v6-compose-customization
|
|
14
15
|
|
|
15
16
|
## Purpose
|
|
@@ -3,14 +3,15 @@ name: cometchat-android-v6-features
|
|
|
3
3
|
description: "CometChat Android UIKit v6 feature catalog — AI features, reactions, polls, stickers, moderation, collaborative, and media features"
|
|
4
4
|
license: "MIT"
|
|
5
5
|
compatibility: "Android 9.0+ (API 28); Kotlin 1.9+; com.cometchat:chatuikit-compose-android:6.x / com.cometchat:chatuikit-kotlin-android:6.x"
|
|
6
|
-
allowed-tools: "shell, file-read, file-search, file-list"
|
|
7
6
|
metadata:
|
|
8
7
|
author: "CometChat"
|
|
9
8
|
version: "3.0.0"
|
|
10
9
|
tags: "cometchat, android, features, ai, reactions, polls, stickers, moderation"
|
|
11
10
|
---
|
|
12
11
|
|
|
13
|
-
> **
|
|
12
|
+
> **Ground truth:** `com.cometchat:chatuikit-{compose,kotlin}-android:6.x` + `packages/registry/v6/features/catalog.json`. (Official docs linked below.) Verify symbols against the installed package/source before relying on them.
|
|
13
|
+
|
|
14
|
+
> **Companion skills:** cometchat-android-v6-kotlin-components, cometchat-android-v6-compose-components, cometchat-android-v6-extensions (DataSource pattern), cometchat-android-v6-events, **cometchat-android-v6-calls** (voice/video calling enablement — recording is a paid add-on)
|
|
14
15
|
|
|
15
16
|
## Purpose
|
|
16
17
|
|
|
@@ -27,6 +28,29 @@ Catalog of all features available in CometChat UIKit v6, how they map to compone
|
|
|
27
28
|
- Working with component APIs directly (use `cometchat-*-components`)
|
|
28
29
|
- Customizing bubble rendering (use `cometchat-*-customization`)
|
|
29
30
|
|
|
31
|
+
## 0. Feature categories — what work each needs
|
|
32
|
+
|
|
33
|
+
> **Canonical public feature-availability matrix:** [Features & Extensions Guide](https://www.cometchat.com/docs/fundamentals/features-and-extensions-guide) — the authoritative source for which integration method (UI Kit / UI Kit Builder / Widget Builder / SDK) supports each feature + dashboard setup + whether code is required. It **outranks the local `catalog.json` snapshot on conflict**; consult it (WebFetch or docs MCP) for any availability decision.
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
Before enabling anything, classify the feature by the product's 5-category "work needed" model:
|
|
37
|
+
|
|
38
|
+
| Category | Work needed | Example |
|
|
39
|
+
|---|---|---|
|
|
40
|
+
| **Core (zero-setup)** | Nothing — renders out of the box | Typing indicators, reactions |
|
|
41
|
+
| **Builder-enabled** | Dashboard API + toggle in the UI Kit Builder | Polls |
|
|
42
|
+
| **Config-only** | Dashboard API enable; works automatically | Link preview |
|
|
43
|
+
| **Config + settings** | Dashboard API + extra settings (API keys, thresholds) — no code | Smart replies (OpenAI key) |
|
|
44
|
+
| **SDK-integrated** | Dashboard API + **custom client code** | Bitly |
|
|
45
|
+
|
|
46
|
+
**Key rule:** only **SDK-integrated** features need client code — and **the implementation lives in the docs** (`cometchat features info <id> --json` shows what's needed; fetch + adapt the doc code, don't hand-roll). Everything else is enable-and-done.
|
|
47
|
+
|
|
48
|
+
**Honest-automation boundary (what the CLI can vs can't do):**
|
|
49
|
+
- **Extensions** (polls, link-preview, message-translation, reactions, etc.) → `cometchat apply-feature <id> --app-id <your-app-id>` makes the **real dashboard API call** to flip the toggle. No browser visit, no code. Never tell the user to "open the dashboard and toggle it" for an extension.
|
|
50
|
+
- **AI features** → `cometchat apply-feature <id> --app-id <X> --openai-key sk-...` (sets the key, then enables) — see §1.
|
|
51
|
+
- **Third-party dashboard-only features** (Giphy, Stipop, Tenor, Chatwoot, Intercom, Disappearing Messages, Message Shortcuts) → the CLI returns `manual-action-required` and prints the dashboard path. These need **your** third-party credentials and **cannot be automated** — state that honestly.
|
|
52
|
+
- **Calls** → see `cometchat-android-v6-calls`. **Call recording is a paid plan add-on** — there is no dashboard toggle / CLI call to enable it; the user must contact CometChat support. Never claim recording was "enabled."
|
|
53
|
+
|
|
30
54
|
## 1. AI Features
|
|
31
55
|
|
|
32
56
|
AI features need an OpenAI API key on the app's AI settings. Enable each one with the CLI in stateless mode (Android projects don't write `.cometchat/state.json`):
|