Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
c89639f
docs(android): add Offline Support pages for the Android SDK v5.1.0
adityagokula2210 Oct 28, 2026
12d6c95
docs(android): use the 5.1.0 offline listeners across the v5 SDK pages
adityagokula2210 Oct 28, 2026
8e7176b
docs(android-v5): remove outdated v2-to-v3 migration callout from Setup
adityagokula2210 Oct 29, 2026
a74cac3
docs(android-v5): point Setup, Overview and v4 migration at SDK 5.1.0
adityagokula2210 Oct 29, 2026
a14f0f7
docs(android-v5): own pin, save and conversation pin also fire their …
adityagokula2210 Oct 30, 2026
de5f979
docs(android-v5): clarify the v4 breaking-changes callout on the over…
adityagokula2210 Oct 31, 2026
4d1f2d8
docs(android-v5): say the new send and getConversation listeners need…
adityagokula2210 Oct 31, 2026
0ea921d
docs(android-v5): offline overview — single-item cache reads, outbox …
adityagokula2210 Oct 31, 2026
2c3e420
docs(android-v5): offline enable — when isOfflineEnabled is false, Gr…
adityagokula2210 Nov 1, 2026
59959c7
docs(android-v5): offline enable — drop internal server-side behaviou…
adityagokula2210 Nov 1, 2026
17d8526
docs(android-v5): offline enable — remove the settings-file section
adityagokula2210 Nov 1, 2026
412bbc4
docs(android-v5): show cached data — overlapping fetches, server erro…
adityagokula2210 Nov 1, 2026
5639fd1
docs(android-v5): send while offline — lifecycle, auto-send condition…
adityagokula2210 Nov 1, 2026
bc5aad2
docs(android-v5): stay in sync — when sync runs, conversation removal…
adityagokula2210 Nov 1, 2026
5a54249
docs(android-v5): media caching — download error codes, re-sign condi…
adityagokula2210 Nov 1, 2026
882a2a4
docs(android-v5): encrypt the cache — random key, unsent messages on …
adityagokula2210 Nov 1, 2026
e4bcbe6
docs(android-v5): offline reference — missing APIs and error codes, c…
adityagokula2210 Nov 1, 2026
789c2ce
docs(android-v5): shared deprecation callouts — offline onError notic…
adityagokula2210 Nov 1, 2026
509caa7
docs(android-v5): connection status — only MessageSentListener sends …
adityagokula2210 Nov 1, 2026
81ec6e5
docs(android-v5): send message — onError can mean queued, onMessagePe…
adityagokula2210 Nov 1, 2026
e8725a9
docs(android-v5): upload files — uploads never resume on their own, o…
adityagokula2210 Nov 1, 2026
a4d32f2
docs(android-v5): receive messages — onMessagesSynced carries updates…
adityagokula2210 Nov 1, 2026
dbbb348
docs(android-v5): real-time listeners — onMessagesSynced carries upda…
adityagokula2210 Nov 1, 2026
116af0d
docs(android-v5): real-time listeners — list all six listeners, add a…
adityagokula2210 Nov 1, 2026
94b9d71
docs(android-v5): additional message filtering — server-only filters,…
adityagokula2210 Nov 1, 2026
80772aa
docs(android-v5): threaded messages — thread reads cached with UID an…
adityagokula2210 Nov 1, 2026
8573d8c
docs(android-v5): thread subscription — participatedByMe cache source…
adityagokula2210 Nov 1, 2026
eb9f07d
docs(android-v5): mentions — onError can mean queued, pending log wor…
adityagokula2210 Nov 1, 2026
606122c
docs(android-v5): reactions — one direction per request, replayed pag…
adityagokula2210 Nov 1, 2026
86efed8
docs(android-v5): edit and delete message — cache update after onSucc…
adityagokula2210 Nov 1, 2026
3df9309
docs(android-v5): AI moderation — onMessagePending in the flow, onErr…
adityagokula2210 Nov 1, 2026
129545f
docs(android-v5): retrieve-conversations offline table and getConvers…
adityagokula2210 Nov 1, 2026
4356ed2
docs(android-v5): retrieve-users offline table adds searchIn
adityagokula2210 Nov 1, 2026
328ab7f
docs(android-v5): block-users cached page comes from the blocked-user…
adityagokula2210 Nov 1, 2026
2526c95
docs(android-v5): retrieve-group-members documents setStatus
adityagokula2210 Nov 1, 2026
22a9edf
docs(android-v5): group-kick-member documents banned-members setScopes
adityagokula2210 Nov 1, 2026
7d9a6cf
docs(android-v5): delete-group needs a connection; cache clears on th…
adityagokula2210 Nov 1, 2026
3742378
docs(android-v5): campaigns offline section no longer parents the fie…
adityagokula2210 Nov 1, 2026
11ec52b
docs(android-v5): release review fixes — SCHEMA_RESET reason, two bro…
adityagokula2210 Nov 1, 2026
d0097ec
docs(android-v5): reactions real-time section uses MessageListener an…
adityagokula2210 Nov 1, 2026
2511893
docs(android-v5): logout wipes the cache; thread flag is cached offli…
adityagokula2210 Nov 2, 2026
681e853
docs(android-v5): address review — onMessagePending scope, Kotlin sig…
adityagokula2210 Nov 2, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -4125,6 +4125,19 @@
"sdk/android/v5/reactions"
]
},
{
"group": "Offline Support",
"pages": [
"sdk/android/v5/offline-overview",
"sdk/android/v5/offline-enable",
"sdk/android/v5/offline-cached-data",
"sdk/android/v5/offline-send",
"sdk/android/v5/offline-sync",
"sdk/android/v5/offline-media-caching",
"sdk/android/v5/offline-encryption",
"sdk/android/v5/offline-reference"
]
},
"sdk/android/v5/calling-overview",
{
"group": "Users",
Expand Down
40 changes: 40 additions & 0 deletions sdk/android/v5/additional-message-filtering.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
```java
String UID = "cometchat-uid-1";

MessagesRequest messagesRequest = new MessagesRequest.MessagesRequestBuilder()

Check warning on line 40 in sdk/android/v5/additional-message-filtering.mdx

View check run for this annotation

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

sdk/android/v5/additional-message-filtering.mdx#L40

Did you really mean 'messagesRequest'?
.setLimit(50)
.setUID(UID)
.build();
Expand All @@ -61,7 +61,7 @@
```kotlin
val UID = "cometchat-uid-1"

val messagesRequest = MessagesRequestBuilder()

Check warning on line 64 in sdk/android/v5/additional-message-filtering.mdx

View check run for this annotation

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

sdk/android/v5/additional-message-filtering.mdx#L64

Did you really mean 'messagesRequest'?
.setLimit(50)
.setUID(UID)
.build()
Expand Down Expand Up @@ -92,7 +92,7 @@
<Tabs>
<Tab title="Java">
```java
MessagesRequest messagesRequest = new MessagesRequest.MessagesRequestBuilder()

Check warning on line 95 in sdk/android/v5/additional-message-filtering.mdx

View check run for this annotation

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

sdk/android/v5/additional-message-filtering.mdx#L95

'messagesRequest' is repeated!

Check warning on line 95 in sdk/android/v5/additional-message-filtering.mdx

View check run for this annotation

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

sdk/android/v5/additional-message-filtering.mdx#L95

Did you really mean 'messagesRequest'?
.setUID("cometchat-uid-1")
.setLimit(50)
.build();
Expand All @@ -102,7 +102,7 @@

<Tab title="Kotlin">
```kotlin
val messagesRequest = MessagesRequestBuilder()

Check warning on line 105 in sdk/android/v5/additional-message-filtering.mdx

View check run for this annotation

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

sdk/android/v5/additional-message-filtering.mdx#L105

Did you really mean 'messagesRequest'?
.setUID("cometchat-uid-1")
.setLimit(50)
.build()
Expand All @@ -118,12 +118,12 @@

You can achieve this using the `setGUID()` method. This method takes the GUID of a group for which the conversations are to be fetched. Passing a valid GUID to this method will return all the messages that are a part of the group conversation. Please note that the logged-in user must be a member of the group to fetch the messages for that group.

MessagesRequest messagesRequest = new MessagesRequest.MessagesRequestBuilder() .setGUID("cometchat-guid-1") .setLimit(50) .build();

Check warning on line 121 in sdk/android/v5/additional-message-filtering.mdx

View check run for this annotation

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

sdk/android/v5/additional-message-filtering.mdx#L121

'messagesRequest' is repeated!

Check warning on line 121 in sdk/android/v5/additional-message-filtering.mdx

View check run for this annotation

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

sdk/android/v5/additional-message-filtering.mdx#L121

Did you really mean 'messagesRequest'?

<Tabs>
<Tab title="Java">
```java
MessagesRequest messagesRequest = new MessagesRequest.MessagesRequestBuilder()

Check warning on line 126 in sdk/android/v5/additional-message-filtering.mdx

View check run for this annotation

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

sdk/android/v5/additional-message-filtering.mdx#L126

'messagesRequest' is repeated!

Check warning on line 126 in sdk/android/v5/additional-message-filtering.mdx

View check run for this annotation

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

sdk/android/v5/additional-message-filtering.mdx#L126

Did you really mean 'messagesRequest'?
.setGUID("cometchat-guid-1")
.setLimit(50)
.build();
Expand All @@ -133,7 +133,7 @@

<Tab title="Kotlin">
```kotlin
val messagesRequest = MessagesRequestBuilder()

Check warning on line 136 in sdk/android/v5/additional-message-filtering.mdx

View check run for this annotation

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

sdk/android/v5/additional-message-filtering.mdx#L136

Did you really mean 'messagesRequest'?
.setGUID("cometchat-guid-1")
.setLimit(50)
.build()
Expand All @@ -154,7 +154,7 @@
```java
String UID = "cometchat-uid-1";

MessagesRequest messagesRequest = new MessagesRequest.MessagesRequestBuilder()

Check warning on line 157 in sdk/android/v5/additional-message-filtering.mdx

View check run for this annotation

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

sdk/android/v5/additional-message-filtering.mdx#L157

Did you really mean 'messagesRequest'?
.setMessageId(100)
.setLimit(50)
.setUID(UID)
Expand All @@ -180,7 +180,7 @@
```kotlin
val UID = "cometchat-uid-1"

val messagesRequest = MessagesRequestBuilder()

Check warning on line 183 in sdk/android/v5/additional-message-filtering.mdx

View check run for this annotation

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

sdk/android/v5/additional-message-filtering.mdx#L183

Did you really mean 'messagesRequest'?
.setMessageId(100)
.setLimit(50)
.setUID(UID)
Expand Down Expand Up @@ -217,7 +217,7 @@
```java
String UID = "cometchat-uid-1";

MessagesRequest messagesRequest = new MessagesRequest.MessagesRequestBuilder()

Check warning on line 220 in sdk/android/v5/additional-message-filtering.mdx

View check run for this annotation

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

sdk/android/v5/additional-message-filtering.mdx#L220

Did you really mean 'messagesRequest'?
.setTimestamp(1512687363)
.setLimit(50)
.setUID(UID)
Expand All @@ -243,7 +243,7 @@
```kotlin
val UID = "cometchat-uid-1"

val messagesRequest = MessagesRequestBuilder()

Check warning on line 246 in sdk/android/v5/additional-message-filtering.mdx

View check run for this annotation

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

sdk/android/v5/additional-message-filtering.mdx#L246

Did you really mean 'messagesRequest'?
.setTimestamp(1512687363)
.setLimit(50)
.setUID(UID)
Expand Down Expand Up @@ -280,7 +280,7 @@
```java
String UID = "cometchat-uid-1";

MessagesRequest messagesRequest = new MessagesRequest.MessagesRequestBuilder()

Check warning on line 283 in sdk/android/v5/additional-message-filtering.mdx

View check run for this annotation

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

sdk/android/v5/additional-message-filtering.mdx#L283

Did you really mean 'messagesRequest'?
.setUnread(true)
.setLimit(50)
.setUID(UID)
Expand All @@ -306,7 +306,7 @@
```kotlin
val UID = "cometchat-uid-1"

val messagesRequest = MessagesRequestBuilder()

Check warning on line 309 in sdk/android/v5/additional-message-filtering.mdx

View check run for this annotation

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

sdk/android/v5/additional-message-filtering.mdx#L309

Did you really mean 'messagesRequest'?
.setUnread(true)
.setLimit(50)
.setUID(UID)
Expand Down Expand Up @@ -343,7 +343,7 @@
```java
String UID = "cometchat-uid-1";

MessagesRequest messagesRequest = new MessagesRequest.MessagesRequestBuilder()

Check warning on line 346 in sdk/android/v5/additional-message-filtering.mdx

View check run for this annotation

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

sdk/android/v5/additional-message-filtering.mdx#L346

Did you really mean 'messagesRequest'?
.hideMessagesFromBlockedUsers(true)
.setUID(UID)
.setLimit(50)
Expand All @@ -369,7 +369,7 @@
```kotlin
val UID = "cometchat-uid-1"

val messagesRequest = MessagesRequestBuilder()

Check warning on line 372 in sdk/android/v5/additional-message-filtering.mdx

View check run for this annotation

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

sdk/android/v5/additional-message-filtering.mdx#L372

Did you really mean 'messagesRequest'?
.hideMessagesFromBlockedUsers(true)
.setUID(UID)
.setLimit(50)
Expand Down Expand Up @@ -406,7 +406,7 @@
```java
String UID = "cometchat-uid-1";

MessagesRequest messagesRequest = new MessagesRequest.MessagesRequestBuilder()

Check warning on line 409 in sdk/android/v5/additional-message-filtering.mdx

View check run for this annotation

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

sdk/android/v5/additional-message-filtering.mdx#L409

Did you really mean 'messagesRequest'?
.setUpdatedAfter(1514321321)
.setLimit(50)
.setUID(UID)
Expand All @@ -432,7 +432,7 @@
```kotlin
val UID = "cometchat-uid-1"

val messagesRequest = MessagesRequestBuilder()

Check warning on line 435 in sdk/android/v5/additional-message-filtering.mdx

View check run for this annotation

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

sdk/android/v5/additional-message-filtering.mdx#L435

Did you really mean 'messagesRequest'?
.setUpdatedAfter(1514321321)
.setLimit(50)
.setUID(UID)
Expand Down Expand Up @@ -462,14 +462,16 @@

*In other words, how do I fetch messages that have been updated after a particular date or time*

This can be achieved easily by setting the updatesOnly parameter to true. To do so, you can use the updatesOnly() method. This method takes a boolean input and can be used with the `setUpdatedAfter()` method to get jus the updated messages and not the messages sent/received after the specified time. This method cannot be used independently and always needs to be used with the `setUpdatedAfter()` method.

Check warning on line 465 in sdk/android/v5/additional-message-filtering.mdx

View check run for this annotation

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

sdk/android/v5/additional-message-filtering.mdx#L465

Did you really mean 'updatesOnly'?

<Note>With offline support on, this filter is answered by the server only; the cached page is empty.</Note>

<Tabs>
<Tab title="Java (User)">
```java
String UID = "cometchat-uid-1";

MessagesRequest messagesRequest = new MessagesRequest.MessagesRequestBuilder()

Check warning on line 474 in sdk/android/v5/additional-message-filtering.mdx

View check run for this annotation

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

sdk/android/v5/additional-message-filtering.mdx#L474

Did you really mean 'messagesRequest'?
.setUpdatedAfter(1514321321)
.updatesOnly(true)
.setLimit(50)
Expand Down Expand Up @@ -497,7 +499,7 @@
```kotlin
val UID = "cometchat-uid-1"

val messagesRequest = MessagesRequestBuilder()

Check warning on line 502 in sdk/android/v5/additional-message-filtering.mdx

View check run for this annotation

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

sdk/android/v5/additional-message-filtering.mdx#L502

Did you really mean 'messagesRequest'?
.setUpdatedAfter(1514321321)
.updatesOnly(true)
.setLimit(50)
Expand Down Expand Up @@ -539,7 +541,7 @@
categories.add("message");
categories.add("custom");

MessagesRequest messagesRequest = new MessagesRequest.MessagesRequestBuilder()

Check warning on line 544 in sdk/android/v5/additional-message-filtering.mdx

View check run for this annotation

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

sdk/android/v5/additional-message-filtering.mdx#L544

Did you really mean 'messagesRequest'?
.setCategories(categories)
.setLimit(50)
.setGUID(GUID)
Expand Down Expand Up @@ -571,7 +573,7 @@
categories.add("message")
categories.add("custom")

val messagesRequest = MessagesRequestBuilder()

Check warning on line 576 in sdk/android/v5/additional-message-filtering.mdx

View check run for this annotation

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

sdk/android/v5/additional-message-filtering.mdx#L576

Did you really mean 'messagesRequest'?
.setCategories(categories)
.setLimit(50)
.setUID(UID)
Expand Down Expand Up @@ -620,7 +622,7 @@
types.add("audio");
types.add("file");

MessagesRequest messagesRequest = new MessagesRequest.MessagesRequestBuilder()

Check warning on line 625 in sdk/android/v5/additional-message-filtering.mdx

View check run for this annotation

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

sdk/android/v5/additional-message-filtering.mdx#L625

Did you really mean 'messagesRequest'?
.setCategories(categories)
.setTypes(types)
.setLimit(50)
Expand Down Expand Up @@ -662,7 +664,7 @@
types.add("audio")
types.add("file")

val messagesRequest = MessagesRequestBuilder()

Check warning on line 667 in sdk/android/v5/additional-message-filtering.mdx

View check run for this annotation

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

sdk/android/v5/additional-message-filtering.mdx#L667

Did you really mean 'messagesRequest'?
.setCategories(categories)
.setTypes(types)
.setLimit(50)
Expand Down Expand Up @@ -708,7 +710,7 @@
```java
String UID = "cometchat-uid-1";

MessagesRequest messagesRequest = new MessagesRequest.MessagesRequestBuilder()

Check warning on line 713 in sdk/android/v5/additional-message-filtering.mdx

View check run for this annotation

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

sdk/android/v5/additional-message-filtering.mdx#L713

Did you really mean 'messagesRequest'?
.setLimit(50)
.setUID(UID)
.setParentMessageId(100)
Expand All @@ -733,7 +735,7 @@
<Tab title="Kotlin (User)">
```kotlin
val UID = "cometchat-uid-1"
val messagesRequest = MessagesRequestBuilder()

Check warning on line 738 in sdk/android/v5/additional-message-filtering.mdx

View check run for this annotation

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

sdk/android/v5/additional-message-filtering.mdx#L738

Did you really mean 'messagesRequest'?
.setLimit(50)
.setUID(UID)
.setParentMessageId(100)
Expand All @@ -746,7 +748,7 @@
```kotlin
val GUID = "cometchat-guid-1"

val messagesRequest = MessagesRequestBuilder()

Check warning on line 751 in sdk/android/v5/additional-message-filtering.mdx

View check run for this annotation

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

sdk/android/v5/additional-message-filtering.mdx#L751

Did you really mean 'messagesRequest'?
.setLimit(50)
.setGUID(GUID)
.setParentMessageId(100)
Expand Down Expand Up @@ -783,7 +785,7 @@
```java
String GUID = "cometchat-guid-1";

MessagesRequest messagesRequest = new MessagesRequest.MessagesRequestBuilder()

Check warning on line 788 in sdk/android/v5/additional-message-filtering.mdx

View check run for this annotation

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

sdk/android/v5/additional-message-filtering.mdx#L788

Did you really mean 'messagesRequest'?
.setLimit(50)
.hideReplies(true)
.setGUID(GUID)
Expand All @@ -809,7 +811,7 @@
```kotlin
val GUID = "cometchat-guid-1"

val messagesRequest = MessagesRequestBuilder()

Check warning on line 814 in sdk/android/v5/additional-message-filtering.mdx

View check run for this annotation

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

sdk/android/v5/additional-message-filtering.mdx#L814

Did you really mean 'messagesRequest'?
.setLimit(50)
.hideReplies(true)
.setGUID(GUID)
Expand Down Expand Up @@ -844,7 +846,7 @@
```java
String GUID = "cometchat-guid-1";

MessagesRequest messagesRequest = new MessagesRequest.MessagesRequestBuilder()

Check warning on line 849 in sdk/android/v5/additional-message-filtering.mdx

View check run for this annotation

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

sdk/android/v5/additional-message-filtering.mdx#L849

Did you really mean 'messagesRequest'?
.setLimit(50)
.setGUID(GUID)
.hideDeletedMessages(true)
Expand All @@ -870,7 +872,7 @@
```kotlin
val GUID = "cometchat-guid-1"

val messagesRequest = MessagesRequestBuilder()

Check warning on line 875 in sdk/android/v5/additional-message-filtering.mdx

View check run for this annotation

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

sdk/android/v5/additional-message-filtering.mdx#L875

Did you really mean 'messagesRequest'?
.setLimit(50)
.setGUID(GUID)
.hideDeletedMessages(true)
Expand Down Expand Up @@ -905,7 +907,7 @@
```java
String GUID = "cometchat-guid-1";

MessagesRequest messagesRequest = new MessagesRequest.MessagesRequestBuilder()

Check warning on line 910 in sdk/android/v5/additional-message-filtering.mdx

View check run for this annotation

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

sdk/android/v5/additional-message-filtering.mdx#L910

Did you really mean 'messagesRequest'?
.setLimit(50)
.setGUID(GUID)
.hideQuotedMessages(true)
Expand All @@ -931,7 +933,7 @@
```kotlin
val GUID = "cometchat-guid-1"

val messagesRequest = MessagesRequestBuilder()

Check warning on line 936 in sdk/android/v5/additional-message-filtering.mdx

View check run for this annotation

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

sdk/android/v5/additional-message-filtering.mdx#L936

Did you really mean 'messagesRequest'?
.setLimit(50)
.setGUID(GUID)
.hideQuotedMessages(true)
Expand Down Expand Up @@ -970,7 +972,7 @@
val tags: MutableList<String> = ArrayList()
tags.add("pinned")

val messagesRequest = MessagesRequestBuilder()

Check warning on line 975 in sdk/android/v5/additional-message-filtering.mdx

View check run for this annotation

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

sdk/android/v5/additional-message-filtering.mdx#L975

Did you really mean 'messagesRequest'?
.setLimit(50)
.setUID(UID)
.setTags(tags)
Expand Down Expand Up @@ -1005,7 +1007,7 @@
```kotlin
val UID = "cometchat-uid-1"

val messagesRequest = MessagesRequestBuilder()

Check warning on line 1010 in sdk/android/v5/additional-message-filtering.mdx

View check run for this annotation

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

sdk/android/v5/additional-message-filtering.mdx#L1010

Did you really mean 'messagesRequest'?
.setLimit(50)
.setUID(UID)
.withTags(true)
Expand All @@ -1022,6 +1024,8 @@

In order to do this, you can use the `hasLinks()` method. This method accepts boolean as input. When set to `true` , the SDK will fetch messages which have links in the text. The default value for this parameter is `false`.

<Note>With offline support on, this filter is answered by the server only; the cached page is empty.</Note>

<Note>

This feature is only available with `Conversation & Advanced Search`. The `Conversation & Advanced Search` is only available in `Advanced` & `Custom` [plans](https://www.cometchat.com/pricing). If you're already on one of these plans, please enable the `Conversation & Advanced Search` from [CometChat Dashboard](https://app.cometchat.com) (Open your app, navigate to Chats -> Settings -> General Configuration)
Expand All @@ -1046,7 +1050,7 @@
```kotlin
val UID = "cometchat-uid-1"

val messagesRequest = MessagesRequestBuilder()

Check warning on line 1053 in sdk/android/v5/additional-message-filtering.mdx

View check run for this annotation

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

sdk/android/v5/additional-message-filtering.mdx#L1053

Did you really mean 'messagesRequest'?
.setLimit(50)
.setUID(UID)
.hasLinks(true)
Expand Down Expand Up @@ -1087,7 +1091,7 @@
```kotlin
val UID = "cometchat-uid-1"

val messagesRequest = MessagesRequestBuilder()

Check warning on line 1094 in sdk/android/v5/additional-message-filtering.mdx

View check run for this annotation

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

sdk/android/v5/additional-message-filtering.mdx#L1094

Did you really mean 'messagesRequest'?
.setLimit(50)
.setUID(UID)
.hasAttachments(true)
Expand Down Expand Up @@ -1128,7 +1132,7 @@
```kotlin
val UID = "cometchat-uid-1"

val messagesRequest = MessagesRequestBuilder()

Check warning on line 1135 in sdk/android/v5/additional-message-filtering.mdx

View check run for this annotation

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

sdk/android/v5/additional-message-filtering.mdx#L1135

Did you really mean 'messagesRequest'?
.setLimit(50)
.setUID(UID)
.hasReactions(true)
Expand Down Expand Up @@ -1169,7 +1173,7 @@
```kotlin
val UID = "cometchat-uid-1"

val messagesRequest = MessagesRequestBuilder()

Check warning on line 1176 in sdk/android/v5/additional-message-filtering.mdx

View check run for this annotation

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

sdk/android/v5/additional-message-filtering.mdx#L1176

Did you really mean 'messagesRequest'?
.setLimit(50)
.setUID(UID)
.hasMentions(true)
Expand Down Expand Up @@ -1211,10 +1215,10 @@
<Tab title="Kotlin">
```kotlin
val UID = "cometchat-uid-1"
val mentionedUIDs: MutableList<String> = ArrayList()

Check warning on line 1218 in sdk/android/v5/additional-message-filtering.mdx

View check run for this annotation

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

sdk/android/v5/additional-message-filtering.mdx#L1218

Did you really mean 'mentionedUIDs'?
mentionedUIDs.add("cometchat-uid-1")

val messagesRequest = MessagesRequestBuilder()

Check warning on line 1221 in sdk/android/v5/additional-message-filtering.mdx

View check run for this annotation

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

sdk/android/v5/additional-message-filtering.mdx#L1221

Did you really mean 'messagesRequest'?
.setLimit(50)
.setUID(UID)
.setMentionedUIDs(mentionedUIDs)
Expand Down Expand Up @@ -1257,11 +1261,11 @@
<Tab title="Kotlin">
```kotlin
val UID = "cometchat-uid-1"
val attachmentTypes: MutableList<AttachmentType> = ArrayList()

Check warning on line 1264 in sdk/android/v5/additional-message-filtering.mdx

View check run for this annotation

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

sdk/android/v5/additional-message-filtering.mdx#L1264

Did you really mean 'attachmentTypes'?
attachmentTypes.add(AttachmentType.FILE)
attachmentTypes.add(AttachmentType.IMAGE)

val messagesRequest = MessagesRequestBuilder()

Check warning on line 1268 in sdk/android/v5/additional-message-filtering.mdx

View check run for this annotation

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

sdk/android/v5/additional-message-filtering.mdx#L1268

Did you really mean 'messagesRequest'?
.setLimit(50)
.setUID(UID)
.setAttachmentTypes(attachmentTypes)
Expand All @@ -1278,6 +1282,8 @@

This can be achieved by setting the pinned flag to true using the `setPinned()` method. Setting a `UID` or a `GUID` is mandatory for this filter — pinned messages are always scoped to a single conversation. The returned list is sorted by the time of pinning, most recently pinned first.

<Note>With offline support on, the pinned list is served from the cache first, then from the server. See [Pin A Message](/sdk/android/v5/pin-message).</Note>

<Tabs>
<Tab title="Java (User)">
```java
Expand All @@ -1296,7 +1302,7 @@
```java
String GUID = "cometchat-guid-1";

MessagesRequest messagesRequest = new MessagesRequest.MessagesRequestBuilder()

Check warning on line 1305 in sdk/android/v5/additional-message-filtering.mdx

View check run for this annotation

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

sdk/android/v5/additional-message-filtering.mdx#L1305

Did you really mean 'messagesRequest'?
.setPinned(true)
.setLimit(50)
.setGUID(GUID)
Expand All @@ -1322,7 +1328,7 @@
```kotlin
val GUID = "cometchat-guid-1"

val messagesRequest = MessagesRequestBuilder()

Check warning on line 1331 in sdk/android/v5/additional-message-filtering.mdx

View check run for this annotation

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

sdk/android/v5/additional-message-filtering.mdx#L1331

Did you really mean 'messagesRequest'?
.setPinned(true)
.setLimit(50)
.setGUID(GUID)
Expand All @@ -1341,6 +1347,8 @@

This can be achieved by setting the saved flag to true using the `setSaved()` method. Saved messages are private to the logged-in user and span all of their conversations, so this filter must **not** be combined with `setUID()` or `setGUID()`. The returned list is sorted by the time of saving, most recently saved first.

<Note>With offline support on, the saved list is served from the cache first, then from the server. See [Save A Message](/sdk/android/v5/save-message).</Note>

<Tabs>
<Tab title="Java">
```java
Expand All @@ -1354,7 +1362,7 @@

<Tab title="Kotlin">
```kotlin
val messagesRequest = MessagesRequestBuilder()

Check warning on line 1365 in sdk/android/v5/additional-message-filtering.mdx

View check run for this annotation

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

sdk/android/v5/additional-message-filtering.mdx#L1365

Did you really mean 'messagesRequest'?
.setSaved(true)
.setLimit(50)
.build()
Expand All @@ -1364,4 +1372,36 @@

</Tabs>

For the full save workflow — saving, unsaving, limits and real-time events — see [Save A Message](/sdk/android/v5/save-message).

Check warning on line 1375 in sdk/android/v5/additional-message-filtering.mdx

View check run for this annotation

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

sdk/android/v5/additional-message-filtering.mdx#L1375

Did you really mean 'unsaving'?

## Offline Behaviour

With offline support enabled, `fetchPrevious`/`fetchNext` answer from the on-device cache first (`onCachedMessages`, even when empty) and then from the server (`onServerMessages`). The cache answers a page **only when every filter on the request is locally computable** — a single server-only filter makes the cached page empty with no error, while the server phase still answers in full. Offline, the fetch ends with `onError` with code `ERROR_INTERNET_UNAVAILABLE` after the cached page. See [Show Cached Data](/sdk/android/v5/offline-cached-data).

| Builder method | Offline behaviour |
| --- | --- |
| `setUnread(boolean)` | Cached |
| `hideMessagesFromBlockedUsers(boolean)` | Cached |
| `updatesOnly(boolean)` | Server only — cached page is empty |
| `setCategories(List)` | Cached |
| `setTypes(List)` | Cached |
| `setParentMessageId(long)` | Cached |
| `hideReplies(boolean)` | Cached |
| `hideDeletedMessages(boolean)` | Cached |
| `hideQuotedMessages(boolean)` | Cached |
| `setTags(List)` | Cached |
| `withTags(boolean)` | Cached |
| `hasLinks(boolean)` | Server only — cached page is empty |
| `setSearchKeyword(String)` | Server only — cached page is empty |
| `setInteractionGoalCompletedOnly(boolean)` | Server only — cached page is empty |
| `hasAttachments(boolean)` | Cached |
| `hasReactions(boolean)` | Cached |
| `setAttachmentTypes(List)` | Cached |
| `hasMentions(boolean)` | Cached |
| `setMentionedUIDs(List)` | Cached |
| `setPinned(boolean)` | Cached |
| `setSaved(boolean)` | Cached |

`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.
33 changes: 25 additions & 8 deletions sdk/android/v5/ai-moderation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
description: "Screen text, image and video messages for unsafe content automatically in your Android app, and respond when each one is approved or rejected."
---

import OfflineDeprecatedSend from '/snippets/sdk/offline-deprecated-send.mdx';

## Overview

AI Moderation in the CometChat SDK helps ensure that your chat application remains safe and compliant by automatically reviewing messages for inappropriate content. This feature leverages AI to moderate messages in real-time, reducing manual intervention and improving user experience.
Expand All @@ -29,10 +31,11 @@
participant Moderation

App->>SDK: sendMessage()
SDK-->>App: onMessagePending (offline support on)
SDK->>CometChat: Send Message
CometChat->>Moderation: Process Message
CometChat-->>SDK: Message (status: PENDING)
SDK-->>App: onSuccess (PENDING)
SDK-->>App: onMessageSent (PENDING)
Moderation-->>CometChat: Moderation Result
CometChat-->>SDK: onMessageModerated
SDK-->>App: APPROVED or DISAPPROVED
Expand All @@ -41,7 +44,7 @@
| Step | Description |
|------|-------------|
| 1. Send Message | App sends a text, image, or video message |
| 2. Pending Status | Message is sent with `PENDING` moderation status |
| 2. Pending Status | Message is sent with `PENDING` moderation status (`getModerationStatus()`). This is separate from the send status: with offline support on, `onMessagePending` fires first, before the message reaches the server. |
| 3. AI Processing | Moderation service analyzes the content |
| 4. Result Event | `onMessageModerated` event fires with final status |

Expand Down Expand Up @@ -73,21 +76,28 @@

When you send a text, image, or video message, check the initial moderation status:

<OfflineDeprecatedSend method="`sendMessage()`" />

<Tabs>
<Tab title="Kotlin">
```kotlin
val textMessage = TextMessage(receiverUID, "Hello, how are you?", CometChatConstants.RECEIVER_TYPE_USER)

Check warning on line 84 in sdk/android/v5/ai-moderation.mdx

View check run for this annotation

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

sdk/android/v5/ai-moderation.mdx#L84

Did you really mean 'textMessage'?

CometChat.sendMessage(textMessage, object : CometChat.CallbackListener<TextMessage>() {
override fun onSuccess(message: TextMessage) {
CometChat.sendMessage(textMessage, object : CometChat.MessageSentListener() {
override fun onMessagePending(message: BaseMessage?) {
// Fires once the message is queued while offline support is enabled; message?.status == MessageStatus.PENDING
}

override fun onMessageSent(message: BaseMessage?) {
// Check moderation status
if (message.moderationStatus == ModerationStatus.PENDING) {
if ((message as? TextMessage)?.moderationStatus == ModerationStatus.PENDING) {
Log.d(TAG, "Message is under moderation review")
// Show pending indicator in UI
}
}

override fun onError(e: CometChatException) {
// With offline support on, this also fires when a message is queued offline: check the message's status (PENDING = queued, FAILED = failed).
Log.e(TAG, "Message sending failed: ${e.message}")
}
})
Expand All @@ -95,20 +105,27 @@
</Tab>
<Tab title="Java">
```java
TextMessage textMessage = new TextMessage(receiverUID, "Hello, how are you?", CometChatConstants.RECEIVER_TYPE_USER);

Check warning on line 108 in sdk/android/v5/ai-moderation.mdx

View check run for this annotation

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

sdk/android/v5/ai-moderation.mdx#L108

'textMessage' is repeated!

Check warning on line 108 in sdk/android/v5/ai-moderation.mdx

View check run for this annotation

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

sdk/android/v5/ai-moderation.mdx#L108

Did you really mean 'textMessage'?

CometChat.sendMessage(textMessage, new CometChat.CallbackListener<TextMessage>() {
CometChat.sendMessage(textMessage, new CometChat.MessageSentListener() {
@Override
public void onMessagePending(BaseMessage message) {
// Fires once the message is queued while offline support is enabled; message.getStatus() == MessageStatus.PENDING
}

@Override
public void onSuccess(TextMessage message) {
public void onMessageSent(BaseMessage message) {
// Check moderation status
if (message.getModerationStatus().equals(ModerationStatus.PENDING)) {
if (message instanceof TextMessage
&& ((TextMessage) message).getModerationStatus().equals(ModerationStatus.PENDING)) {
Log.d(TAG, "Message is under moderation review");
// Show pending indicator in UI
}
}

@Override
public void onError(CometChatException e) {
// With offline support on, this also fires when a message is queued offline: check the message's status (PENDING = queued, FAILED = failed).
Log.e(TAG, "Message sending failed: " + e.getMessage());
}
});
Expand Down
6 changes: 5 additions & 1 deletion sdk/android/v5/authentication-overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<Note>
Sample Users

We have setup 5 users for testing having UIDs: `cometchat-uid-1`, `cometchat-uid-2`, `cometchat-uid-3`, `cometchat-uid-4` and `cometchat-uid-5`.

Check warning on line 19 in sdk/android/v5/authentication-overview.mdx

View check run for this annotation

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

sdk/android/v5/authentication-overview.mdx#L19

Did you really mean 'UIDs'?

</Note>

Expand All @@ -38,7 +38,7 @@
<Tab title="Java">
```java
private String UID = "cometchat-uid-1";
private String authKey = "AUTH_KEY";

Check warning on line 41 in sdk/android/v5/authentication-overview.mdx

View check run for this annotation

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

sdk/android/v5/authentication-overview.mdx#L41

Did you really mean 'authKey'?

if (CometChat.getLoggedInUser() == null) {
CometChat.login(UID, authKey, new CometChat.CallbackListener<User>() {
Expand Down Expand Up @@ -67,7 +67,7 @@
if (CometChat.getLoggedInUser() == null) {
CometChat.login(UID, authKey, object : CometChat.CallbackListener<User?>() {
override fun onSuccess(user: User?) {}
override fun onError(e: CometChatException?) {}
override fun onError(e: CometChatException) {}
})
} else {
// user already logged-in perform your action
Expand Down Expand Up @@ -96,7 +96,7 @@
<Tabs>
<Tab title="Java">
```java
private String authToken = "AUTH_TOKEN";

Check warning on line 99 in sdk/android/v5/authentication-overview.mdx

View check run for this annotation

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

sdk/android/v5/authentication-overview.mdx#L99

Did you really mean 'authToken'?

CometChat.login(authToken, new CometChat.CallbackListener<User>()
@Override
Expand Down Expand Up @@ -134,7 +134,7 @@

| Parameter | Description |
| --------- | ---------------------------------------------- |
| authToken | Auth Token of the user you would like to login |

Check warning on line 137 in sdk/android/v5/authentication-overview.mdx

View check run for this annotation

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

sdk/android/v5/authentication-overview.mdx#L137

Did you really mean 'authToken'?

After the user logs in, their information is returned in the `User` object.

Expand All @@ -142,6 +142,10 @@

You can use the `logout()` method to log out the user from CometChat. We suggest you call this method once your user has been successfully logged out from your app.

<Note>
With offline support enabled, logging out — or logging in as a different user — wipes the current user's on-device cache (its messages, media and queued messages). See [Stay in Sync](/sdk/android/v5/offline-sync).
</Note>

<Tabs>
<Tab title="Java">
```java
Expand Down
43 changes: 38 additions & 5 deletions sdk/android/v5/block-users.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
description: "Block or unblock users in your Android app so all messages to and from them stop, and fetch the list of everyone you have blocked."
---

import OfflineDeprecatedListener from '/snippets/sdk/offline-deprecated-listener.mdx';



## Block Users
Expand Down Expand Up @@ -124,7 +126,7 @@
<Tabs>
<Tab title="Java">
```java
BlockedUsersRequest blockedUsersRequest = new BlockedUsersRequest.BlockedUsersRequestBuilder()

Check warning on line 129 in sdk/android/v5/block-users.mdx

View check run for this annotation

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

sdk/android/v5/block-users.mdx#L129

'blockedUsersRequest' is repeated!
.setLimit(10)
.build();
```
Expand All @@ -144,12 +146,14 @@

### Set Search Keyword

<Note>With offline support on, this filter is answered by the server only; the cached page is empty.</Note>

This method allows you to set the search string based on which the blocked users are to be fetched.

<Tabs>
<Tab title="Java">
```java
BlockedUsersRequest blockedUsersRequest = new BlockedUsersRequest.BlockedUsersRequestBuilder()

Check warning on line 156 in sdk/android/v5/block-users.mdx

View check run for this annotation

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

sdk/android/v5/block-users.mdx#L156

'blockedUsersRequest' is repeated!
.setSearchKeyword("abc")
.build();
```
Expand All @@ -176,7 +180,7 @@
<Tabs>
<Tab title="Java">
```java
BlockedUsersRequest blockedUsersRequest = new BlockedUsersRequest.BlockedUsersRequestBuilder()

Check warning on line 183 in sdk/android/v5/block-users.mdx

View check run for this annotation

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

sdk/android/v5/block-users.mdx#L183

'blockedUsersRequest' is repeated!
.setDirection(BlockedUsersRequest.DIRECTION_BLOCKED_BY_ME)
.build();
```
Expand All @@ -198,15 +202,26 @@

Once you have the object of the `BlockedUsersRequest` class, you need to call the `fetchNext()` method. Calling this method will return a list of `User` objects containing n number of blocked users where N is the limit set in the builder class.

<OfflineDeprecatedListener method="`fetchNext()`" replacement="`UserFetchListener`" />

<Tabs>
<Tab title="Java">
```java
BlockedUsersRequest blockedUsersRequest = new BlockedUsersRequest.BlockedUsersRequestBuilder().setLimit(10).build();

Check warning on line 210 in sdk/android/v5/block-users.mdx

View check run for this annotation

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

sdk/android/v5/block-users.mdx#L210

'blockedUsersRequest' is repeated!

blockedUsersRequest.fetchNext(new CometChat.CallbackListener<List<User>>() {
blockedUsersRequest.fetchNext(new CometChat.UserFetchListener() {
@Override
public void onCachedUsers(List<User> users) {
// Cached page: fires first (even when empty). Render immediately.
for (User user : users) {
Log.e(TAG, user.getUid());
}
}

@Override
public void onSuccess(List<User> users) {
for(User user : users){
public void onServerUsers(List<User> users) {
// Server page: reconcile your displayed list, keyed by uid.
for (User user : users) {
Log.e(TAG, user.getUid());
}
}
Expand All @@ -224,8 +239,16 @@
```kotlin
val blockedUsersRequest = BlockedUsersRequestBuilder().setLimit(10).build()

blockedUsersRequest.fetchNext(object : CallbackListener<List<User>>() {
override fun onSuccess(users: List<User>) {
blockedUsersRequest.fetchNext(object : CometChat.UserFetchListener() {
override fun onCachedUsers(users: List<User>) {
// Cached page: fires first (even when empty). Render immediately.
for (user in users) {
Log.e(TAG, user.uid)
}
}

override fun onServerUsers(users: List<User>) {
// Server page: reconcile your displayed list, keyed by uid.
for (user in users) {
Log.e(TAG, user.uid)
}
Expand All @@ -240,3 +263,13 @@
</Tab>

</Tabs>

## 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).

| Builder method | Offline |
|---|---|
| `setLimit` | Cached |
| `setDirection` | Cached |
| `setSearchKeyword` | Server only — cached page is empty |
47 changes: 43 additions & 4 deletions sdk/android/v5/campaigns.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
description: "CometChat Campaigns lets you deliver targeted, rich notifications to users via an in-app notification feed."
---

import OfflineDeprecatedListener from '/snippets/sdk/offline-deprecated-listener.mdx';

CometChat Campaigns lets you deliver targeted, rich notifications to users via an in-app notification feed. Each notification is a **Card Schema JSON** — a structured layout rendered natively by the CometChat Cards library.

The SDK provides APIs to fetch feed items, listen for real-time delivery, mark items as read/delivered, report engagement, and retrieve unread counts.
Expand Down Expand Up @@ -80,7 +82,7 @@

### Add the Cards Dependency

Add the Cloudsmith repository and the cards library to your project:

Check warning on line 85 in sdk/android/v5/campaigns.mdx

View check run for this annotation

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

sdk/android/v5/campaigns.mdx#L85

Did you really mean 'Cloudsmith'?

```groovy
// settings.gradle or project-level build.gradle
Expand Down Expand Up @@ -111,7 +113,7 @@
@Composable
fun NotificationCard(item: NotificationFeedItem) {
CometChatCardComposable(
cardJson = item.content.toString(),

Check warning on line 116 in sdk/android/v5/campaigns.mdx

View check run for this annotation

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

sdk/android/v5/campaigns.mdx#L116

Did you really mean 'cardJson'?
themeMode = CometChatCardThemeMode.AUTO,
onAction = { event ->
when (event.action) {
Expand Down Expand Up @@ -198,12 +200,12 @@
"light": "transparent",
"dark": "transparent"
},
"textColor": {

Check warning on line 203 in sdk/android/v5/campaigns.mdx

View check run for this annotation

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

sdk/android/v5/campaigns.mdx#L203

Did you really mean 'textColor'?
"light": "#6C5CE7",
"dark": "#6C5CE7"
},
"size": 40,
"fontSize": 13,

Check warning on line 208 in sdk/android/v5/campaigns.mdx

View check run for this annotation

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

sdk/android/v5/campaigns.mdx#L208

Did you really mean 'fontSize'?
"borderRadius": 6,
"padding": {
"top": 0,
Expand All @@ -221,14 +223,14 @@
"id": "col_98fed9bd-1a95-4cee-aa81-84a9016e41f2"
}
],
"fallbackText": "",

Check warning on line 226 in sdk/android/v5/campaigns.mdx

View check run for this annotation

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

sdk/android/v5/campaigns.mdx#L226

Did you really mean 'fallbackText'?
"style": {
"background": {
"light": "#E8E8E8",
"dark": "#E8E8E8"
},
"borderRadius": 16,
"borderColor": {

Check warning on line 233 in sdk/android/v5/campaigns.mdx

View check run for this annotation

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

sdk/android/v5/campaigns.mdx#L233

Did you really mean 'borderColor'?
"light": "#DFE6E9",
"dark": "#DFE6E9"
},
Expand Down Expand Up @@ -278,12 +280,24 @@

### Fetch Items

<OfflineDeprecatedListener method="`fetchNext()`" replacement="`NotificationFeedFetchListener`" />

<Tabs>
<Tab title="Java">
```java
request.fetchNext(new CometChat.CallbackListener<List<NotificationFeedItem>>() {
request.fetchNext(new CometChat.NotificationFeedFetchListener() {
@Override
public void onCachedNotificationFeedItems(List<NotificationFeedItem> items) {
// Cached page: fires first (even when empty). Render immediately.
for (NotificationFeedItem item : items) {
String cardJson = item.getContent().toString();
// Pass cardJson to CometChatCardView or CometChatCardComposable
}
}

@Override
public void onSuccess(List<NotificationFeedItem> items) {
public void onServerNotificationFeedItems(List<NotificationFeedItem> items) {
// Server page: reconcile your displayed list, keyed by item id.
for (NotificationFeedItem item : items) {
String cardJson = item.getContent().toString();
// Pass cardJson to CometChatCardView or CometChatCardComposable
Expand All @@ -299,8 +313,17 @@
</Tab>
<Tab title="Kotlin">
```kotlin
request.fetchNext(object : CometChat.CallbackListener<List<NotificationFeedItem>>() {
override fun onSuccess(items: List<NotificationFeedItem>) {
request.fetchNext(object : CometChat.NotificationFeedFetchListener() {
override fun onCachedNotificationFeedItems(items: List<NotificationFeedItem>) {
// Cached page: fires first (even when empty). Render immediately.
items.forEach { item ->
val cardJson = item.content.toString()
// Pass cardJson to CometChatCardView or CometChatCardComposable
}
}

override fun onServerNotificationFeedItems(items: List<NotificationFeedItem>) {
// Server page: reconcile your displayed list, keyed by item id.
items.forEach { item ->
val cardJson = item.content.toString()
// Pass cardJson to CometChatCardView or CometChatCardComposable
Expand All @@ -323,7 +346,7 @@
| --- | --- | --- |
| `id` | String | Unique item identifier |
| `category` | String | Notification category (e.g., "promotions") |
| `content` | JSONObject | Card Schema JSON — pass to CometChat Cards renderer |

Check warning on line 349 in sdk/android/v5/campaigns.mdx

View check run for this annotation

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

sdk/android/v5/campaigns.mdx#L349

Did you really mean 'JSONObject'?
| `readAt` | Long? | Unix timestamp when read, or null if unread |
| `deliveredAt` | Long? | Unix timestamp when delivered, or null |
| `sentAt` | long | Unix timestamp when sent |
Expand All @@ -333,6 +356,22 @@

---

## Offline Behaviour

With offline support enabled, `NotificationFeedRequest.fetchNext()` on a `NotificationFeedFetchListener` first delivers `onCachedNotificationFeedItems` from the device (empty when nothing was recorded), then `onServerNotificationFeedItems` with the live page to reconcile by item `id`. 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).

A `fetchNext()` call made while another fetch of the same request is still running ends with `onError` with code `ERROR_REQUEST_IN_PROGRESS`. Once the list has ended, a further `fetchNext()` asks the server again and delivers only items this request has not delivered before.

| Builder method | Offline |
|---|---|
| `setLimit` | Cached |
| `setReadState` | Cached |
| `setCategory` | Cached |
| `setChannelId` | Cached |
| `setTags` | Cached |
| `setDateFrom` | Cached |
| `setDateTo` | Cached |

## Retrieve Notification Categories

Use `NotificationCategoriesRequest` to fetch available categories for filter chips.
Expand All @@ -340,7 +379,7 @@
<Tabs>
<Tab title="Java">
```java
NotificationCategoriesRequest categoriesRequest = new NotificationCategoriesRequest

Check warning on line 382 in sdk/android/v5/campaigns.mdx

View check run for this annotation

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

sdk/android/v5/campaigns.mdx#L382

Did you really mean 'categoriesRequest'?
.NotificationCategoriesRequestBuilder()
.setLimit(50)
.build();
Expand Down Expand Up @@ -627,7 +666,7 @@
<Tabs>
<Tab title="Java">
```java
PushNotification pushNotification = PushNotification.fromJson(pushPayloadJson);

Check warning on line 669 in sdk/android/v5/campaigns.mdx

View check run for this annotation

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

sdk/android/v5/campaigns.mdx#L669

'pushNotification' is repeated!

Check warning on line 669 in sdk/android/v5/campaigns.mdx

View check run for this annotation

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

sdk/android/v5/campaigns.mdx#L669

Did you really mean 'pushNotification'?

CometChat.markPushNotificationDelivered(pushNotification, new CometChat.CallbackListener<Void>() {
@Override
Expand Down
4 changes: 4 additions & 0 deletions sdk/android/v5/connection-status.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,17 @@

CometChat SDK provides you with a mechanism to get real-time status of the connection to CometChat web-socket servers. To achieve this you need to use the `ConnectionListener` class provided by the CometChat SDK

<Note>
With offline support enabled, your app keeps working without a connection: cached chats are shown instantly, and messages you send with a `MessageSentListener` are queued and delivered automatically on reconnect. See [Show Cached Data](/sdk/android/v5/offline-cached-data) and [Send While Offline](/sdk/android/v5/offline-send).
</Note>

Connection Status provides you with the below 3 methods to get the status of the connection to CometChat web-socket servers:

| Delegate Method | Information |
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| onConnecting | This method is triggered when CometChat SDK is trying to establish a connection to the web-socket server. |

Check warning on line 18 in sdk/android/v5/connection-status.mdx

View check run for this annotation

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

sdk/android/v5/connection-status.mdx#L18

Did you really mean 'onConnecting'?
| onConnected | This method is called when CometChat SDK has successfully established a connection and now is connected. |

Check warning on line 19 in sdk/android/v5/connection-status.mdx

View check run for this annotation

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

sdk/android/v5/connection-status.mdx#L19

Did you really mean 'onConnected'?
| onDisconnected | This method is called when the CometChat SDK gets disconnected due to any issue while maintaining the connection like network fluctuations, etc. |

Check warning on line 20 in sdk/android/v5/connection-status.mdx

View check run for this annotation

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

sdk/android/v5/connection-status.mdx#L20

Did you really mean 'onDisconnected'?
| onFeatureThrottled | CometChat automatically toggles off certain features to prevent performance loss for end-users under various circumstances |

Once the connection is broken, the disconnected callback is triggered, the SDK automatically tries to establish the connection again, thus going into the connecting state and triggering the `connecting` method. Once the attempt to connect is successful, the `connected` method is triggered thus letting the developer know that the connection is established and is active.
Expand Down Expand Up @@ -87,14 +91,14 @@
<Tabs>
<Tab title="Java">
```java
String connectionStatus = CometChat.getConnectionStatus();

Check warning on line 94 in sdk/android/v5/connection-status.mdx

View check run for this annotation

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

sdk/android/v5/connection-status.mdx#L94

Did you really mean 'connectionStatus'?
```

</Tab>

<Tab title="Kotlin">
```kotlin
val connectionStatus = CometChat.getConnectionStatus()

Check warning on line 101 in sdk/android/v5/connection-status.mdx

View check run for this annotation

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

sdk/android/v5/connection-status.mdx#L101

Did you really mean 'connectionStatus'?
```

</Tab>
Expand All @@ -109,7 +113,7 @@

3. `CometChatConstants.WS_STATE_DISCONNECTED`(disconnected)

4. `CometChatConstants.WS_STATE_FEATURE_THROTTLED`(featureThrottled)

Check warning on line 116 in sdk/android/v5/connection-status.mdx

View check run for this annotation

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

sdk/android/v5/connection-status.mdx#L116

Did you really mean 'featureThrottled'?

<Info>

Expand Down
Loading
Loading