Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -1737,6 +1737,7 @@
"group": "Chat",
"pages": [
"ui-kit/android/core-features",
"ui-kit/android/offline-support",
"ui-kit/android/extensions",
"ui-kit/android/ai-features"
]
Expand Down
6 changes: 3 additions & 3 deletions ui-kit/android/calling-integration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<Tab title="Kotlin (XML Views)">
```kotlin build.gradle.kts
dependencies {
implementation("com.cometchat:chatuikit-kotlin-android:6.2.0")
implementation("com.cometchat:chatuikit-kotlin-android:6.3.0")
implementation("com.cometchat:calls-sdk-android:5.1.0")
implementation("com.cometchat:push-notifications-android:2.0.0")
implementation("com.cometchat:push-notifications-calls-android:2.0.0")
Expand All @@ -52,7 +52,7 @@
<Tab title="Jetpack Compose">
```kotlin build.gradle.kts
dependencies {
implementation("com.cometchat:chatuikit-compose-android:6.2.0")
implementation("com.cometchat:chatuikit-compose-android:6.3.0")
implementation("com.cometchat:calls-sdk-android:5.1.0")
implementation("com.cometchat:push-notifications-android:2.0.0")
implementation("com.cometchat:push-notifications-calls-android:2.0.0")
Expand All @@ -66,7 +66,7 @@
Apply the `google-services` plugin and put `google-services.json` in the app module. `minSdk` must be 28 or higher, the UI Kit's minimum.

<Warning>
**`setEnableCalling(true)` and the `calls-sdk-android` artifact are a pair.** UI Kit 6.2.0 checks for the Calls SDK during `init`: with the flag on and the artifact missing it logs `enableCalling=true but the CometChat Calls SDK is not on the classpath; skipping Calls init`, finishes chat init without calling. The calling components then fail quietly, each with its own `Calls SDK is not on the classpath` warning in logcat: Call Logs shows an empty list, the call buttons fail with `CALLS_SDK_MISSING`, and the call screen does not start. UI Kits before 6.2.0 crashed at launch with `NoClassDefFoundError` instead. The UI Kit requires `calls-sdk-android` 5.1 or newer and `push-notifications-android` / `push-notifications-calls-android` 2.0 or newer.
**`setEnableCalling(true)` and the `calls-sdk-android` artifact are a pair.** UI Kit 6.2.0 and later check for the Calls SDK during `init`: with the flag on and the artifact missing it logs `enableCalling=true but the CometChat Calls SDK is not on the classpath; skipping Calls init`, finishes chat init without calling. The calling components then fail quietly, each with its own `Calls SDK is not on the classpath` warning in logcat: Call Logs shows an empty list, the call buttons fail with `CALLS_SDK_MISSING`, and the call screen does not start. UI Kits before 6.2.0 crashed at launch with `NoClassDefFoundError` instead. The UI Kit requires `calls-sdk-android` 5.1 or newer and `push-notifications-android` / `push-notifications-calls-android` 2.0 or newer.

Check warning on line 69 in ui-kit/android/calling-integration.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/android/calling-integration.mdx#L69

Did you really mean 'classpath'?

Check warning on line 69 in ui-kit/android/calling-integration.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/android/calling-integration.mdx#L69

Did you really mean 'logcat'?
</Warning>

## Step 2: Enable calling in the UI Kit
Expand Down Expand Up @@ -111,7 +111,7 @@
Run this in `Application.onCreate` from stored credentials, not only after a screen opens. A push can start the app process to ring a call, and the answer must find a ready SDK.

<Warning>
**Enabling calling in an app that already has logged-in users requires a re-login.** `CometChatUIKit.login()` short-circuits when the same uid already has a persisted session, so the Calls SDK never logs in: the Calls SDK has no auth token and `CometChatCallLogs` shows a silent error state (logcat: `User auth token cannot be null`). After calling is first enabled, log out and log in again (`CometChatUIKit.logout(...)` then `CometChatUIKit.login(...)`), and wire `onError` on `CometChatCallLogs` during development so this failure is visible.

Check warning on line 114 in ui-kit/android/calling-integration.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/android/calling-integration.mdx#L114

Did you really mean 'uid'?

Check warning on line 114 in ui-kit/android/calling-integration.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/android/calling-integration.mdx#L114

Did you really mean 'logcat'?
</Warning>

## Step 3: Configure push ringing
Expand Down Expand Up @@ -261,7 +261,7 @@
})
```

`CometChatUIKit.logout` ends a call in progress, cancels an outgoing call still ringing, then logs out of the Chat SDK and the Calls SDK; the Push SDK stops a ring still playing for the old user and unregisters the token. `CometChat.logout` alone does none of the calling clean-up.

Check warning on line 264 in ui-kit/android/calling-integration.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/android/calling-integration.mdx#L264

Did you really mean 'unregisters'?

## What the UI Kit does from here

Expand All @@ -273,7 +273,7 @@
</Tab>

<Tab title="Jetpack Compose">
The `CometChatMessageHeader` composable hides the call buttons by default (`hideVoiceCallButton` and `hideVideoCallButton` both default to `true`). Show them explicitly:

Check warning on line 276 in ui-kit/android/calling-integration.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/android/calling-integration.mdx#L276

Did you really mean 'composable'?

```kotlin
CometChatMessageHeader(
Expand All @@ -292,8 +292,8 @@
| Moment | What happens | Component |
|--------|--------------|-----------|
| Tap a call button | `CometChatCalls.initiateCall`, then the outgoing screen opens | [Call Buttons](/ui-kit/android/call-buttons) |
| Waiting | "calling…", then "ringing…" when the callee's device is reached; End cancels the call; 45 s with no answer ends it as unanswered | [Outgoing Call](/ui-kit/android/outgoing-call) |

Check warning on line 295 in ui-kit/android/calling-integration.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/android/calling-integration.mdx#L295

Did you really mean 'callee's'?
| Callee declines / is busy / does not answer | The outgoing screen closes with the reason | Outgoing Call |

Check warning on line 296 in ui-kit/android/calling-integration.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/android/calling-integration.mdx#L296

Did you really mean 'Callee'?
| Incoming call | The Push SDK rings and draws the incoming-call screen | Push SDK (no UI Kit component) |
| Answer | Your answer activity opens `CometChatOngoingCallActivity`, which joins the session | [Ongoing Call](/ui-kit/android/ongoing-call) |
| Hang-up | The session is left; the other side's screen closes | Ongoing Call |
Expand Down Expand Up @@ -324,13 +324,13 @@
<Tab title="Kotlin (XML Views)">
```kotlin
// Reads your app's manifest theme (based on CometChatTheme.DayNight), light and dark
val uikitTheme = CometChatTheme.getIncomingCallTheme(this)

Check warning on line 327 in ui-kit/android/calling-integration.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/android/calling-integration.mdx#L327

Did you really mean 'uikitTheme'?
```
</Tab>
<Tab title="Jetpack Compose">
```kotlin
// The same colour schemes you give CometChatTheme { }
val uikitTheme = incomingCallTheme(light = lightScheme, dark = darkScheme)

Check warning on line 333 in ui-kit/android/calling-integration.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/android/calling-integration.mdx#L333

Did you really mean 'uikitTheme'?

Check warning on line 333 in ui-kit/android/calling-integration.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/android/calling-integration.mdx#L333

Did you really mean 'lightScheme'?

Check warning on line 333 in ui-kit/android/calling-integration.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/android/calling-integration.mdx#L333

Did you really mean 'darkScheme'?
```
</Tab>
</Tabs>
Expand Down Expand Up @@ -385,7 +385,7 @@

Without this line, the screen still uses the UI Kit's default colours. The UI Kit overrides the `cometchat_pn_call_*` colour resources with its light and dark palette at build time. Those overrides win over the Push SDK's defaults only when your app lists the UI Kit dependency before the Push SDK artifacts. Your app's own overrides always win.

To change a single colour, override its resource, or chain any `CometChatPNIncomingCallTheme.Colors.Builder` setter after mapping. The full list of colours, strings, drawables and the layout is under [Theming the SDK's incoming-call screen](/calls/android/voip-calling#theming-the-sdks-incoming-call-screen). To draw the screen yourself, register your own activity with `setIncomingCallActivity`, for example one that hosts the deprecated [Incoming Call](/ui-kit/android/incoming-call) component. The UI Kit's `CometChatCallActivity` does not work there: it does not read the call the Push SDK passes in its intent, so it would open empty.

Check warning on line 388 in ui-kit/android/calling-integration.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/android/calling-integration.mdx#L388

Did you really mean 'drawables'?

## Upgrading from an app that used `CometChat.addCallListener`

Expand Down
3 changes: 3 additions & 0 deletions ui-kit/android/conversations.mdx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
title: "Conversations"
description: "Scrollable list of recent one-on-one and group conversations for the logged-in user."

Check warning on line 3 in ui-kit/android/conversations.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/android/conversations.mdx#L3

Did you really mean 'Scrollable'?
---

`CometChatConversations` renders a scrollable list of recent conversations with real-time updates for new messages, typing indicators, read receipts, and user presence.

Check warning on line 6 in ui-kit/android/conversations.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/android/conversations.mdx#L6

Did you really mean 'scrollable'?

<Frame>
<img src="/images/f2c77c5b-Conversation-ac41cc6650fbb941c64f389aee910dbc.png" />
Expand Down Expand Up @@ -438,7 +438,7 @@
**Pin Conversation must be enabled for your app** through the `features.ux.conversations.pinned.enabled` app setting in the CometChat Dashboard. Until it is, the option never renders, and a direct SDK call rejects with `ERR_FEATURE_NOT_ACCESSIBLE`. The UI Kit reads that setting itself at login and on every reconnect — there is no app code to write. Read it yourself with `CometChatUIKit.isPinConversationEnabled()` when you need to gate your own entry point.
</Warning>

`setPinConversationOptionVisibility(View.GONE)` (Compose: `hidePinOption = true`) hides the option on one particular list. It is **ANDed** with that app setting, so the option renders only when both allow it.

Check warning on line 441 in ui-kit/android/conversations.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/android/conversations.mdx#L441

Did you really mean 'ANDed'?

<Tabs>
<Tab title="Kotlin (XML Views)">
Expand Down Expand Up @@ -487,6 +487,9 @@
| `setTitle("Chats")` | `title = "Chats"` | Custom toolbar title |
| `setSearchPlaceholderText("Search...")` | `searchPlaceholderText = "Search..."` | Search placeholder |
| `setPinConversationOptionVisibility(View.GONE)` | `hidePinOption = true` | Hide the built-in Pin/Unpin conversation option |
| `setHideOfflineNotices(true)` | `hideOfflineNotices = true` | Hide the offline notice toasts, such as unsent messages that were lost (default `false`). Offline support only, from v6.3.0 |

With [offline support](/ui-kit/android/offline-support#lists-conversations-users-groups-and-group-members) on, the list shows saved conversations first, and **Connect to load chats** when nothing is saved and there is no connection. A chat whose last message is your own unsent message shows a clock, or a failed icon once sending failed.

---

Expand Down
22 changes: 21 additions & 1 deletion ui-kit/android/core-features.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

| Field | Value |
| --- | --- |
| Packages | `com.cometchat:chatuikit-kotlin-android` (Kotlin XML Views), `com.cometchat:chatuikit-compose-android` (Jetpack Compose) |

Check warning on line 10 in ui-kit/android/core-features.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/android/core-features.mdx#L10

Did you really mean 'Jetpack'?
| Required setup | `CometChatUIKit.init()` then `CometChatUIKit.login()` — must complete before rendering any component |
| Core features | Instant Messaging, Media Sharing, Read Receipts, Mark as Unread, Typing Indicator, User Presence, Reactions, Mentions, Rich Text Formatting, Quoted Reply, Search, Threaded Conversations, Moderation, Report Message, Group Chat |
| Core features | Instant Messaging, Media Sharing, Read Receipts, Mark as Unread, Typing Indicator, User Presence, Reactions, Mentions, Rich Text Formatting, Quoted Reply, Search, Threaded Conversations, Moderation, Report Message, Group Chat, Offline Support |
| Key components | `CometChatConversations`, `CometChatMessageList`, `CometChatMessageComposer`, `CometChatMessageHeader`, `CometChatUsers`, `CometChatGroups`, `CometChatGroupMembers`, `CometChatMessageInformation`, `CometChatThreadHeader` |
| Theming | See [Theming](/ui-kit/android/theme-introduction) |

Expand Down Expand Up @@ -160,7 +160,7 @@
| `features.ux.messages.saved.enabled` | Whether the save options and screen render at all |
| `features.ux.messages.saved.limit` | Saved messages per user |

The UI Kit reads the feature flags at login, so no wiring is needed to show or hide the options. When a user reaches a cap, the kit shows a toast naming the limit — no extra handling required. For a full walkthrough, see the [Pin & Save Messages guide](/ui-kit/android/guide-pin-and-save-messages).

Check warning on line 163 in ui-kit/android/core-features.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/android/core-features.mdx#L163

Did you really mean 'walkthrough'?

## Pin Conversations

Expand Down Expand Up @@ -290,6 +290,26 @@
| [CometChatMessageList](/ui-kit/android/message-list) | Shows the selected message when clicked from search results and highlights it in the message list. |
| [CometChatConversations](/ui-kit/android/conversations) | Displays the search input. |

## Offline Support

*Available since v6.3.0*

Show chats the user has opened before without a connection, and queue text messages and voice notes sent offline until the connection returns. Lists show their saved rows first, unsent messages offer Retry and Delete, and every screen shows a clear "Connect to load …" state when it has nothing saved. Offline support is off by default. Turn it on in `UIKitSettings`; the code is the same for both kits:

```kotlin lines
import com.cometchat.chat.core.OfflineConfig
import com.cometchat.uikit.core.UIKitSettings

val uiKitSettings = UIKitSettings.UIKitSettingsBuilder()
.setRegion("REGION")
.setAppId("APP_ID")
.setAuthKey("AUTH_KEY")
.setOfflineConfig(OfflineConfig.Builder().enabled(true).build())
.build()
```

UI Kit 6.3.0 brings in Chat SDK 5.1.2. See [Offline Support](/ui-kit/android/offline-support) for requirements, component behaviour, texts, styling and events.

---

## Next Steps
Expand Down
14 changes: 13 additions & 1 deletion ui-kit/android/events.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
| Field | Value |
| --- | --- |
| Kotlin (XML Views) | `com.cometchat:chatuikit-kotlin-android` |
| Jetpack Compose | `com.cometchat:chatuikit-compose-android` |

Check warning on line 11 in ui-kit/android/events.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/android/events.mdx#L11

Did you really mean 'Jetpack'?
| Import | `com.cometchat.uikit.core.events.CometChatEvents` |
| Event flows | `CometChatEvents.messageEvents`, `CometChatEvents.callEvents`, `CometChatEvents.conversationEvents`, `CometChatEvents.groupEvents`, `CometChatEvents.userEvents`, `CometChatEvents.uiEvents` |
| Event flows | `CometChatEvents.messageEvents`, `CometChatEvents.callEvents`, `CometChatEvents.conversationEvents`, `CometChatEvents.groupEvents`, `CometChatEvents.userEvents`, `CometChatEvents.uiEvents`, `CometChatEvents.offlineEvents` (offline support only) |
| Pattern | Kotlin `SharedFlow` with sealed class event types — collect in `viewModelScope` or `lifecycleScope` |
| Purpose | Decoupled communication between UI Kit components — subscribe to event flows to react to changes without direct component references |

Expand Down Expand Up @@ -51,6 +51,7 @@
| `CometChatEvents.userEvents` | `UserEvent` | User blocked, unblocked |
| `CometChatEvents.uiEvents` | `UIEvent` | Panel visibility, active chat changes |
| `CometChatEvents.threadEvents` | `CometChatThreadEvent` | Thread subscription state changes |
| `CometChatEvents.offlineEvents` | `CometChatOfflineEvent` | Own message send state changes and offline cache resets. Only with [offline support](/ui-kit/android/offline-support#offline-events) on |

## API reference

Expand All @@ -71,14 +72,14 @@
| `CometChatMessageEvent.MessagePinned(message)` | Triggered when a message is pinned. |
| `CometChatMessageEvent.MessageUnpinned(message)` | Triggered when a message is unpinned. |
| `CometChatMessageEvent.MessageSaved(message)` | Triggered when the logged-in user saves a message. |
| `CometChatMessageEvent.MessageUnsaved(message)` | Triggered when the logged-in user unsaves a message. |

Check warning on line 75 in ui-kit/android/events.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/android/events.mdx#L75

Did you really mean 'unsaves'?

**Collecting events:**

<Tabs>
<Tab title="Kotlin (XML Views)">
```kotlin
// In an Activity or Fragment — use lifecycleScope

Check warning on line 82 in ui-kit/android/events.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/android/events.mdx#L82

'lifecycleScope' is repeated!

Check warning on line 82 in ui-kit/android/events.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/android/events.mdx#L82

Did you really mean 'lifecycleScope'?
lifecycleScope.launch {
CometChatEvents.messageEvents.collect { event ->
when (event) {
Expand Down Expand Up @@ -155,7 +156,7 @@

### Thread Events

`CometChatEvents.threadEvents` emits `CometChatThreadEvent` instances when the logged-in user subscribes to or unsubscribes from a message thread, so every surface showing a subscription control can stay in sync without a refetch.

Check warning on line 159 in ui-kit/android/events.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/android/events.mdx#L159

Did you really mean 'refetch'?

Every event on this bus is published by the UI Kit itself — the Chat SDK has no thread listener, and a `subscribeToThread()` / `unsubscribeFromThread()` callback *is* the acknowledgement. Because surfaces do not share message instances, a handler should update its own state **and** stamp the flag onto the message objects it holds with `BaseMessage.setThreadSubscribed()`.

Expand Down Expand Up @@ -183,6 +184,17 @@

See [Threaded Messages → Thread Subscription](/ui-kit/android/guide-threaded-messages#thread-subscription) for the feature end to end.

### Offline Events

`CometChatEvents.offlineEvents` emits `CometChatOfflineEvent` instances while [offline support](/ui-kit/android/offline-support) is on. It never emits while offline support is off.

| Event | Description |
| ----- | ----------- |
| `CometChatOfflineEvent.MessageSendStateChanged(message, state, reason)` | One of your own messages moved to `SENDING`, `SENT` or `FAILED`. `reason` is the Chat SDK's `MessageFailureReason` when it failed. |
| `CometChatOfflineEvent.OfflineCacheReset(reason, pendingMessagesLost)` | The Chat SDK reset its offline cache. `pendingMessagesLost` is `-1` when the number is unknown. |

See [Offline events](/ui-kit/android/offline-support#offline-events) for a collection example in both kits.

### Call Events

`CometChatEvents.callEvents` emits `CallEvent` sealed class instances for call lifecycle changes.
Expand Down Expand Up @@ -543,7 +555,7 @@
</Tab>
</Tabs>

> **About `CardActionClicked`:** The UI Kit renders card bubbles automatically (`CometChatCardBubble`) and emits this event when a user taps an action inside one — so a single subscriber handles every card action across your app. `event.message` is a `CardMessage` for standalone [card messages](/sdk/android/v5/send-message#card-message) and an `AIAssistantMessage` for cards embedded in AI agent replies. `event.actionEvent` is typed `Any`; import and cast it to `com.cometchat.cards.actions.CometChatCardActionEvent` to read its `action`, `elementId`, and `cardJson`.

Check warning on line 558 in ui-kit/android/events.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/android/events.mdx#L558

Did you really mean 'elementId'?

Check warning on line 558 in ui-kit/android/events.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/android/events.mdx#L558

Did you really mean 'cardJson'?

---

Expand All @@ -551,8 +563,8 @@

Since `SharedFlow` collection is coroutine-based, lifecycle management is handled automatically:

- In XML Views, use `lifecycleScope.launch` — the coroutine is cancelled when the lifecycle owner is destroyed.

Check warning on line 566 in ui-kit/android/events.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/android/events.mdx#L566

Did you really mean 'coroutine'?
- In Jetpack Compose, use `LaunchedEffect` — the coroutine is cancelled when the composable leaves the composition.

Check warning on line 567 in ui-kit/android/events.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/android/events.mdx#L567

Did you really mean 'Jetpack'?

Check warning on line 567 in ui-kit/android/events.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/android/events.mdx#L567

Did you really mean 'coroutine'?

Check warning on line 567 in ui-kit/android/events.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/android/events.mdx#L567

Did you really mean 'composable'?

No manual `removeListener` calls are needed, unlike the old static listener pattern.

Expand Down
11 changes: 8 additions & 3 deletions ui-kit/android/getting-started-jetpack.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: "Getting Started With Jetpack Compose UI Kit"

Check warning on line 2 in ui-kit/android/getting-started-jetpack.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/android/getting-started-jetpack.mdx#L2

Did you really mean 'Jetpack'?
sidebarTitle: "Jetpack Compose"
description: "Step-by-step guide to integrate the CometChat Jetpack Compose UI Kit into your Android app."

Check warning on line 4 in ui-kit/android/getting-started-jetpack.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/android/getting-started-jetpack.mdx#L4

Did you really mean 'Jetpack'?
---

<Accordion title="AI Integration Quick Reference">
Expand All @@ -9,17 +9,18 @@
| Field | Value |
| --- | --- |
| Package | `com.cometchat:chatuikit-compose-android` |
| UI Layer | Jetpack Compose (Material 3) |

Check warning on line 12 in ui-kit/android/getting-started-jetpack.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/android/getting-started-jetpack.mdx#L12

Did you really mean 'Jetpack'?
| Init | `CometChatUIKit.init(context, UIKitSettings, callback)` — must resolve before `login()` |
| Login | `CometChatUIKit.login("UID", callback)` — must resolve before rendering components |
| Order | `init()` → `login()` → render. Breaking this order = blank screen |
| Auth Key | Dev/testing only. Use Auth Token in production |
| Calling | Optional. `setEnableCalling(true)` in `UIKitSettings` + push ringing setup. Your app adds `com.cometchat:calls-sdk-android` (the UI Kit does not bundle it); push ringing adds the Push Notifications SDK and Firebase Messaging |
| Min SDK | Android 9.0 (API 28) |
| Offline support | Optional, off by default, from UI Kit 6.3.0. `setOfflineConfig(OfflineConfig)` on the `UIKitSettings` builder before `build()`. See [Offline Support](/ui-kit/android/offline-support) |

</Accordion>

This guide walks you through integrating the CometChat Jetpack Compose UI Kit into an Android app. All UI components are native Compose composables built with Material 3. By the end you'll have a working chat UI.

Check warning on line 23 in ui-kit/android/getting-started-jetpack.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/android/getting-started-jetpack.mdx#L23

Did you really mean 'Jetpack'?

Check warning on line 23 in ui-kit/android/getting-started-jetpack.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/android/getting-started-jetpack.mdx#L23

Did you really mean 'composables'?

---

Expand All @@ -38,7 +39,7 @@
- An Android emulator or physical device running Android 9.0 (API 28) or higher
- `compileSdk = 36` (or newer) in your app module — the UI Kit's transitive `androidx.core:core-ktx:1.18.0` requires it; a `compileSdk`-35 app fails `checkDebugAarMetadata` with an AAR-metadata error
- Kotlin configured with Compose compiler plugin
- Android Gradle Plugin 8.9.1+ or 9.x with Kotlin DSL — 8.9.1 is the first AGP that supports `compileSdk 36` (see the AGP note in Step 2)

Check warning on line 42 in ui-kit/android/getting-started-jetpack.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/android/getting-started-jetpack.mdx#L42

Did you really mean 'Gradle'?

<Warning>
Auth Key is for development only. In production, generate Auth Tokens server-side via the [REST API](https://api-explorer.cometchat.com/) and use `loginWithAuthToken()`. Never ship Auth Keys in client code.
Expand All @@ -48,7 +49,7 @@


<Note>
**Calling.** Set `enableCalling` to `true` to turn on voice and video calling; the UI Kit then initialises the Calls SDK and logs the user into it. The UI Kit does not bundle the Calls SDK: add `com.cometchat:calls-sdk-android:5.1.0` to your app. With the flag on and the artifact missing, UI Kit 6.2.0 logs a warning at `init`, skips the Calls SDK, and the calling components fail quietly (empty call logs, call buttons failing with `CALLS_SDK_MISSING`, no call screen); UI Kits before 6.2.0 crashed at launch. Incoming calls ring through the Push Notifications SDK, which your app adds along with Firebase Messaging when it sets up push ringing. See [Calling Integration](/ui-kit/android/calling-integration). Leave the flag `false` in an app that does not use calling.
**Calling.** Set `enableCalling` to `true` to turn on voice and video calling; the UI Kit then initialises the Calls SDK and logs the user into it. The UI Kit does not bundle the Calls SDK: add `com.cometchat:calls-sdk-android:5.1.0` to your app. With the flag on and the artifact missing, UI Kit 6.2.0 and later log a warning at `init`, skips the Calls SDK, and the calling components fail quietly (empty call logs, call buttons failing with `CALLS_SDK_MISSING`, no call screen); UI Kits before 6.2.0 crashed at launch. Incoming calls ring through the Push Notifications SDK, which your app adds along with Firebase Messaging when it sets up push ringing. See [Calling Integration](/ui-kit/android/calling-integration). Leave the flag `false` in an app that does not use calling.
</Note>

## Step 1 — Create an Android Project
Expand Down Expand Up @@ -116,7 +117,7 @@
implementation("androidx.compose.material3:material3")

// CometChat Jetpack Compose UI Kit
implementation("com.cometchat:chatuikit-compose-android:6.2.0")
implementation("com.cometchat:chatuikit-compose-android:6.3.0")
// Voice/video calling: the UI Kit does not bundle the Calls SDK, so add it here. Incoming
// calls ring through the Push Notifications SDK and Firebase Messaging, added in Calling Integration.
implementation("com.cometchat:calls-sdk-android:5.1.0")
Expand All @@ -124,11 +125,11 @@
```

<Note>
**Android Gradle Plugin 9 has built-in Kotlin.** Don't apply `org.jetbrains.kotlin.android` (`alias(libs.plugins.kotlin.android)`) on AGP 9 — the build fails with `The 'org.jetbrains.kotlin.android' plugin is no longer required for Kotlin support since AGP 9.0`. On **AGP 8.x**, add `alias(libs.plugins.kotlin.android)` to the `plugins` block. The `kotlin { compilerOptions { ... } }` block works on both; the older `kotlinOptions { jvmTarget = "11" }` block is an error since Kotlin Gradle plugin 2.2.0, and on AGP 9 it fails with `Unresolved reference 'kotlinOptions'`.

Check warning on line 128 in ui-kit/android/getting-started-jetpack.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/android/getting-started-jetpack.mdx#L128

Did you really mean 'Gradle'?

Check warning on line 128 in ui-kit/android/getting-started-jetpack.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/android/getting-started-jetpack.mdx#L128

Did you really mean 'Gradle'?
</Note>

<Warning>
**Don't force Compose 1.7.** `chatuikit-compose-android` 6.2.0 calls a Compose 1.8 `LazyColumn` API. Its POM declares compose-bom 2024.09.00 (Compose 1.7), but its `cards-android` 1.0.0 dependency brings compose-bom 2025.04.01, so a normal build resolves Compose 1.8 and works. If you force Compose 1.7 — a `strictly` version constraint, an `enforcedPlatform(...)` BOM older than 2025.04.01, or a resolution strategy — the app builds, then crashes with `NoSuchMethodError: ... LazyColumn(...)` when `CometChatConversations` first renders. Keep the app's BOM at 2025.04.01 or newer, as above.
**Don't force Compose 1.7.** `chatuikit-compose-android` 6.2.0 and later call a Compose 1.8 `LazyColumn` API. Its POM declares compose-bom 2024.09.00 (Compose 1.7), but its `cards-android` 1.0.0 dependency brings compose-bom 2025.04.01, so a normal build resolves Compose 1.8 and works. If you force Compose 1.7 — a `strictly` version constraint, an `enforcedPlatform(...)` BOM older than 2025.04.01, or a resolution strategy — the app builds, then crashes with `NoSuchMethodError: ... LazyColumn(...)` when `CometChatConversations` first renders. Keep the app's BOM at 2025.04.01 or newer, as above.
</Warning>

---
Expand All @@ -136,7 +137,7 @@
<Warning>
**Required dependency exclude.** The UI Kit pulls `io.noties:prism4j`, which brings
`org.jetbrains:annotations-java5:17.0.0`. That duplicates `org.jetbrains:annotations:23.0.0` from
AndroidX/Kotlin and the build fails at dexing with ~40 `Duplicate class org.jetbrains.annotations.*`

Check warning on line 140 in ui-kit/android/getting-started-jetpack.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/android/getting-started-jetpack.mdx#L140

Did you really mean 'dexing'?
errors. Add this to your app module:

```kotlin
Expand Down Expand Up @@ -242,6 +243,10 @@
`init()` must resolve before you call `login()`. Calling `login()` before init completes will fail silently.
</Warning>

<Tip>
To let users open saved chats and queue messages without a connection, add `.setOfflineConfig(OfflineConfig.Builder().enabled(true).build())` to the `UIKitSettings` builder before `.build()`. Offline support is off by default and is available from UI Kit 6.3.0. See [Offline Support](/ui-kit/android/offline-support).
</Tip>

---

## Step 4 — Choose a Chat Experience
Expand All @@ -253,7 +258,7 @@
Sequential navigation — conversation list as the entry point, tap a conversation to open a full-screen message view.

<Card title="Build Conversation List + Message View" href="/ui-kit/android/conversation-message-view" icon="comments">
Step-by-step guide to build this layout with Jetpack Compose

Check warning on line 261 in ui-kit/android/getting-started-jetpack.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/android/getting-started-jetpack.mdx#L261

Did you really mean 'Jetpack'?
</Card>

---
Expand Down
11 changes: 8 additions & 3 deletions ui-kit/android/getting-started-kotlin.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
| Auth Key | Dev/testing only. Use Auth Token in production |
| Calling | Optional. `setEnableCalling(true)` in `UIKitSettings` + push ringing setup. Your app adds `com.cometchat:calls-sdk-android` (the UI Kit does not bundle it); push ringing adds the Push Notifications SDK and Firebase Messaging |
| Min SDK | Android 9.0 (API 28) |
| Offline support | Optional, off by default, from UI Kit 6.3.0. `setOfflineConfig(OfflineConfig)` on the `UIKitSettings` builder before `build()`. See [Offline Support](/ui-kit/android/offline-support) |

</Accordion>

Expand All @@ -38,7 +39,7 @@
- An Android emulator or physical device running Android 9.0 (API 28) or higher
- `compileSdk = 36` (or newer) in your app module — the UI Kit's transitive `androidx.core:core-ktx:1.18.0` requires it; a `compileSdk`-35 app fails `checkDebugAarMetadata` with an AAR-metadata error
- Kotlin configured in your project
- Android Gradle Plugin 8.9.1+ or 9.x with Kotlin DSL — 8.9.1 is the first AGP that supports `compileSdk 36` (see the AGP note in Step 2)

Check warning on line 42 in ui-kit/android/getting-started-kotlin.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/android/getting-started-kotlin.mdx#L42

Did you really mean 'Gradle'?

<Warning>
Auth Key is for development only. In production, generate Auth Tokens server-side via the [REST API](https://api-explorer.cometchat.com/) and use `loginWithAuthToken()`. Never ship Auth Keys in client code.
Expand All @@ -48,7 +49,7 @@


<Note>
**Calling.** Set `enableCalling` to `true` to turn on voice and video calling; the UI Kit then initialises the Calls SDK and logs the user into it. The UI Kit does not bundle the Calls SDK: add `com.cometchat:calls-sdk-android:5.1.0` to your app. With the flag on and the artifact missing, UI Kit 6.2.0 logs a warning at `init`, skips the Calls SDK, and the calling components fail quietly (empty call logs, call buttons failing with `CALLS_SDK_MISSING`, no call screen); UI Kits before 6.2.0 crashed at launch. Incoming calls ring through the Push Notifications SDK, which your app adds along with Firebase Messaging when it sets up push ringing. See [Calling Integration](/ui-kit/android/calling-integration). Leave the flag `false` in an app that does not use calling.
**Calling.** Set `enableCalling` to `true` to turn on voice and video calling; the UI Kit then initialises the Calls SDK and logs the user into it. The UI Kit does not bundle the Calls SDK: add `com.cometchat:calls-sdk-android:5.1.0` to your app. With the flag on and the artifact missing, UI Kit 6.2.0 and later log a warning at `init`, skips the Calls SDK, and the calling components fail quietly (empty call logs, call buttons failing with `CALLS_SDK_MISSING`, no call screen); UI Kits before 6.2.0 crashed at launch. Incoming calls ring through the Push Notifications SDK, which your app adds along with Firebase Messaging when it sets up push ringing. See [Calling Integration](/ui-kit/android/calling-integration). Leave the flag `false` in an app that does not use calling.
</Note>

## Step 1 — Create an Android Project
Expand Down Expand Up @@ -112,7 +113,7 @@

dependencies {
// CometChat Kotlin UI Kit
implementation("com.cometchat:chatuikit-kotlin-android:6.2.0")
implementation("com.cometchat:chatuikit-kotlin-android:6.3.0")
// Voice/video calling: the UI Kit does not bundle the Calls SDK, so add it here. Incoming
// calls ring through the Push Notifications SDK and Firebase Messaging, added in Calling Integration.
implementation("com.cometchat:calls-sdk-android:5.1.0")
Expand All @@ -120,12 +121,12 @@
```

<Note>
**Android Gradle Plugin 9 has built-in Kotlin.** Don't apply `org.jetbrains.kotlin.android` (`alias(libs.plugins.kotlin.android)`) on AGP 9 — the build fails with `The 'org.jetbrains.kotlin.android' plugin is no longer required for Kotlin support since AGP 9.0`. On **AGP 8.x**, add `alias(libs.plugins.kotlin.android)` to the `plugins` block. The `kotlin { compilerOptions { ... } }` block works on both; the older `kotlinOptions { jvmTarget = "11" }` block is an error since Kotlin Gradle plugin 2.2.0, and on AGP 9 it fails with `Unresolved reference 'kotlinOptions'`.

Check warning on line 124 in ui-kit/android/getting-started-kotlin.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/android/getting-started-kotlin.mdx#L124

Did you really mean 'Gradle'?

Check warning on line 124 in ui-kit/android/getting-started-kotlin.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/android/getting-started-kotlin.mdx#L124

Did you really mean 'Gradle'?
</Note>

### Add AndroidX Support

UI Kit 6.2.0 builds without Jetifier, so you don't need `android.enableJetifier`. Set it in `gradle.properties` only if another dependency of yours still uses the legacy support libraries; AGP 9 deprecates it and logs a warning:
UI Kit 6.2.0 and later build without Jetifier, so you don't need `android.enableJetifier`. Set it in `gradle.properties` only if another dependency of yours still uses the legacy support libraries; AGP 9 deprecates it and logs a warning:

Check warning on line 129 in ui-kit/android/getting-started-kotlin.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/android/getting-started-kotlin.mdx#L129

Did you really mean 'Jetifier'?

```properties gradle.properties
android.enableJetifier=true
Expand All @@ -136,7 +137,7 @@
<Warning>
**Required dependency exclude.** The UI Kit pulls `io.noties:prism4j`, which brings
`org.jetbrains:annotations-java5:17.0.0`. That duplicates `org.jetbrains:annotations:23.0.0` from
AndroidX/Kotlin and the build fails at dexing with ~40 `Duplicate class org.jetbrains.annotations.*`

Check warning on line 140 in ui-kit/android/getting-started-kotlin.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/android/getting-started-kotlin.mdx#L140

Did you really mean 'dexing'?
errors. Add this to your app module:

```kotlin
Expand All @@ -150,7 +151,7 @@
**Required app theme.** The UI Kit's views are Material components, so on a non-Material theme the
first CometChat view you inflate throws `IllegalArgumentException: The style on this component
requires your app theme to be Theme.MaterialComponents (or a descendant)` — the app crashes on the
chat screen rather than rendering it unstyled. Inherit the kit's theme, which already descends from

Check warning on line 154 in ui-kit/android/getting-started-kotlin.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cometchat-22654f5b) - vale-spellcheck

ui-kit/android/getting-started-kotlin.mdx#L154

Did you really mean 'unstyled'?
Material:

```xml res/values/themes.xml
Expand Down Expand Up @@ -229,6 +230,10 @@
`init()` must resolve before you call `login()`. Calling `login()` before init completes will fail silently.
</Warning>

<Tip>
To let users open saved chats and queue messages without a connection, add `.setOfflineConfig(OfflineConfig.Builder().enabled(true).build())` to the `UIKitSettings` builder before `.build()`. Offline support is off by default and is available from UI Kit 6.3.0. See [Offline Support](/ui-kit/android/offline-support).
</Tip>

---

## Step 4 — Choose a Chat Experience
Expand Down
Loading