diff --git a/docs.json b/docs.json
index 58788a8cd..d995a7837 100644
--- a/docs.json
+++ b/docs.json
@@ -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"
]
diff --git a/sdk/android/v5/additional-message-filtering.mdx b/sdk/android/v5/additional-message-filtering.mdx
index 6dccfc3ce..2ab72b977 100644
--- a/sdk/android/v5/additional-message-filtering.mdx
+++ b/sdk/android/v5/additional-message-filtering.mdx
@@ -1401,7 +1401,11 @@ With offline support enabled, `fetchPrevious`/`fetchNext` answer from the on-dev
| `setMentionedUIDs(List)` | Cached |
| `setPinned(boolean)` | Cached |
| `setSaved(boolean)` | Cached |
+| `setMessageId(long)` | Cached |
+| `setTimestamp(long)` | Cached |
+
+With `setMessageId` or `setTimestamp`, the server page is always shown, but it is saved to the cache only when it connects to (borders or overlaps) the cached history. This also applies to filtered and thread lists.
`setPinned` and `setSaved` are served from separate pinned and saved stores, not the message cache, so the other filters in this table do not apply to a pinned or saved read.
-`setMessageId`, `setTimestamp`, `setUpdatedAfter`, `setLimit`, `setUID` and `setGUID` are scope and pagination inputs, not filters, and do not change what the cache can answer. Setting both `setUID` and `setGUID` together on a non-thread read (one sender's messages in a group) is answered by the server only.
+`setUpdatedAfter`, `setLimit`, `setUID` and `setGUID` are scope and pagination inputs, not filters, and do not change what the cache can answer. Setting both `setUID` and `setGUID` together on a non-thread read (one sender's messages in a group) is answered by the server only.
diff --git a/sdk/android/v5/block-users.mdx b/sdk/android/v5/block-users.mdx
index ddc466dca..d019998c2 100644
--- a/sdk/android/v5/block-users.mdx
+++ b/sdk/android/v5/block-users.mdx
@@ -266,7 +266,7 @@ override fun onError(e: CometChatException) {
## Offline Behaviour
-With offline support enabled, `BlockedUsersRequest.fetchNext()` on a `UserFetchListener` first delivers `onCachedUsers` from the SDK's own blocked-users list, which it refreshes on login and on reconnect and updates when you call `blockUsers()` or `unblockUsers()`. Then `onServerUsers` delivers the live page to reconcile by `uid`; the server page is not saved to the device. The cached page is empty when no users are blocked or when `setSearchKeyword` is set. Offline, the read ends with `onError` with code `ERROR_INTERNET_UNAVAILABLE` after the cached page. See [Show Cached Data](/sdk/android/v5/offline-cached-data).
+With offline support enabled, `BlockedUsersRequest.fetchNext()` on a `UserFetchListener` first delivers `onCachedUsers` from the SDK's own blocked-users list, which it refreshes on login and on reconnect and updates when you call `blockUsers()` or `unblockUsers()`. Then `onServerUsers` delivers the live page to reconcile by `uid`; the server page is not saved to the device. The cached page is empty when no users are blocked or when `setSearchKeyword` is set. Offline, the read ends with `onError` with code `ERROR_INTERNET_UNAVAILABLE` after the cached page. A second `fetchNext()` made while the first is still loading returns an empty `onServerUsers` page at once, online or offline, without a cached page and without moving to the next page. That empty page is not the end of the list, so don't stop paging on it. See [Show Cached Data](/sdk/android/v5/offline-cached-data).
| Builder method | Offline |
|---|---|
diff --git a/sdk/android/v5/delete-group.mdx b/sdk/android/v5/delete-group.mdx
index ce071dad4..d8722a16b 100644
--- a/sdk/android/v5/delete-group.mdx
+++ b/sdk/android/v5/delete-group.mdx
@@ -10,7 +10,7 @@ description: "Only a group admin can remove it, and this page shows the single p
To delete a group you need to use the `deleteGroup()` method. The user must be an **Admin** of the group they are trying to delete.
-Deleting a group needs a connection — with offline support enabled, `deleteGroup()` is **not** queued for later. After it succeeds, the group's conversation and cached messages are removed from the on-device cache when the group-deleted event arrives or at the next reconnect sync; any messages still queued to it are then reported as failed with reason `DISCARDED`. See [Send While Offline](/sdk/android/v5/offline-send).
+Deleting a group needs a connection — with offline support enabled, `deleteGroup()` is **not** queued for later. After it succeeds, the SDK removes the group's conversation, messages, media, queued messages, pins and saved messages from the on-device cache; any messages still queued to it are reported as failed with reason `DISCARDED`. On other devices, the group is removed from the cache when a later reconnect catch-up no longer finds it. See [Send While Offline](/sdk/android/v5/offline-send).
diff --git a/sdk/android/v5/offline-cached-data.mdx b/sdk/android/v5/offline-cached-data.mdx
index 6803ad77b..46fd7e39e 100644
--- a/sdk/android/v5/offline-cached-data.mdx
+++ b/sdk/android/v5/offline-cached-data.mdx
@@ -50,7 +50,7 @@ After a successful server response, the SDK delivers the server's copy for the *
Two rules follow from this:
- **Offline, the read ends with an error.** After the cached page, a read that gets no answer because the device is offline settles with `onError`, code `ERROR_INTERNET_UNAVAILABLE`. A real server error reaches `onError` unchanged. The call always settles, as long as you wait for each fetch to return before starting the next one on the same request object.
-- **The server phase never fires offline.** It fires only on a genuine server response. Never treat a cached page as "end of history"; an empty cached page only means the end of the *cached* window.
+- **The server phase fires only on a genuine server response, so never offline, with one exception.** Never treat a cached page as "end of history"; an empty cached page only means the end of the *cached* window. The exception: on a `ConversationsRequest`, `UsersRequest`, `GroupsRequest` or `BlockedUsersRequest`, a second `fetchNext()` made while the first is still loading gets an empty server page at once (`onServerConversations`, `onServerUsers` or `onServerGroups`), online or offline. It has no cached page and does not move to the next page. This empty page is **not** the end of the list, so don't stop paging on it; wait for the first fetch to return.
diff --git a/sdk/android/v5/offline-enable.mdx b/sdk/android/v5/offline-enable.mdx
index dc9f6d6ac..f8605e89f 100644
--- a/sdk/android/v5/offline-enable.mdx
+++ b/sdk/android/v5/offline-enable.mdx
@@ -39,12 +39,12 @@ Offline support requires CometChat Android SDK **5.1.0** or later (minSdk 21). A
```groovy
-implementation "com.cometchat:chat-sdk-android:5.1.0"
+implementation "com.cometchat:chat-sdk-android:5.1.2"
```
```kotlin
-implementation("com.cometchat:chat-sdk-android:5.1.0")
+implementation("com.cometchat:chat-sdk-android:5.1.2")
```
diff --git a/sdk/android/v5/offline-media-caching.mdx b/sdk/android/v5/offline-media-caching.mdx
index 60ac4f78f..5061930b7 100644
--- a/sdk/android/v5/offline-media-caching.mdx
+++ b/sdk/android/v5/offline-media-caching.mdx
@@ -242,6 +242,6 @@ Remove the listener with `CometChat.removeMediaDownloadListener("MEDIA_LISTENER"
## Media cache size limit
-Cached media bytes are bounded by `maxMediaCacheSize` (default **500 MB**; `0` means unlimited). When the cache exceeds the limit, the least recently accessed media is deleted first until it is back under budget. Media for un-sent (queued) messages is never evicted, though it still counts toward the budget; copies held for an in-progress upload are excluded from the budget. Because protected media is never evicted, the cache can briefly exceed `maxMediaCacheSize`. Bulk list loads and syncs do not refresh an item's recency.
+Cached media bytes are bounded by `maxMediaCacheSize` (default **500 MB**; `0` means unlimited). When the cache exceeds the limit, the least recently accessed media is deleted first until it is back under budget. Media for un-sent (queued) messages and copies held for an in-progress upload are never evicted and do not count toward the budget. Because this protected media is never evicted, the media on disk can briefly exceed `maxMediaCacheSize`. Bulk list loads and syncs do not refresh an item's recency.
Media is stored as files in durable, backup-excluded storage; the location is not configurable. Eviction runs silently in the background — there is no cache-limit callback. To reason about size, use `CometChat.getCacheSize()` and the configured limits. See the [configuration reference](/sdk/android/v5/offline-reference) for the full set of options.
diff --git a/sdk/android/v5/offline-reference.mdx b/sdk/android/v5/offline-reference.mdx
index c448c799d..7e4dbb270 100644
--- a/sdk/android/v5/offline-reference.mdx
+++ b/sdk/android/v5/offline-reference.mdx
@@ -162,7 +162,7 @@ Compare `CometChatException.getCode()` against these codes. All are constants in
| `ERROR_OFFLINE_DISABLED` | An offline-only operation was called while offline support is not active. |
| `ERROR_OFFLINE_MESSAGE_DISCARDED` | A queued message was removed before it could send. |
| `ERROR_OFFLINE_MESSAGE_IN_FLIGHT` | `retryMessage` / `discardLocalMessage` targeted a message that is still being sent. |
-| `ERROR_OFFLINE_MESSAGE_NOT_FOUND` | `retryMessage` / `discardLocalMessage` found no unsent message with the given local id. |
+| `ERROR_OFFLINE_MESSAGE_NOT_FOUND` | `retryMessage` / `discardLocalMessage` found no unsent message with the given local id, or the id was `null`. |
| `ERROR_OFFLINE_MESSAGE_PERSIST_FAILED` | The local cache was briefly unavailable, so `getPendingMessages`, `retryMessage`, `retryAllFailedMessages` or `discardLocalMessage` changed nothing. Try again. |
| `ERROR_PENDING_QUEUE_LIMIT` | A send was refused because the outbox is full or the media is too large; the reason is `QUEUE_FULL` or `BYTE_OVERFLOW`. |
| `ERROR_OFFLINE_MEDIA_COPY_FAILED` | A media send could not be queued because its file could not be copied; the reason is `PERMANENT`. |
diff --git a/sdk/android/v5/offline-send.mdx b/sdk/android/v5/offline-send.mdx
index 4aa87594d..069a8804b 100644
--- a/sdk/android/v5/offline-send.mdx
+++ b/sdk/android/v5/offline-send.mdx
@@ -192,7 +192,7 @@ Every message exposes its offline state. `getLocalMessageId()` returns the SDK-g
| `PERMANENT` | The server rejected the message, or the error was not recognized. A manual retry will not help. |
| `QUEUE_FULL` | A new send was refused because the queue is full (count cap). |
| `QUEUE_OVERFLOW` | An older queued message was evicted to admit a newer one (`DROP_OLDEST` only). |
-| `BYTE_OVERFLOW` | A media send was refused because caching its bytes would exceed `maxMediaCacheSize`, the budget for the whole media cache (received and queued media). |
+| `BYTE_OVERFLOW` | A media send was refused because its bytes would not fit within `maxMediaCacheSize`, the budget for cached media, even after evicting the least recently used cached media. Media of queued messages does not count toward this budget. |
| `DISCARDED` | A queued message was removed before it could send: by `clearOfflineCache`, by leaving or deleting its conversation, or by logout. Reported with code `ERROR_OFFLINE_MESSAGE_DISCARDED`. (`discardLocalMessage` reports `onSuccess` instead.) |
## Inspect the Queue
@@ -331,7 +331,7 @@ CometChat.discardLocalMessage(localMessageId, object : CometChat.CallbackListene
| Error code | Reason |
|---|---|
| `ERROR_OFFLINE_MESSAGE_IN_FLIGHT` | The message is already sending (`SENDING`). |
-| `ERROR_OFFLINE_MESSAGE_NOT_FOUND` | No unsent message has that id (unknown, or already sent). |
+| `ERROR_OFFLINE_MESSAGE_NOT_FOUND` | No unsent message has that id (`null`, unknown, or already sent). |
| `ERROR_OFFLINE_DISABLED` | Offline support is not running. |
| `ERROR_OFFLINE_MESSAGE_PERSIST_FAILED` | The local cache was briefly unavailable. Try again. |
@@ -350,7 +350,7 @@ The outbox holds at most `maxPendingMessages` messages still trying to send (`PE
| `REJECT_NEWEST` (**default**) | The new send is refused and reported with reason `QUEUE_FULL`. Nothing already queued is lost. |
| `DROP_OLDEST` | The oldest `PENDING` message is evicted to admit the new one, and reported with `onError` (code `ERROR_PENDING_QUEUE_LIMIT`, reason `QUEUE_OVERFLOW`). If there is no `PENDING` message to evict, the new send is refused with `QUEUE_FULL`. |
-A media send whose bytes would push the media cache over `maxMediaCacheSize` is refused with reason `BYTE_OVERFLOW`; nothing is evicted to make room.
+When a media send's bytes would push the media cache over `maxMediaCacheSize`, the SDK evicts the least recently used cached media to make room. If the file can't fit even after evicting all the media it is allowed to evict (for example, the file is larger than the whole budget), the send is refused up front with reason `BYTE_OVERFLOW` and nothing is evicted. Media of queued messages does not count toward the budget and is never evicted.
A **refused** send (`QUEUE_FULL` / `BYTE_OVERFLOW`) is never queued, so it fires **no** `onMessagePending`; it reports `onError` with the code `ERROR_PENDING_QUEUE_LIMIT`, and the global `OfflineMessageListener` receives `onOutboxMessageFailed(message, reason)` carrying the exact reason.
diff --git a/sdk/android/v5/overview.mdx b/sdk/android/v5/overview.mdx
index 53aa39bc9..c558cd130 100644
--- a/sdk/android/v5/overview.mdx
+++ b/sdk/android/v5/overview.mdx
@@ -67,7 +67,7 @@ Then, add CometChat to the **app level**`build.gradle` file in the `dependencies
```groovy
dependencies {
- implementation "com.cometchat:chat-sdk-android:5.1.0"
+ implementation "com.cometchat:chat-sdk-android:5.1.2"
}
```
diff --git a/sdk/android/v5/pin-conversation.mdx b/sdk/android/v5/pin-conversation.mdx
index cba93bfff..270996325 100644
--- a/sdk/android/v5/pin-conversation.mdx
+++ b/sdk/android/v5/pin-conversation.mdx
@@ -256,7 +256,11 @@ Every fetched `Conversation` carries its pin state.
Register a `ConversationListener` to be notified when a conversation is pinned or unpinned, so your list can reorder without a refetch.
-Your own pin or unpin fires `onConversationPinned` / `onConversationUnpinned` on the device that performed it, just before the `pinConversation()` / `unpinConversation()` success callback, so update your UI in one of the two, not both. These callbacks also fire on the user's **other** devices when a pin frame arrives there.
+These callbacks fire only for pins and unpins made elsewhere, such as from the user's other devices. They do not fire on the device that performed the action: update the UI for this device's own pin or unpin in the `onSuccess` callback of `pinConversation()` / `unpinConversation()`.
+
+
+This behaviour applies from SDK 5.1.2. In 5.1.0 and 5.1.1 these callbacks also fired on the acting device. If you use the Android UI Kit, upgrade it to 6.3.0 together with SDK 5.1.2.
+
diff --git a/sdk/android/v5/pin-message.mdx b/sdk/android/v5/pin-message.mdx
index 921a05f75..31876dc52 100644
--- a/sdk/android/v5/pin-message.mdx
+++ b/sdk/android/v5/pin-message.mdx
@@ -311,7 +311,11 @@ Editing a message preserves its pin. A message stores only its most recent pinne
Register a `MessageListener` and override the pin callbacks. Each event delivers the full updated `BaseMessage`, so you can directly replace the message in your list.
-Your own pin or unpin fires `onMessagePinned` / `onMessageUnpinned` on the device that performed it, just before the `pinMessage()` / `unpinMessage()` success callback, so update your UI in one of the two, not both. These callbacks also fire on **other** participants' devices when a pin frame arrives there.
+These callbacks fire only for pins and unpins by other users or from the user's other devices. They do not fire on the device that performed the action: update the UI for this device's own pin or unpin in the `onSuccess` callback of `pinMessage()` / `unpinMessage()`.
+
+
+This behaviour applies from SDK 5.1.2. In 5.1.0 and 5.1.1 these callbacks also fired on the acting device. If you use the Android UI Kit, upgrade it to 6.3.0 together with SDK 5.1.2.
+
diff --git a/sdk/android/v5/real-time-listeners.mdx b/sdk/android/v5/real-time-listeners.mdx
index c903cf570..a951b5d36 100644
--- a/sdk/android/v5/real-time-listeners.mdx
+++ b/sdk/android/v5/real-time-listeners.mdx
@@ -183,10 +183,10 @@ With offline support enabled, `MessageListener` also receives `onMessagesSynced`
| `onMessagesRead(MessageReceipt messageReceipt)` | This event is triggered when a set of messages are marked as read for any particular conversation. |
| `onMessageEdited(BaseMessage message)` | This method is triggered when a particular message has been edited in a user/group conversation. |
| `onMessageDeleted(BaseMessage message)` | This event is triggered when a particular message is deleted in a user/group conversation. |
-| `onMessagePinned(BaseMessage message)` | This event is triggered when a message is pinned in a user/group conversation. |
-| `onMessageUnpinned(BaseMessage message)` | This event is triggered when a message is unpinned in a user/group conversation. |
-| `onMessageSaved(BaseMessage message)` | This event is triggered when the logged-in user saves a message (private — never delivered to other participants). |
-| `onMessageUnsaved(BaseMessage message)` | This event is triggered when the logged-in user unsaves a message (private — never delivered to other participants). |
+| `onMessagePinned(BaseMessage message)` | This event is triggered when a message is pinned in a user/group conversation (not fired on the device that performed the action, from 5.1.2). |
+| `onMessageUnpinned(BaseMessage message)` | This event is triggered when a message is unpinned in a user/group conversation (not fired on the device that performed the action, from 5.1.2). |
+| `onMessageSaved(BaseMessage message)` | This event is triggered when the logged-in user saves a message (private — never delivered to other participants; not fired on the device that performed the action, from 5.1.2). |
+| `onMessageUnsaved(BaseMessage message)` | This event is triggered when the logged-in user unsaves a message (private — never delivered to other participants; not fired on the device that performed the action, from 5.1.2). |
| `onInteractiveMessageReceived(InteractiveMessage message)` | This event is triggered when an Interactive Message is received. |
| `onInteractionGoalCompleted(InteractionReceipt receipt)` | This event is triggered when an interaction Goal is achieved. |
| `onTransientMessageReceived(TransientMessage transientMessage)` | This event is triggered when a Transient Message is received. |
@@ -372,8 +372,8 @@ The `ConversationListener` class provides you with live events related to conver
| Method | Information |
| ------------------------------------------------- | ---------------------------------------------------------------------------- |
-| `onConversationPinned(Conversation conversation)` | This event is triggered when a conversation is pinned for the logged-in user. |
-| `onConversationUnpinned(Conversation conversation)` | This event is triggered when a conversation is unpinned for the logged-in user. |
+| `onConversationPinned(Conversation conversation)` | This event is triggered when a conversation is pinned for the logged-in user (not fired on the device that performed the action, from 5.1.2). |
+| `onConversationUnpinned(Conversation conversation)` | This event is triggered when a conversation is unpinned for the logged-in user (not fired on the device that performed the action, from 5.1.2). |
To add the `ConversationListener`, you need to use the `addConversationListener()` method provided by the `CometChat` class.
diff --git a/sdk/android/v5/retrieve-conversations.mdx b/sdk/android/v5/retrieve-conversations.mdx
index f7e99e1f1..0c8e3bd63 100644
--- a/sdk/android/v5/retrieve-conversations.mdx
+++ b/sdk/android/v5/retrieve-conversations.mdx
@@ -405,7 +405,7 @@ The `Conversation` object consists of the following fields:
| -------------------- | -------------------------------------------------------------------- |
| `conversationId` | ID of the conversation |
| `conversationType` | Type of conversation (user/group) |
-| `lastMessage` | Last message the conversation |
+| `lastMessage` | Last message the conversation. With [offline support](/sdk/android/v5/offline-send) enabled, a last message that has not been sent yet carries its send status in `getStatus()` (`MessageStatus.PENDING` or `MessageStatus.FAILED`) |
| `conversationWith` | `User` or `Group` object containing the details of the user or group |
| `unreadMessageCount` | Unread message count for the conversation |
@@ -570,7 +570,7 @@ While converting a `Message` object to a `Conversation` object, the `unreadMessa
## Offline Behaviour
-With [offline support](/sdk/android/v5/offline-cached-data) enabled, `fetchNext()` delivers a cached page first (`onCachedConversations`, even when empty) and then the server list (`onServerConversations`); offline, the read ends with `onError` with code `ERROR_INTERNET_UNAVAILABLE` after the cached page. The cached page is answered only when every builder filter on the request is locally computable — a single server-only filter blanks the cached page while the server phase still answers in full.
+With [offline support](/sdk/android/v5/offline-cached-data) enabled, `fetchNext()` delivers a cached page first (`onCachedConversations`, even when empty) and then the server list (`onServerConversations`); offline, the read ends with `onError` with code `ERROR_INTERNET_UNAVAILABLE` after the cached page. The cached page is answered only when every builder filter on the request is locally computable — a single server-only filter blanks the cached page while the server phase still answers in full. A second `fetchNext()` made while the first is still loading returns an empty `onServerConversations` page at once, online or offline, without a cached page and without moving to the next page. That empty page is not the end of the list, so don't stop paging on it.
| Builder method | Offline |
|---|---|
diff --git a/sdk/android/v5/retrieve-groups.mdx b/sdk/android/v5/retrieve-groups.mdx
index 547a9c35f..8de7a7363 100644
--- a/sdk/android/v5/retrieve-groups.mdx
+++ b/sdk/android/v5/retrieve-groups.mdx
@@ -314,7 +314,7 @@ This method returns a `Hashmap` with the GUID of the group as the key and the on
## Offline Behaviour
-With offline support enabled, `GroupsRequest.fetchNext()` on a `GroupFetchListener` first delivers `onCachedGroups` from the device (empty when nothing was recorded), then `onServerGroups` with the live page to reconcile by `guid`. Offline, the read ends with `onError` with code `ERROR_INTERNET_UNAVAILABLE` after the cached page. A request that uses a server-only filter records nothing, so its cached page is always empty. See [Show Cached Data](/sdk/android/v5/offline-cached-data).
+With offline support enabled, `GroupsRequest.fetchNext()` on a `GroupFetchListener` first delivers `onCachedGroups` from the device (empty when nothing was recorded), then `onServerGroups` with the live page to reconcile by `guid`. Offline, the read ends with `onError` with code `ERROR_INTERNET_UNAVAILABLE` after the cached page. A request that uses a server-only filter records nothing, so its cached page is always empty. A second `fetchNext()` made while the first is still loading returns an empty `onServerGroups` page at once, online or offline, without a cached page and without moving to the next page. That empty page is not the end of the list, so don't stop paging on it. See [Show Cached Data](/sdk/android/v5/offline-cached-data).
| Builder method | Offline |
|---|---|
diff --git a/sdk/android/v5/retrieve-users.mdx b/sdk/android/v5/retrieve-users.mdx
index e55d95063..20493f98f 100644
--- a/sdk/android/v5/retrieve-users.mdx
+++ b/sdk/android/v5/retrieve-users.mdx
@@ -548,7 +548,7 @@ override fun onError(e: CometChatException) {
## Offline Behaviour
-With offline support enabled, `UsersRequest.fetchNext()` on a `UserFetchListener` first delivers `onCachedUsers` from the device — the pages the server last returned for this exact request, replayed on-device (empty when nothing was recorded) — then `onServerUsers` with the live page to reconcile by `uid`. Offline, the read ends with `onError` with code `ERROR_INTERNET_UNAVAILABLE` after the cached page. A request that uses a server-only filter records nothing, so its cached page is always empty. See [Show Cached Data](/sdk/android/v5/offline-cached-data).
+With offline support enabled, `UsersRequest.fetchNext()` on a `UserFetchListener` first delivers `onCachedUsers` from the device — the pages the server last returned for this exact request, replayed on-device (empty when nothing was recorded) — then `onServerUsers` with the live page to reconcile by `uid`. Offline, the read ends with `onError` with code `ERROR_INTERNET_UNAVAILABLE` after the cached page. A request that uses a server-only filter records nothing, so its cached page is always empty. A second `fetchNext()` made while the first is still loading returns an empty `onServerUsers` page at once, online or offline, without a cached page and without moving to the next page. That empty page is not the end of the list, so don't stop paging on it. See [Show Cached Data](/sdk/android/v5/offline-cached-data).
| Builder method | Offline |
|---|---|
diff --git a/sdk/android/v5/save-message.mdx b/sdk/android/v5/save-message.mdx
index 7cc9b5c0a..894f162bd 100644
--- a/sdk/android/v5/save-message.mdx
+++ b/sdk/android/v5/save-message.mdx
@@ -243,7 +243,11 @@ if (message.isSaved) {
Because saving is private, save events are never delivered to other participants. Register a `MessageListener` and override the save callbacks; each event delivers the full updated `BaseMessage`.
-Your own save or unsave fires `onMessageSaved` / `onMessageUnsaved` on the device that performed it, just before the `saveMessage()` / `unsaveMessage()` success callback, so update your UI in one of the two, not both. These callbacks also fire on the user's **other** devices when a save frame arrives there.
+These callbacks fire only for saves and unsaves from the user's other devices. They do not fire on the device that performed the action: update the UI for this device's own save or unsave in the `onSuccess` callback of `saveMessage()` / `unsaveMessage()`.
+
+
+This behaviour applies from SDK 5.1.2. In 5.1.0 and 5.1.1 these callbacks also fired on the acting device. If you use the Android UI Kit, upgrade it to 6.3.0 together with SDK 5.1.2.
+
diff --git a/sdk/android/v5/setup.mdx b/sdk/android/v5/setup.mdx
index 91e4636e9..9efd25be5 100644
--- a/sdk/android/v5/setup.mdx
+++ b/sdk/android/v5/setup.mdx
@@ -47,7 +47,7 @@ Then, add CometChat to the **app level** `build.gradle` file in the `dependencie
```groovy
dependencies {
- implementation "com.cometchat:chat-sdk-android:5.1.0"
+ implementation "com.cometchat:chat-sdk-android:5.1.2"
}
```
diff --git a/sdk/android/v5/upgrading-from-v4.mdx b/sdk/android/v5/upgrading-from-v4.mdx
index a7e805f0d..66f643aff 100644
--- a/sdk/android/v5/upgrading-from-v4.mdx
+++ b/sdk/android/v5/upgrading-from-v4.mdx
@@ -12,7 +12,7 @@ Update your `build.gradle` dependency:
```groovy
dependencies {
- implementation "com.cometchat:chat-sdk-android:5.1.0"
+ implementation "com.cometchat:chat-sdk-android:5.1.2"
}
```
diff --git a/ui-kit/android/calling-integration.mdx b/ui-kit/android/calling-integration.mdx
index 9213c2afd..3eb148a80 100644
--- a/ui-kit/android/calling-integration.mdx
+++ b/ui-kit/android/calling-integration.mdx
@@ -39,7 +39,7 @@ The UI Kit does not bundle the Calls SDK: `calls-sdk-android` is a compile-only
```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")
@@ -52,7 +52,7 @@ dependencies {
```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")
@@ -66,7 +66,7 @@ dependencies {
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.
-**`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.
## Step 2: Enable calling in the UI Kit
diff --git a/ui-kit/android/conversations.mdx b/ui-kit/android/conversations.mdx
index 502f2a689..b2ca8f915 100644
--- a/ui-kit/android/conversations.mdx
+++ b/ui-kit/android/conversations.mdx
@@ -487,6 +487,9 @@ For pins made elsewhere, the Chat SDK exposes `CometChat.ConversationListener` w
| `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 (default `false`). Notices that aren't about one chat, such as unsent messages that were lost, show once on the next Conversations or Message List that doesn't hide notices. 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.
---
diff --git a/ui-kit/android/core-features.mdx b/ui-kit/android/core-features.mdx
index 7f50bf8a4..f9f6ddd67 100644
--- a/ui-kit/android/core-features.mdx
+++ b/ui-kit/android/core-features.mdx
@@ -9,7 +9,7 @@ description: "Overview of CometChat's core chat features including instant messa
| --- | --- |
| Packages | `com.cometchat:chatuikit-kotlin-android` (Kotlin XML Views), `com.cometchat:chatuikit-compose-android` (Jetpack Compose) |
| 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) |
@@ -290,6 +290,26 @@ Conversation and Advanced Search enables users to quickly find conversations, me
| [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
diff --git a/ui-kit/android/customization-viewmodel-data.mdx b/ui-kit/android/customization-viewmodel-data.mdx
index 3d60ef7ac..b33ecd3d6 100644
--- a/ui-kit/android/customization-viewmodel-data.mdx
+++ b/ui-kit/android/customization-viewmodel-data.mdx
@@ -264,6 +264,10 @@ val factory = CometChatConversationsViewModelFactory(
)
```
+
+With [offline support](/ui-kit/android/offline-support) on, a component shows saved data first only when it uses the UI Kit's own repository. A component given a custom repository loads from the server only, so it has no saved data to show offline.
+
+
diff --git a/ui-kit/android/events.mdx b/ui-kit/android/events.mdx
index 20e251557..a5ccac8c3 100644
--- a/ui-kit/android/events.mdx
+++ b/ui-kit/android/events.mdx
@@ -10,7 +10,7 @@ description: "Listen to UI Kit events for user actions, group changes, messages,
| Kotlin (XML Views) | `com.cometchat:chatuikit-kotlin-android` |
| Jetpack Compose | `com.cometchat:chatuikit-compose-android` |
| 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 |
@@ -51,6 +51,7 @@ import com.cometchat.uikit.core.events.CometChatMessageEvent
| `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
@@ -183,6 +184,17 @@ lifecycleScope.launch {
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.
diff --git a/ui-kit/android/getting-started-jetpack.mdx b/ui-kit/android/getting-started-jetpack.mdx
index db1a0d9b2..aa92d36e0 100644
--- a/ui-kit/android/getting-started-jetpack.mdx
+++ b/ui-kit/android/getting-started-jetpack.mdx
@@ -16,6 +16,7 @@ description: "Step-by-step guide to integrate the CometChat Jetpack Compose UI K
| 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) |
@@ -48,7 +49,7 @@ Auth Key is for development only. In production, generate Auth Tokens server-sid
-**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`, skip 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.
## Step 1 — Create an Android Project
@@ -116,7 +117,7 @@ dependencies {
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")
@@ -128,7 +129,7 @@ dependencies {
-**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.
---
@@ -242,6 +243,10 @@ class MainActivity : ComponentActivity() {
`init()` must resolve before you call `login()`. Calling `login()` before init completes will fail silently.
+
+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).
+
+
---
## Step 4 — Choose a Chat Experience
diff --git a/ui-kit/android/getting-started-kotlin.mdx b/ui-kit/android/getting-started-kotlin.mdx
index 78d8da3be..0d5765251 100644
--- a/ui-kit/android/getting-started-kotlin.mdx
+++ b/ui-kit/android/getting-started-kotlin.mdx
@@ -16,6 +16,7 @@ description: "Step-by-step guide to integrate the CometChat Kotlin UI Kit with X
| 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) |
@@ -48,7 +49,7 @@ Auth Key is for development only. In production, generate Auth Tokens server-sid
-**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`, skip 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.
## Step 1 — Create an Android Project
@@ -112,7 +113,7 @@ kotlin {
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")
@@ -125,7 +126,7 @@ dependencies {
### 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:
```properties gradle.properties
android.enableJetifier=true
@@ -229,6 +230,10 @@ class MainActivity : AppCompatActivity() {
`init()` must resolve before you call `login()`. Calling `login()` before init completes will fail silently.
+
+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).
+
+
---
## Step 4 — Choose a Chat Experience
diff --git a/ui-kit/android/getting-started.mdx b/ui-kit/android/getting-started.mdx
index 147e422b2..9cb80eb2b 100644
--- a/ui-kit/android/getting-started.mdx
+++ b/ui-kit/android/getting-started.mdx
@@ -17,6 +17,7 @@ description: "Install, configure, and launch the CometChat Android UI Kit in you
| Theme | Set `CometChatTheme.DayNight` as parent theme in `themes.xml` |
| 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) |
@@ -88,7 +89,7 @@ Inside `libs.versions.toml`, add the versions:
```toml libs.versions.toml
[versions]
-cometchat-ui-kit = "6.2.0"
+cometchat-ui-kit = "6.3.0"
cometchat-calls-sdk = "5.1.0" # for calling; the UI Kit does not bundle it
```
@@ -137,7 +138,7 @@ Open the app-level `build.gradle.kts` file and add the dependency for your chose
```kotlin build.gradle.kts
dependencies {
- implementation("com.cometchat:chatuikit-kotlin-android:6.2.0")
+ implementation("com.cometchat:chatuikit-kotlin-android:6.3.0")
// Calling: the UI Kit does not bundle the Calls SDK; push ringing is added in Calling Integration
implementation("com.cometchat:calls-sdk-android:5.1.0")
}
@@ -151,7 +152,7 @@ dependencies {
implementation(platform("androidx.compose:compose-bom:2025.06.00"))
implementation("androidx.compose.material3:material3")
- implementation("com.cometchat:chatuikit-compose-android:6.2.0")
+ implementation("com.cometchat:chatuikit-compose-android:6.3.0")
// Calling: the UI Kit does not bundle the Calls SDK; push ringing is added in Calling Integration
implementation("com.cometchat:calls-sdk-android:5.1.0")
}
@@ -164,7 +165,7 @@ dependencies {
### 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:
```properties gradle.properties
android.enableJetifier=true
diff --git a/ui-kit/android/guide-pin-and-save-messages.mdx b/ui-kit/android/guide-pin-and-save-messages.mdx
index 3bab31a1c..75b25a785 100644
--- a/ui-kit/android/guide-pin-and-save-messages.mdx
+++ b/ui-kit/android/guide-pin-and-save-messages.mdx
@@ -177,7 +177,7 @@ The limit and system-pin codes are also listed in the [Error Guide](/articles/er
## Live Updates
-On the acting user's device, all surfaces stay in sync through the UI Kit event bus — pinning from the action sheet updates the bubble indicator and the Pinned Messages screen without a refetch. Delivery of message pin/save events to other participants and to the user's other devices activates once server-side real-time delivery for these features is rolled out; until then, other clients pick the change up on their next fetch. If you build custom UI, observe the `MessagePinned` / `MessageUnpinned` / `MessageSaved` / `MessageUnsaved` events; see [Events](/ui-kit/android/events).
+On the acting user's device, all surfaces stay in sync through the UI Kit event bus — pinning from the action sheet updates the bubble indicator and the Pinned Messages screen without a refetch. The UI Kit makes these updates, and raises its events, when the pin or save call succeeds (its `onSuccess`): with Chat SDK 5.1.2 the SDK sends no listener event back to the device that made the change. Pins by other participants, and pins and saves from the user's other devices, arrive in real time: the bubble indicator and the Pinned and Saved Messages screens update without a refetch. If you build custom UI, observe the `MessagePinned` / `MessageUnpinned` / `MessageSaved` / `MessageUnsaved` events for changes made on this device (see [Events](/ui-kit/android/events)), and the SDK's `onMessagePinned` / `onMessageUnpinned` / `onMessageSaved` / `onMessageUnsaved` callbacks for changes from other users and devices (see [Pin A Message](/sdk/android/v5/pin-message) and [Save A Message](/sdk/android/v5/save-message)).
## Summary / Feature Matrix
diff --git a/ui-kit/android/llms-android-v6.mdx b/ui-kit/android/llms-android-v6.mdx
index db8d2aa8c..6d5995955 100644
--- a/ui-kit/android/llms-android-v6.mdx
+++ b/ui-kit/android/llms-android-v6.mdx
@@ -18,8 +18,8 @@ description: "Machine-readable, Android-v6-scoped index of every UI Kit page as
# Android UI Kit v6 — LLM docs index (Latest)
> Stateful, drop-in Android chat/calling UI. Two UI flavors of ONE kit:
-> `com.cometchat:chatuikit-kotlin-android:6.2.0` (Kotlin, XML Views) and
-> `com.cometchat:chatuikit-compose-android:6.2.0` (Jetpack Compose) — both pull in
+> `com.cometchat:chatuikit-kotlin-android:6.3.0` (Kotlin, XML Views) and
+> `com.cometchat:chatuikit-compose-android:6.3.0` (Jetpack Compose) — both pull in
> `com.cometchat:chat-sdk-android` 5.x transitively; calling adds `com.cometchat:calls-sdk-android:5.1.0`. This page is an **Android-v6-only** routing index for AI
> agents — a scoped alternative to the site-wide `/docs/llms.txt`.
@@ -36,7 +36,7 @@ there.
split into two dedicated pages (linked below).
## Install facts an agent must not guess
-- **Latest versions:** UI Kit `6.2.0` (`chatuikit-kotlin-android` or `chatuikit-compose-android` —
+- **Latest versions:** UI Kit `6.3.0` (`chatuikit-kotlin-android` or `chatuikit-compose-android` —
one, not both), Calls SDK `com.cometchat:calls-sdk-android:5.1.0` (optional, only for
voice/video). Don't add `chat-sdk-android` yourself; the kit brings it in.
- Repository: `maven("https://dl.cloudsmith.io/public/cometchat/cometchat/maven/")` in
@@ -70,6 +70,7 @@ attributes, long-tail components, theming tokens, or feature enablement.
## Core & configuration
- [Core Features](/ui-kit/android/core-features)
+- [Offline Support](/ui-kit/android/offline-support) — off by default; `setOfflineConfig(...)` on the `UIKitSettings` builder (UI Kit 6.3.0+)
- [Extensions](/ui-kit/android/extensions)
- [Smart / AI Features](/ui-kit/android/ai-features)
- [Call Features](/ui-kit/android/call-features)
diff --git a/ui-kit/android/localize.mdx b/ui-kit/android/localize.mdx
index acd27484c..1a29eccc4 100644
--- a/ui-kit/android/localize.mdx
+++ b/ui-kit/android/localize.mdx
@@ -104,6 +104,8 @@ Override any UI Kit string by adding the same key to your app's `res/values/stri
This works identically for both Kotlin XML Views and Jetpack Compose — both modules read from the same Android string resources.
+The texts that [offline support](/ui-kit/android/offline-support) shows, such as "Connect to load chats", "Not sent yet" and "Jump to latest", are listed with their keys in [Offline states and texts](/ui-kit/android/offline-support#offline-states-and-texts). Override them the same way.
+
---
## Customize Date & Time Labels
diff --git a/ui-kit/android/message-composer.mdx b/ui-kit/android/message-composer.mdx
index be79a7075..3db6e3295 100644
--- a/ui-kit/android/message-composer.mdx
+++ b/ui-kit/android/message-composer.mdx
@@ -201,6 +201,10 @@ Limits are governed by the app's server settings (CometChat dashboard) — the c
Each tile carries an `AttachmentUploadStatus` (`UPLOADING`, `DONE`, `FAILED`, `REJECTED`, `CANCELLED`) mapped directly from the SDK's per-file upload callbacks, so the tray shows the right affordance — cancel while uploading, **retry** on a `FAILED` (transient) tile, **remove** on a `REJECTED` (non-retryable) tile. Errors surface through the composer ViewModel's `errorEvent`, which you can observe to show your own snack bar.
+### Sending while offline
+
+With [offline support](/ui-kit/android/offline-support#composer-and-unsent-messages) on, text messages and voice notes sent without a connection are queued and go out when the connection returns. Files staged in the tray still need a connection to upload, so they aren't queued. The tray keeps them for that chat, so they come back when the chat is opened again. Send files from the tray while connected.
+
### Disabling Multiple Attachments
Set the flag to `false` to restore the legacy behavior — single-item pickers that send immediately with no tray:
diff --git a/ui-kit/android/message-list.mdx b/ui-kit/android/message-list.mdx
index 850bc3e3c..b21edf40d 100644
--- a/ui-kit/android/message-list.mdx
+++ b/ui-kit/android/message-list.mdx
@@ -280,6 +280,8 @@ The component listens to SDK message events internally. No manual setup needed.
| `setOnThreadRepliesClick { }` | `onThreadRepliesClick = { }` | Thread reply tap callback |
| `setThreaded(true)` | `threaded = true` | Mark the list as a thread view: a missing or invalid parent message shows the empty state instead of the whole conversation. A valid `setParentMessageId` / `setParentMessage` marks it threaded automatically (from v6.1.1) |
| `setEnableMultipleAttachments(true)` | `enableMultipleAttachments = true` | Render multi-attachment messages with per-type bubbles and batch grouping (default `true`). See [Multiple Attachments](#multiple-attachments) |
+| `setHideOfflineNotices(true)` | `hideOfflineNotices = true` | Hide the offline notice toasts (default `false`). Offline support only, from v6.3.0. See [Offline Support](#offline-support) |
+| `setOfflineRowStyle(style)` | `offlineRowStyle = style` | Style the "Not sent yet" and "Not sent. Tap to retry" lines under unsent messages. Offline support only, from v6.3.0 |
---
@@ -316,6 +318,14 @@ Setting it to `false` renders every media message with the classic single-attach
---
+## Offline Support
+
+*Available since v6.3.0*
+
+With [offline support](/ui-kit/android/offline-support#message-list-and-threads) on, the list (and a thread's replies) shows saved history at once, then updates it from the server. Own messages that aren't sent yet show **Not sent yet** or **Not sent. Tap to retry**, and offer only **Retry**, **Delete** and, for text, **Copy**. At the end of the saved messages with no connection, the list shows **Connect to load more**. Use `setHideOfflineNotices` / `hideOfflineNotices` to hide the offline notice toasts, and `setOfflineRowStyle` / `offlineRowStyle` to style the unsent-message lines. See [Customization](/ui-kit/android/offline-support#customization).
+
+---
+
## Custom View Slots
### Header View
diff --git a/ui-kit/android/message-template.mdx b/ui-kit/android/message-template.mdx
index 70e9394e2..716dae781 100644
--- a/ui-kit/android/message-template.mdx
+++ b/ui-kit/android/message-template.mdx
@@ -6,7 +6,7 @@ description: "Customize message bubble structure, layout, and behavior with Bubb
**Renamed in v6.** v5's `MessageTemplate` API (`CometChatMessageTemplate`, `setTemplates`,
`setType`, `setCategory`, `setBubbleView`, `setMessageReceipt`) **does not ship** in
-`com.cometchat:chatuikit-kotlin-android:6.2.0` — verified against the published artifact. Bubble
+`com.cometchat:chatuikit-kotlin-android:6.3.0` — verified against the published artifact. Bubble
customization is now `BubbleFactory`. If you are migrating, see
[Upgrading from v5](/ui-kit/android/upgrading-from-v5).
diff --git a/ui-kit/android/methods.mdx b/ui-kit/android/methods.mdx
index 67a6bc879..c7c7ed8f4 100644
--- a/ui-kit/android/methods.mdx
+++ b/ui-kit/android/methods.mdx
@@ -15,6 +15,7 @@ description: "Use CometChatUIKit wrapper methods for initialization, authenticat
| Login (prod) | `CometChatUIKit.loginWithAuthToken("AUTH_TOKEN", callback)` |
| Other methods | `CometChatUIKit.logout()`, `CometChatUIKit.getLoggedInUser()`, `CometChatUIKit.createUser(user, callback)` |
| Send messages | `CometChatUIKit.sendTextMessage()`, `CometChatUIKit.sendMediaMessage()`, `CometChatUIKit.sendCustomMessage()` |
+| Offline support | `setOfflineConfig(OfflineConfig)` on the `UIKitSettings` builder before `build()`. Off by default. See [Offline Support](/ui-kit/android/offline-support) |
| Note | Use these wrapper methods instead of raw SDK calls — they manage internal UI Kit eventing |
@@ -77,6 +78,7 @@ The `UIKitSettings` is an important parameter of the `init()` function. It serve
| **setEnableCalling** | `Boolean` | Turns on calling: the UI Kit initialises the Calls SDK during `init()` and logs the user into it during `login()`. Default `false`. See [Calling Integration](/ui-kit/android/calling-integration) |
| **setCallSettingsBuilder** | `Any` (a `CometChatCalls.SessionSettingsBuilder`) | Default session settings for the call screens. Typed `Any` so the UI Kit compiles without the Calls SDK, which your app adds |
| **setEnableThreadSubscription** | `Boolean` | *Deprecated in v6.1.0.* Global switch for the thread subscription feature. Default `true` from v6.1.0 (`false` on v6.0.x, where it is the opt-in). Kept as the only app-wide opt-out — pass `false` to turn the feature off everywhere. To hide a single surface, prefer the per-screen visibility methods. See [Thread Subscription](/ui-kit/android/guide-threaded-messages#thread-subscription) |
+| **setOfflineConfig** | `OfflineConfig` | Turns on offline support by passing the Chat SDK's `OfflineConfig` to the SDK. Off unless the config has `enabled(true)`. Needs UI Kit 6.3.0 or later. See [Offline Support](/ui-kit/android/offline-support) |
**Usage:**
@@ -196,6 +198,10 @@ CometChatUIKit.logout(object : CometChat.CallbackListener() {
> **What this does:** Ends a call in progress and cancels an outgoing call still ringing, logs out of the Chat SDK and then the Calls SDK, clears the session data and tears down the internal event system. On the Calls logout the Push Notifications SDK stops a ring still playing for the old user and unregisters the push token. Call this before logging in a different user to avoid conflicts.
+
+With [offline support](/ui-kit/android/offline-support) on, logout also ends the user's offline session. The Chat SDK deletes the user's offline cache, the UI Kit clears the screens on display, and messages still waiting to be sent are discarded. A pending `sendTextMessage`, `sendMediaMessage` or `sendCustomMessage` calls `onError` once with `ERROR_OFFLINE_MESSAGE_DISCARDED`.
+
+
Use `CometChatUIKit.logout`, not `CometChat.logout`. The Chat SDK's logout alone leaves the Calls SDK signed in: a ringing call is not stopped and later declines go out with the old user's token.
@@ -319,6 +325,10 @@ CometChatUIKit.init(context, uiKitSettings, object : CometChat.CallbackListener<
### Base Message
+
+With [offline support](/ui-kit/android/offline-support) on, `sendTextMessage`, `sendMediaMessage` and `sendCustomMessage` queue the message when there is no connection. It shows in the message list at once and is sent when the connection returns. A queued send calls neither `onSuccess` nor `onError` until it is sent or fails. See [Send completions](/ui-kit/android/offline-support#send-completions).
+
+
#### Text Message
To send a text message to a single user or a group, use the `sendTextMessage()` function. This function requires a `TextMessage` object as its argument, which contains the necessary information for delivering the message.
diff --git a/ui-kit/android/offline-support.mdx b/ui-kit/android/offline-support.mdx
new file mode 100644
index 000000000..061510845
--- /dev/null
+++ b/ui-kit/android/offline-support.mdx
@@ -0,0 +1,458 @@
+---
+title: "Offline Support"
+sidebarTitle: "Offline Support"
+description: "Turn on offline support in the CometChat Android UI Kit so saved chats open without a connection, messages queue until reconnect, and every list shows clear offline states."
+---
+
+
+
+| Field | Value |
+| --- | --- |
+| Default | Off. Nothing changes until you pass an `OfflineConfig` with `enabled(true)` |
+| Enable | `UIKitSettings.UIKitSettingsBuilder().setOfflineConfig(OfflineConfig.Builder().enabled(true).build())` before `build()`, then `CometChatUIKit.init()` |
+| Kits | Both: `com.cometchat:chatuikit-kotlin-android` and `com.cometchat:chatuikit-compose-android`, 6.3.0 or later |
+| Chat SDK | `com.cometchat:chat-sdk-android` 5.1.2 (brought in by the UI Kit) |
+| Encryption | Optional: `encryption(true)` on `OfflineConfig`, and your app adds `net.zetetic:sqlcipher-android:4.13.0` |
+| `OfflineConfig` options | [Android SDK offline reference](/sdk/android/v5/offline-reference) |
+| Hide notices | Kotlin: `setHideOfflineNotices(true)` on `CometChatMessageList` and `CometChatConversations`. Compose: `hideOfflineNotices = true` |
+| Style | Kotlin: `CometChatMessageList.setOfflineRowStyle(...)`. Compose: `CometChatMessageList(offlineRowStyle = ...)` |
+| Events | `CometChatEvents.offlineEvents`: `CometChatOfflineEvent.MessageSendStateChanged`, `CometChatOfflineEvent.OfflineCacheReset` |
+| Discarded send | `CometChatUIKit.sendTextMessage` / `sendMediaMessage` / `sendCustomMessage` call `onError` with `ERROR_OFFLINE_MESSAGE_DISCARDED` on logout, user switch or cache reset |
+
+
+
+With offline support turned on, the Android UI Kit reads from the Chat SDK's on-device cache. Chats the user has opened before appear at once, even with no connection. Text messages and voice notes sent while offline wait in a queue and go out when the connection returns. Every list shows a clear state when it has nothing saved and can't reach the server.
+
+Both kits get the same behaviour: Kotlin (XML Views) and Jetpack Compose. Where the API differs, this page shows a tab for each. The UI Kit builds on the Chat SDK's offline support, and this page covers what the UI Kit adds on top. For cache settings, encryption, media caching and sync, see the [Android SDK offline docs](/sdk/android/v5/offline-overview).
+
+## Overview
+
+**Works offline:**
+- Conversations, users, groups and group members you have loaded before show at once from the cache.
+- Saved message history, including threads, opens without a connection.
+- New text messages and voice notes are queued and sent automatically on reconnect. So are messages sent with `CometChatUIKit.sendTextMessage`, `sendMediaMessage` and `sendCustomMessage`. A queued message shows a clock and **Not sent yet** until it is sent.
+- Images, videos, audio and files that are on the device open from the saved copy, with media caching on (the default).
+- After a reconnect, the Chat SDK's catch-up brings in what changed while the user was away.
+
+**Needs a connection:**
+- The first load of any chat or list that was never opened before.
+- Keyword search with no saved match.
+- Uploading photos, videos, audio files or documents picked in the composer's attachment tray (`enableMultipleAttachments`, on by default). The message can be sent once its files have uploaded.
+- Editing or deleting a sent message, adding or removing a reaction, and pinning or saving a message. These aren't queued.
+- Message information, call logs and calls.
+- AI Assistant chat history that was never loaded. Saved history shows offline.
+- Media that has no copy on the device.
+
+## Requirements
+
+| Requirement | Version |
+| --- | --- |
+| CometChat Android UI Kit (`chatuikit-kotlin-android` or `chatuikit-compose-android`) | 6.3.0 or later |
+| CometChat Android Chat SDK (`chat-sdk-android`) | 5.1.2, brought in by the UI Kit |
+| SQLCipher (`net.zetetic:sqlcipher-android`) | 4.13.0, only if you turn on encryption |
+| Android | `minSdk` 28 |
+
+UI Kit 6.3.0 is the first version with offline support. It brings in Chat SDK 5.1.2, so don't add `chat-sdk-android` yourself. Add the kit you use:
+
+
+
+
+```kotlin build.gradle.kts
+dependencies {
+ implementation("com.cometchat:chatuikit-kotlin-android:6.3.0")
+}
+```
+
+
+
+
+```kotlin build.gradle.kts
+dependencies {
+ implementation("com.cometchat:chatuikit-compose-android:6.3.0")
+}
+```
+
+
+
+
+To encrypt the cache, also add the SQLCipher engine. The Chat SDK and the UI Kit don't bundle it:
+
+```kotlin build.gradle.kts
+dependencies {
+ implementation("net.zetetic:sqlcipher-android:4.13.0")
+}
+```
+
+
+If you call `encryption(true)` without adding SQLCipher, the cache doesn't open and the app works online only (the default `encryptionFailureBehavior`). See [Encrypt the Cache](/sdk/android/v5/offline-encryption).
+
+
+## Enable offline support
+
+Offline support is **off by default**. Turn it on by passing an `OfflineConfig` to `setOfflineConfig()` on the `UIKitSettings` builder, before you call `build()` and `CometChatUIKit.init()`. The UI Kit passes the config straight to the Chat SDK and stores nothing of its own. The code is the same for both kits.
+
+```kotlin lines
+import com.cometchat.chat.core.CometChat
+import com.cometchat.chat.core.OfflineConfig
+import com.cometchat.chat.exceptions.CometChatException
+import com.cometchat.uikit.core.CometChatUIKit
+import com.cometchat.uikit.core.UIKitSettings
+
+// Offline support is off unless the config has enabled(true).
+val offlineConfig = OfflineConfig.Builder()
+ .enabled(true)
+ // .encryption(true) // needs net.zetetic:sqlcipher-android in your app
+ .build()
+
+val uiKitSettings = UIKitSettings.UIKitSettingsBuilder()
+ .setRegion("REGION") // Replace with your App Region
+ .setAppId("APP_ID") // Replace with your App ID
+ .setAuthKey("AUTH_KEY") // Replace with your Auth Key (dev only)
+ .subscribePresenceForAllUsers()
+ .setOfflineConfig(offlineConfig)
+ .build()
+
+CometChatUIKit.init(context, uiKitSettings, object : CometChat.CallbackListener() {
+ override fun onSuccess(s: String) {
+ // Log in, then show the UI Kit screens as usual.
+ }
+
+ override fun onError(e: CometChatException?) {
+ Log.e(TAG, "Initialization failed: ${e?.message}")
+ }
+})
+```
+
+`OfflineConfig` has more options, such as cache size, retention, the pending-message limit, encryption and media caching. Set only the ones you need. Every option is described in the [Configuration & API Reference](/sdk/android/v5/offline-reference#offlineconfig-options).
+
+
+Offline support is active only while a user is logged in. Call `CometChat.isOfflineEnabled()` at the moment you need to know. See [Enable Offline Support](/sdk/android/v5/offline-enable).
+
+
+When the user is already logged in, `CometChatUIKit.login()` with the same UID, and `CometChatUIKit.loginWithAuthToken()`, answer at once from the saved session, without a network call. So an app that logs in on every launch still opens offline after a restart.
+
+## How the components behave offline
+
+### Lists: Conversations, Users, Groups and Group Members
+
+- Saved rows show first. The server page then loads and updates the list in place.
+- Rows already on screen stay when a load can't reach the server. With rows on screen, a failure caused by having no connection shows no error view.
+- With nothing saved and no connection, the list shows **Connect to load chats** (or users, groups, members) as its error view and calls `onError`. This state has no Retry button. A custom error view replaces it, and hiding the error state hides it (see [Your own empty and error views](#your-own-empty-and-error-views)). The list loads by itself when the connection returns.
+- A list opened with a filter but no keyword, such as online users, behaves like a plain list and shows **Connect to load …**.
+- Only an empty page from the server ends paging.
+- In the conversation list, a chat whose last message is your own unsent message shows a clock, or a failed icon once sending failed.
+
+### Search
+
+A **keyword** search in a list with no saved match while offline shows **Connect to search** with a second line, **Search needs an internet connection.** It doesn't call `onError`. When the connection returns, the search runs again.
+
+`CometChatSearch` shows the same **Connect to search** state when its search can't reach the server and nothing saved matches. A search showing that state runs again when the connection returns.
+
+Mention suggestions in the composer show saved users or members first. Typing a name after the `@` needs a connection.
+
+### Message list and threads
+
+- Saved history shows at once. Older and newer pages come from the cache first, then from the server.
+- A chat that was never saved, opened offline, shows **Connect to load messages** and calls `onError`. It loads by itself when the connection returns.
+- When the list reaches the end of the saved messages with no connection, it shows **Connect to load more** at that edge. Tap it to try again. On reconnect, each blocked edge loads once by itself, older first.
+- Jumping to a message, or starting from the first unread message, opens the list around that message from the cache when the device is offline.
+- When a refresh after reconnecting brings newer messages while the user is scrolled up, a **Jump to latest** pill appears. The reading position stays until the user taps it or scrolls to the bottom.
+- With media caching on (the default), images, videos, audio and files show the on-device copy first. With no copy and no connection, the bubble shows a placeholder with the file name, size and **Media will be available when back online**. It shows the media again when the connection returns. Tapping the placeholder while connected downloads the file. With media caching off, the bubble loads the media from its URL and shows no placeholder.
+
+### Composer and unsent messages
+
+- A text message or voice note sent while offline appears at once with a clock and **Not sent yet** under the bubble. It goes out automatically on reconnect.
+- Photos, videos, audio files and documents picked in the attachment tray are **not** queued. Each file starts uploading as soon as it's picked, and uploading needs a connection, so the message can't be sent until its files have uploaded. A tile whose upload failed shows a retry control: tap it to upload that file again once you're back online. If the file's saved copy is missing, the tile shows **File not saved. Remove it and add it again.** instead. With offline support on, the Chat SDK keeps the files staged in a chat's tray for that chat, so they come back when the chat is opened again. With `enableMultipleAttachments` set to `false`, a picked file is sent as a single media message instead, and is queued like a voice note.
+- An unsent message (waiting or failed) offers only **Retry**, **Delete** and, for text, **Copy** in its long-press menu. It offers no Reply, React, Edit, Pin, Save or Message info until it has been sent. The visibility settings you use for message options still apply.
+- A failed message shows **Not sent. Tap to retry** under the bubble in red. Tap that line to retry. In the Kotlin kit the failed status icon retries too; in Jetpack Compose, tapping the failed message retries it. Screen readers announce the action as "Retry".
+- **Retry** asks the Chat SDK to send the queued message again. A message that failed before it was queued is sent again as a new send. While a retry waits for the connection, the message shows **Not sent yet** again.
+- **Delete** removes the unsent message from the device.
+- If the message is no longer waiting to be sent (for example, it was removed after you left the group), Retry and Delete remove it from the list.
+- If the message is being sent at that moment, Retry and Delete change nothing and the list shows **Sending… try again in a moment**.
+- A full queue shows **Too many messages waiting to send**. A file that is too big for the offline media cache shows **File too large to send offline**. A queued message that the Chat SDK removes shows **1 unsent message was removed**.
+
+### Presence
+
+While the Chat SDK isn't connected, nobody shows as online: there's no online dot in the conversations, users or group members lists, and no "Online" or "last seen" subtitle in the message header. Presence shows again once the SDK is connected.
+
+### Pinned, Saved, Reactions and Notifications
+
+`CometChatPinnedMessages`, `CometChatSavedMessages`, the reaction list and `CometChatNotificationFeed` follow the same rules as the other lists. Rows cached on the device show first. With nothing saved and no connection, they show **Connect to load messages**, **Connect to load reactions** or **Connect to load notifications**. The reaction list keeps its tabs visible and shows **Connect to load reactions** below them. The pinned, saved, reaction and notification screens load by themselves when the connection returns.
+
+### Logout and user switch
+
+Cached data belongs to the logged-in user. The Chat SDK deletes the user's offline cache on logout and when a different user logs in. On logout or a user switch, the UI Kit also clears every list on screen before the next user's first frame. Any message still waiting to be sent is discarded, and a pending `CometChatUIKit` send answers with `ERROR_OFFLINE_MESSAGE_DISCARDED`. See [Send completions](#send-completions).
+
+## Offline states and texts
+
+Override any of these texts by adding the same key to your app's `res/values/strings.xml`, as described in [Localize](/ui-kit/android/localize#override-ui-kit-labels). Both kits read the same string resources, and every language the UI Kit ships includes them.
+
+| Text | Key | Where it appears |
+| --- | --- | --- |
+| Connect to load chats | `cometchat_connect_to_load_chats` | `CometChatConversations` with nothing saved, offline |
+| Connect to load users | `cometchat_connect_to_load_users` | `CometChatUsers` |
+| Connect to load groups | `cometchat_connect_to_load_groups` | `CometChatGroups` |
+| Connect to load members | `cometchat_connect_to_load_members` | `CometChatGroupMembers` |
+| Connect to load messages | `cometchat_connect_to_load_messages` | `CometChatMessageList`, `CometChatPinnedMessages`, `CometChatSavedMessages` |
+| Connect to load reactions | `cometchat_connect_to_load_reactions` | Reaction list |
+| Connect to load notifications | `cometchat_connect_to_load_notifications` | `CometChatNotificationFeed` |
+| Connect to search | `cometchat_connect_to_search` | Keyword search in a list, offline, no saved match |
+| Search needs an internet connection. | `cometchat_connect_to_search_subtitle` | Second line under "Connect to search" in a list |
+| Connect to search | `cometchat_connect_to_search_messages` | `CometChatSearch` |
+| Search needs an internet connection. | `cometchat_connect_to_search_messages_subtitle` | Second line under "Connect to search" in `CometChatSearch` |
+| Connect to load more | `cometchat_connect_to_load_more` | Message list and threads, at a blocked edge |
+| Jump to latest | `cometchat_jump_to_latest` | Message list pill |
+| Media will be available when back online | `cometchat_media_available_when_online` | Media placeholder |
+| Not sent yet | `cometchat_message_not_sent_yet` | Under a queued or sending message |
+| Not sent. Tap to retry | `cometchat_message_not_sent_tap_to_retry` | Under a failed message |
+| Retry | `cometchat_offline_retry` | Long-press option on an unsent message |
+| Sending… try again in a moment | `cometchat_sending_try_again` | Notice: Retry or Delete on a message being sent |
+| Too many messages waiting to send | `cometchat_queue_full` | Notice: the queue is full |
+| File too large to send offline | `cometchat_file_too_large_offline` | Notice: the file doesn't fit the offline media cache |
+| 1 unsent message was removed | `cometchat_unsent_message_removed` | Notice: the Chat SDK removed a queued message |
+| %d message was not sent / %d messages were not sent | `cometchat_messages_not_sent` (plurals) | Notice: unsent messages on screen were marked as not sent. They show **Not sent. Tap to retry** and can be retried |
+| %d unsent message was lost / %d unsent messages were lost | `cometchat_unsent_messages_lost` (plurals) | Notice: unsent messages were removed when the Chat SDK reset its cache. Send them again if needed |
+| Unsent messages may have been lost | `cometchat_unsent_messages_maybe_lost` | Notice: some unsent messages may not have been sent. Check the chat and send them again if needed |
+| File not saved. Remove it and add it again. | `cometchat_attachment_copy_missing` | Attachment tray tile whose saved file is missing |
+
+Notices show as a short toast, once each.
+
+## Errors and callbacks
+
+### When `onError` fires
+
+With offline support on, every list follows the same rules:
+
+- **Rows on screen, no connection:** the rows stay. No error view, no `onError`.
+- **Rows on screen, any other error:** the rows stay. `onError` fires once if the user or your app started the load: opening the screen, a refresh, a new keyword or a jump. A reload the UI Kit starts itself after a reconnect or a cache reset stays quiet, and so does a failed next page while scrolling.
+- **Nothing on screen, no connection:** the **Connect to load …** state shows, and `onError` fires once. In the Kotlin message list, `onError` doesn't fire when the error state is hidden (`setHideErrorState(true)`).
+- **Nothing on screen, any other error:** the error view shows, and `onError` fires. It has a Retry button, except in the Kotlin message list and reaction list.
+- **Keyword search offline with nothing saved:** **Connect to search** shows, with no `onError`.
+- **Empty server answer:** the normal empty view.
+
+### Send completions
+
+`CometChatUIKit.sendTextMessage`, `sendMediaMessage` and `sendCustomMessage` answer each send once:
+
+- `onSuccess` fires when the server accepts the message.
+- `onError` fires when sending fails for good.
+- A send that is only queued (offline) calls neither. It answers when the message is sent or fails.
+- If the user logs out, switches user, or the offline cache is reset before the message was sent, `onError` fires once with the error code `ERROR_OFFLINE_MESSAGE_DISCARDED`. Don't show an error for it: the message row going away is the only visible signal.
+
+```kotlin lines
+import android.util.Log
+import com.cometchat.chat.constants.CometChatConstants
+import com.cometchat.chat.core.CometChat
+import com.cometchat.chat.exceptions.CometChatException
+import com.cometchat.chat.models.TextMessage
+import com.cometchat.uikit.core.CometChatUIKit
+
+private const val TAG = "Chat"
+
+CometChatUIKit.sendTextMessage(textMessage, object : CometChat.CallbackListener() {
+ override fun onSuccess(sent: TextMessage) {
+ Log.d(TAG, "Sent: ${sent.id}")
+ }
+
+ override fun onError(e: CometChatException?) {
+ if (e?.code == CometChatConstants.Errors.ERROR_OFFLINE_MESSAGE_DISCARDED) {
+ // Logout, user switch or cache reset before it was sent. Don't show an error.
+ return
+ }
+ Log.e(TAG, "Send failed: ${e?.message}")
+ }
+})
+```
+
+The UI Kit's own senders (the composer, stickers and smart replies) handle this case themselves and show no error. The `MessageSent` event on `CometChatEvents.messageEvents` keeps its meaning: `IN_PROGRESS` once when the message is queued, `SUCCESS` when it is sent, and `ERROR` when it fails for good. A discarded message (logout, user switch or cache reset) fires no `ERROR`.
+
+### Pin and save
+
+Pinning, unpinning, saving and unsaving need a connection. On the device that made the change, the UI Kit updates the message, the Pinned and Saved screens and the `MessagePinned` / `MessageUnpinned` / `MessageSaved` / `MessageUnsaved` events when the call succeeds (its `onSuccess`). With Chat SDK 5.1.2, which this UI Kit brings in, the SDK sends no listener event back to that device. See [Pin & Save Messages](/ui-kit/android/guide-pin-and-save-messages#live-updates).
+
+### Offline events
+
+`CometChatEvents.offlineEvents` is a flow of `CometChatOfflineEvent`. It never emits while offline support is off.
+
+| Event | Fires when |
+| --- | --- |
+| `CometChatOfflineEvent.MessageSendStateChanged(message, state, reason)` | One of your own messages moves to a new `MessageSendState`: `SENDING`, `SENT` or `FAILED`. `reason` is the Chat SDK's `MessageFailureReason` when `state` is `FAILED`, otherwise `null`. Fires once per change. |
+| `CometChatOfflineEvent.OfflineCacheReset(reason, pendingMessagesLost)` | The Chat SDK reset its on-device cache. `pendingMessagesLost` is `-1` (`OfflineCacheResetListener.PENDING_COUNT_UNKNOWN`) when the SDK can't tell how many unsent messages were lost. |
+
+
+
+
+```kotlin lines
+import android.util.Log
+import androidx.lifecycle.lifecycleScope
+import com.cometchat.uikit.core.events.CometChatEvents
+import com.cometchat.uikit.core.events.CometChatOfflineEvent
+import kotlinx.coroutines.launch
+
+private const val TAG = "OfflineEvents"
+
+// In an Activity or Fragment
+lifecycleScope.launch {
+ CometChatEvents.offlineEvents.collect { event ->
+ when (event) {
+ is CometChatOfflineEvent.MessageSendStateChanged ->
+ Log.d(TAG, "Message ${event.message.muid} is now ${event.state}")
+ is CometChatOfflineEvent.OfflineCacheReset ->
+ Log.d(TAG, "Offline cache reset, unsent messages lost: ${event.pendingMessagesLost}")
+ }
+ }
+}
+```
+
+
+
+
+```kotlin lines
+import android.util.Log
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.LaunchedEffect
+import com.cometchat.uikit.core.events.CometChatEvents
+import com.cometchat.uikit.core.events.CometChatOfflineEvent
+
+private const val TAG = "OfflineEvents"
+
+@Composable
+fun OfflineEventsHandler() {
+ LaunchedEffect(Unit) {
+ CometChatEvents.offlineEvents.collect { event ->
+ when (event) {
+ is CometChatOfflineEvent.MessageSendStateChanged ->
+ Log.d(TAG, "Message ${event.message.muid} is now ${event.state}")
+ is CometChatOfflineEvent.OfflineCacheReset ->
+ Log.d(TAG, "Offline cache reset, unsent messages lost: ${event.pendingMessagesLost}")
+ }
+ }
+ }
+}
+```
+
+
+
+
+For the Chat SDK's own reasons and error codes, see the [Configuration & API Reference](/sdk/android/v5/offline-reference#error-codes).
+
+## Customization
+
+### Unsent message caption style
+
+`CometChatOfflineRowStyle` styles the **Not sent yet** and **Not sent. Tap to retry** lines under unsent messages. By default they use the theme's caption text, secondary text colour and error colour.
+
+
+
+
+| Property | Type | Default |
+| --- | --- | --- |
+| `textAppearance` | `@StyleRes Int` | Theme attribute `cometchatOfflineNotSentTextAppearance` (caption 1 regular) |
+| `notSentTextColor` | `@ColorInt Int` | Theme secondary text colour |
+| `failedTextColor` | `@ColorInt Int` | Theme attribute `cometchatOfflineFailedMessageTint` (error colour) |
+
+```kotlin lines
+import android.graphics.Color
+import com.cometchat.uikit.kotlin.presentation.messagelist.style.CometChatOfflineRowStyle
+
+messageList.setOfflineRowStyle(
+ CometChatOfflineRowStyle.default(context).copy(
+ notSentTextColor = Color.GRAY,
+ failedTextColor = Color.RED
+ )
+)
+```
+
+You can also set `cometchatOfflineNotSentTextAppearance` and `cometchatOfflineFailedMessageTint` in your app theme.
+
+
+
+
+| Property | Type | Default |
+| --- | --- | --- |
+| `textStyle` | `TextStyle` | `CometChatTheme.typography.caption1Regular` |
+| `notSentTextColor` | `Color` | `CometChatTheme.colorScheme.textColorSecondary` |
+| `failedTextColor` | `Color` | `CometChatTheme.colorScheme.errorColor` |
+
+```kotlin lines
+import androidx.compose.ui.graphics.Color
+import com.cometchat.uikit.compose.presentation.messagelist.style.CometChatOfflineRowStyle
+import com.cometchat.uikit.compose.presentation.messagelist.ui.CometChatMessageList
+
+CometChatMessageList(
+ user = user,
+ offlineRowStyle = CometChatOfflineRowStyle.default(
+ notSentTextColor = Color.Gray,
+ failedTextColor = Color.Red
+ )
+)
+```
+
+
+
+
+### Hide offline notices
+
+Hides the offline notice toasts, such as **Too many messages waiting to send** or **Unsent messages may have been lost**. Notices that aren't about one chat (**messages were not sent**, **unsent messages were lost** and **Unsent messages may have been lost**) are shown once, on the next Conversations or Message List that doesn't hide notices; if every list hides them, they aren't shown. A chat's own notices, such as **Too many messages waiting to send**, **File too large to send offline** or **Sending… try again in a moment**, aren't shown anywhere. The **Connect to load more** row and the **Jump to latest** pill still show. Default `false`.
+
+
+
+
+```kotlin lines
+messageList.setHideOfflineNotices(true)
+conversations.setHideOfflineNotices(true)
+```
+
+
+
+
+```kotlin lines
+CometChatMessageList(user = user, hideOfflineNotices = true)
+CometChatConversations(hideOfflineNotices = true)
+```
+
+
+
+
+### Your own empty and error views
+
+- If you set a custom error view (`setErrorView` / `errorView`), it shows instead of the UI Kit's **Connect to load …** state.
+- If you hide the error state (`setHideErrorState(true)` / `hideErrorState = true`), no offline state shows.
+- If you set a custom empty view (`setEmptyView` / `emptyView`), it shows instead of **Connect to search**. Hiding the empty state hides it.
+
+## With offline support turned off
+
+Apps that don't turn on offline support keep today's behaviour, with these exceptions in UI Kit 6.3.0:
+
+- **Chat SDK 5.1.2.** The UI Kit brings in Chat SDK 5.1.2, whether or not offline is on. If your unit tests stub `fetchNext(any())` or `fetchPrevious(any())` on SDK request classes such as `ConversationsRequest`, give the matcher a type: the SDK now has a second overload of these methods.
+- **Kotlin reaction list error state.** A reaction list that fails to load now shows its error text, or your custom error view, below the tabs instead of an empty sheet. Jetpack Compose already did this.
+
+## Limitations and known issues
+
+- Keyword search with no saved match, message information, call logs and AI Assistant chat history that was never loaded need a connection.
+- Edits, deletes, reactions, pins and saves aren't queued. They need a connection when the user makes them.
+- Files picked in the attachment tray need a connection to upload.
+- Media downloaded for offline use is stored unencrypted on the device. The message cache itself can be encrypted. See [Encrypt the Cache](/sdk/android/v5/offline-encryption).
+
+## Next steps
+
+
+
+ How the Chat SDK caches and syncs data
+
+
+ Every `OfflineConfig` option, listener and error code
+
+
+ The SDK's queue, retry and discard
+
+
+ Catch-up after reconnect and cache resets
+
+
+ Message list properties and styling
+
+
+ Override the offline texts
+
+
diff --git a/ui-kit/android/overview.mdx b/ui-kit/android/overview.mdx
index ba3199a35..9693c81a1 100644
--- a/ui-kit/android/overview.mdx
+++ b/ui-kit/android/overview.mdx
@@ -11,8 +11,9 @@ description: "Prebuilt, customizable UI components for chat & messaging, voice &
| Kotlin (XML Views) | `com.cometchat:chatuikit-kotlin-android` v6.x |
| Jetpack Compose | `com.cometchat:chatuikit-compose-android` v6.x |
| Shared core | `chatuikit-core` (ViewModels, repositories, data sources, events) |
-| Dependencies | `com.cometchat:chat-sdk-android` 5.0.7 (brought in by the UI Kit; don't add it yourself), `minSdk` 28 |
+| Dependencies | `com.cometchat:chat-sdk-android` 5.1.2 (brought in by the UI Kit; don't add it yourself), `minSdk` 28 |
| Calling | Optional — `com.cometchat:calls-sdk-android` |
+| Offline support | Optional, off by default, from UI Kit 6.3.0 — see [Offline Support](/ui-kit/android/offline-support) |
| Source | [GitHub](https://github.com/cometchat/cometchat-uikit-android) |
@@ -99,6 +100,15 @@ Or scan the QR code to install directly:
---
+## Upgrading from 6.2.x
+
+UI Kit 6.3.0 brings in Chat SDK 5.1.2. Two changes can affect your own code, whether or not you turn on [offline support](/ui-kit/android/offline-support):
+
+- **Pin, save and conversation-pin callbacks.** The SDK no longer calls `onMessagePinned`, `onMessageUnpinned`, `onMessageSaved`, `onMessageUnsaved`, `onConversationPinned` or `onConversationUnpinned` on the device that made the change. If your own UI updates from those callbacks, update it in the call's `onSuccess` instead, or observe the UI Kit's `MessagePinned` / `MessageUnpinned` / `MessageSaved` / `MessageUnsaved` events. The UI Kit's components already do this.
+- **Unit tests.** If your tests stub `fetchNext(any())` or `fetchPrevious(any())` on SDK request classes such as `ConversationsRequest`, give the matcher a type: the SDK now has a second overload of these methods.
+
+---
+
## Resources
diff --git a/ui-kit/android/pinned-messages.mdx b/ui-kit/android/pinned-messages.mdx
index 47e63f85e..dcc243a64 100644
--- a/ui-kit/android/pinned-messages.mdx
+++ b/ui-kit/android/pinned-messages.mdx
@@ -134,7 +134,7 @@ CometChatPinnedMessages(
### SDK Events (Real-Time, Automatic)
-The list keeps itself up to date — when the logged-in user pins or unpins a message anywhere in the app, the row is added or removed without a refetch, via the `MessagePinned` / `MessageUnpinned` events on the UI Kit event bus; see [Events](/ui-kit/android/events). Pins made by other participants appear when the list is next opened or refetched (server-side real-time delivery for pin events is pending rollout).
+The list keeps itself up to date — when the logged-in user pins or unpins a message anywhere in the app, the row is added or removed without a refetch, via the `MessagePinned` / `MessageUnpinned` events on the UI Kit event bus; see [Events](/ui-kit/android/events). Pins and unpins by other participants, and from the user's other devices, update the list live as well.
## Functionality
diff --git a/ui-kit/android/saved-messages.mdx b/ui-kit/android/saved-messages.mdx
index f98205673..6f3cce917 100644
--- a/ui-kit/android/saved-messages.mdx
+++ b/ui-kit/android/saved-messages.mdx
@@ -125,7 +125,7 @@ CometChatSavedMessages(
### SDK Events (Real-Time, Automatic)
-The list keeps itself up to date on this device — saving or unsaving a message anywhere in the app adds or removes the row without a refetch, via the `MessageSaved` / `MessageUnsaved` events on the UI Kit event bus; see [Events](/ui-kit/android/events). Changes made on the user's other devices appear when the list is next opened or refetched (server-side real-time delivery for save events is pending rollout).
+The list keeps itself up to date on this device — saving or unsaving a message anywhere in the app adds or removes the row without a refetch, via the `MessageSaved` / `MessageUnsaved` events on the UI Kit event bus; see [Events](/ui-kit/android/events). Saves and unsaves made on the user's other devices update the list live as well.
## Functionality
diff --git a/ui-kit/android/threaded-messages-header.mdx b/ui-kit/android/threaded-messages-header.mdx
index 715e74199..074cf8797 100644
--- a/ui-kit/android/threaded-messages-header.mdx
+++ b/ui-kit/android/threaded-messages-header.mdx
@@ -105,6 +105,8 @@ The component listens to SDK events internally via its ViewModel. No manual setu
| Message deleted | Updates the parent message bubble |
| Reply count changed | Updates the reply count indicator |
+With [offline support](/ui-kit/android/offline-support) on, the reply count includes your own replies that haven't been sent yet: it goes up once when a reply is queued, and down when you delete an unsent reply.
+
---
## Functionality
diff --git a/ui-kit/android/troubleshooting.mdx b/ui-kit/android/troubleshooting.mdx
index 8922b085d..f3c580e19 100644
--- a/ui-kit/android/troubleshooting.mdx
+++ b/ui-kit/android/troubleshooting.mdx
@@ -9,7 +9,7 @@ description: "Common failure modes and fixes for the CometChat Android V6 UI Kit
| --- | --- |
| Page type | Troubleshooting reference |
| Packages | `com.cometchat:chatuikit-kotlin-android` · `com.cometchat:chatuikit-compose-android` |
-| Scope | All CometChat Android UI Kit v6 issues — initialization, theming, components, calling, extensions, AI features, localization, sound, events, methods, text formatters |
+| Scope | All CometChat Android UI Kit v6 issues — initialization, theming, components, offline support, calling, extensions, AI features, localization, sound, events, methods, text formatters |
| When to reference | When a component fails to render, data is missing, styling doesn't apply, or a feature doesn't appear |
@@ -68,12 +68,23 @@ description: "Common failure modes and fixes for the CometChat Android V6 UI Kit
| `disableSoundForMessages(true)` has no effect | Called after component starts loading | Call `disableSoundForMessages(true)` before the component starts loading |
| Filters not applied | Builder not set on component | Ensure you call the appropriate `set*RequestBuilder(builder)` method on the component instance after creating and configuring the builder |
| ProGuard/R8 strips CometChat classes | Missing keep rules for CometChat | Add `-keep class com.cometchat.** { *; }` to your `proguard-rules.pro` file |
-| Jetifier errors during build | Another dependency still uses the legacy support libraries | UI Kit 6.2.0 builds without Jetifier, so you don't need it for CometChat. Add `android.enableJetifier=true` to `gradle.properties` only if another dependency uses the legacy support libraries (AGP 9 deprecates it and logs a warning) |
+| Jetifier errors during build | Another dependency still uses the legacy support libraries | UI Kit 6.2.0 and later build without Jetifier, so you don't need it for CometChat. Add `android.enableJetifier=true` to `gradle.properties` only if another dependency uses the legacy support libraries (AGP 9 deprecates it and logs a warning) |
| `CometChatConversationList` not found | Component renamed in v6 | Use `CometChatConversations` instead of `CometChatConversationList` |
| `CometChatThreadedMessagesHeader` not found | Component renamed in v5 | Use `CometChatThreadHeader` instead |
---
+## Offline Support
+
+| Symptom | Cause | Fix |
+| --- | --- | --- |
+| Offline support does nothing | No user is logged in yet, or `encryption(true)` is set without the SQLCipher engine, so the cache doesn't open and the app works online only | Offline support starts after login. With encryption on, add `net.zetetic:sqlcipher-android` to your app. Check `CometChat.isOfflineEnabled()` after login. See [Offline Support](/ui-kit/android/offline-support#requirements) |
+| A list shows nothing offline though it was opened before | The component uses a custom repository | Saved data shows first only with the UI Kit's own repository. See [Customization: ViewModel & Data](/ui-kit/android/customization-viewmodel-data#providing-a-custom-viewmodel) |
+| Unit tests don't compile after upgrading: `fetchNext(any())` is ambiguous | Chat SDK 5.1.2 adds a second overload of `fetchNext` and `fetchPrevious` | Give the matcher a type |
+| Your own pin or save UI doesn't update until the screen is reopened | From Chat SDK 5.1.2, the SDK sends no pin or save callback to the device that made the change | Update the UI in the call's `onSuccess`, or observe the UI Kit's `MessagePinned` / `MessageUnpinned` / `MessageSaved` / `MessageUnsaved` events. See [Upgrading from 6.2.x](/ui-kit/android/overview#upgrading-from-62x) |
+
+---
+
## Calling
| Symptom | Cause | Fix |
diff --git a/ui-kit/android/upgrading-from-v5.mdx b/ui-kit/android/upgrading-from-v5.mdx
index eb995fbe0..5ddc987b8 100644
--- a/ui-kit/android/upgrading-from-v5.mdx
+++ b/ui-kit/android/upgrading-from-v5.mdx
@@ -59,7 +59,7 @@ dependencies {
```groovy title="build.gradle"
dependencies {
- implementation 'com.cometchat:chatuikit-kotlin-android:6.2.0'
+ implementation 'com.cometchat:chatuikit-kotlin-android:6.3.0'
// chatuikit-core is pulled in transitively
}
```
@@ -72,7 +72,7 @@ dependencies {
implementation platform('androidx.compose:compose-bom:2025.06.00')
implementation 'androidx.compose.material3:material3'
- implementation 'com.cometchat:chatuikit-compose-android:6.2.0'
+ implementation 'com.cometchat:chatuikit-compose-android:6.3.0'
// chatuikit-core is pulled in transitively
}
```