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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -3789,6 +3789,19 @@
"sdk/ios/pin-save-message"
]
},
{
"group": "Offline Support",
"pages": [
"sdk/ios/offline-overview",
"sdk/ios/offline-enable",
"sdk/ios/offline-cached-data",
"sdk/ios/offline-send",
"sdk/ios/offline-sync",
"sdk/ios/offline-media-caching",
"sdk/ios/offline-encryption",
"sdk/ios/offline-reference"
]
},
"sdk/ios/calling-overview",
{
"group": "Users",
Expand Down
25 changes: 25 additions & 0 deletions sdk/ios/additional-message-filtering.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,31 @@ To fetch pinned or saved messages, filter with `set(pinned:)` or `set(saved:)` r

---

## Offline support

With offline support enabled (SDK 4.2.0 or later), `fetchPrevious` and `fetchNext` answer from the on-device cache first. The cache answers a page only when every filter on the request can be computed on the device. A single server-only filter makes the cached page empty, with no error, while the server phase still answers in full.

| Builder method | Offline |
|---|---|
| `setCategory(category:)`, `set(categories:)` | Cached |
| `setType(type:)`, `set(types:)` | Cached |
| `setParentMessageId(parentMessageId:)` | Cached |
| `hideReplies(hide:)`, `hideDeletedMessages(hide:)` | Cached |
| `setTags(_:)` | Cached |
| `has(mentions:)`, `set(mentionedUIDs:)` | Cached |
| `has(attachments:)`, `set(attachmentTypes:)` | Cached |
| `has(reactions:)` | Cached |
| `hideMessagesFromBlockedUsers(_:)` | Cached |
| `set(unread:)` | Cached |
| `set(searchKeyword:)` | Server only, cached page is empty |
| `has(links:)` | Server only, cached page is empty |
| `updatesOnly(onlyUpdates:)` | Server only, cached page is empty |
| `setInteractionGoalCompletedOnly(_:)` | Server only, cached page is empty |

`set(pinned:)` and `set(saved:)` 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.

`set(messageID:)`, `set(timeStamp:)`, `setUpdatedAfter(timeStamp:)`, `set(limit:)`, `set(uid:)` and `set(guid:)` are scope and pagination inputs, not filters, and do not change what the cache can answer. Setting both `set(uid:)` and `set(guid:)` (one sender's messages in a group) is answered by the server only. See [Show Cached Data](/sdk/ios/offline-cached-data).

## Next Steps

<CardGroup cols={2}>
Expand Down
4 changes: 4 additions & 0 deletions sdk/ios/ai-moderation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
<Tabs>
<Tab title="Swift">
```swift
let textMessage = TextMessage(receiverUid: receiverUID, text: "Hello, how are you?", receiverType: .user)

Check warning on line 99 in sdk/ios/ai-moderation.mdx

View check run for this annotation

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

sdk/ios/ai-moderation.mdx#L99

Did you really mean 'textMessage'?

Check warning on line 99 in sdk/ios/ai-moderation.mdx

View check run for this annotation

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

sdk/ios/ai-moderation.mdx#L99

Did you really mean 'receiverType'?

CometChat.sendTextMessage(message: textMessage) { sentMessage in
if let message = sentMessage as? TextMessage {
Expand All @@ -111,7 +111,7 @@
</Tab>
<Tab title="Objective-C">
```objc
TextMessage *textMessage = [[TextMessage alloc] initWithReceiverUid:receiverUID text:@"Hello, how are you?" receiverType:ReceiverTypeUser];

Check warning on line 114 in sdk/ios/ai-moderation.mdx

View check run for this annotation

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

sdk/ios/ai-moderation.mdx#L114

Did you really mean 'alloc'?

[CometChat sendTextMessageWithMessage:textMessage onSuccess:^(TextMessage *sentMessage) {
if ([[sentMessage getModerationStatus] isEqualToString:@"pending"]) {
Expand Down Expand Up @@ -159,7 +159,7 @@
```objc
- (void)onMessageModerated:(BaseMessage *)message {
if ([message isKindOfClass:[TextMessage class]]) {
TextMessage *textMessage = (TextMessage *)message;

Check warning on line 162 in sdk/ios/ai-moderation.mdx

View check run for this annotation

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

sdk/ios/ai-moderation.mdx#L162

Did you really mean 'textMessage'?

if ([[textMessage getModerationStatus] isEqualToString:@"approved"]) {
NSLog(@"Message %d approved", message.id);
Expand Down Expand Up @@ -216,11 +216,15 @@
</Tabs>

<Warning>
Always remove listeners when they're no longer needed (e.g., on component unmount or page navigation). Failing to remove listeners can cause memory leaks and duplicate event handling.

Check warning on line 219 in sdk/ios/ai-moderation.mdx

View check run for this annotation

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

sdk/ios/ai-moderation.mdx#L219

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

---

## Offline support

With offline support enabled (SDK 4.2.0 or later), the send overload with `onMessagePending` fires `onMessagePending` first, before the message reaches the server. That status is separate from the moderation status: the message is still sent with a `pending` moderation status, which `getModerationStatus()` reports. If you send without a connection, `onError` with code `ERROR_INTERNET_UNAVAILABLE` means the message is queued, not failed (with `autoSendPendingOnReconnect` on, the default). See [Send While Offline](/sdk/ios/offline-send).

## Next Steps

<CardGroup cols={2}>
Expand Down
13 changes: 13 additions & 0 deletions sdk/ios/all-real-time-delegates-listeners.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,13 @@

| Method | Information |
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| **onGroupMemberJoined(action:** [`Action`](/sdk/reference/messages#action)**, joinedUser:** [`User`](/sdk/reference/entities#user)**, joinedGroup:** [`Group`](/sdk/reference/entities#group)**)** | This method is triggered when a user joins any group. All the members present in the group will receive this event. |

Check warning on line 98 in sdk/ios/all-real-time-delegates-listeners.mdx

View check run for this annotation

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

sdk/ios/all-real-time-delegates-listeners.mdx#L98

Did you really mean 'joinedUser'?

Check warning on line 98 in sdk/ios/all-real-time-delegates-listeners.mdx

View check run for this annotation

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

sdk/ios/all-real-time-delegates-listeners.mdx#L98

Did you really mean 'joinedGroup'?
| **onGroupMemberLeft(action:** [`Action`](/sdk/reference/messages#action)**, leftUser:** [`User`](/sdk/reference/entities#user)**, leftGroup:** [`Group`](/sdk/reference/entities#group)**)** | This method is triggered when a user who was a member of any group leaves the group. All the members of the group receive this event. |

Check warning on line 99 in sdk/ios/all-real-time-delegates-listeners.mdx

View check run for this annotation

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

sdk/ios/all-real-time-delegates-listeners.mdx#L99

Did you really mean 'leftUser'?

Check warning on line 99 in sdk/ios/all-real-time-delegates-listeners.mdx

View check run for this annotation

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

sdk/ios/all-real-time-delegates-listeners.mdx#L99

Did you really mean 'leftGroup'?
| **onGroupMemberKicked(action:** [`Action`](/sdk/reference/messages#action)**, kickedUser:** [`User`](/sdk/reference/entities#user)**, kickedBy:** [`User`](/sdk/reference/entities#user)**, kickedFrom:** [`Group`](/sdk/reference/entities#group)**)** | This method is triggered when a user is kicked from a group. All the members including the user receive this event |

Check warning on line 100 in sdk/ios/all-real-time-delegates-listeners.mdx

View check run for this annotation

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

sdk/ios/all-real-time-delegates-listeners.mdx#L100

Did you really mean 'kickedUser'?

Check warning on line 100 in sdk/ios/all-real-time-delegates-listeners.mdx

View check run for this annotation

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

sdk/ios/all-real-time-delegates-listeners.mdx#L100

Did you really mean 'kickedBy'?

Check warning on line 100 in sdk/ios/all-real-time-delegates-listeners.mdx

View check run for this annotation

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

sdk/ios/all-real-time-delegates-listeners.mdx#L100

Did you really mean 'kickedFrom'?
| **onGroupMemberBanned(action:** [`Action`](/sdk/reference/messages#action)**, bannedUser:** [`User`](/sdk/reference/entities#user)**, bannedBy:** [`User`](/sdk/reference/entities#user)**, bannedFrom:** [`Group`](/sdk/reference/entities#group)**)** | This method is triggered when a user is banned from a group. All the members including the user receive this event |

Check warning on line 101 in sdk/ios/all-real-time-delegates-listeners.mdx

View check run for this annotation

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

sdk/ios/all-real-time-delegates-listeners.mdx#L101

Did you really mean 'bannedUser'?

Check warning on line 101 in sdk/ios/all-real-time-delegates-listeners.mdx

View check run for this annotation

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

sdk/ios/all-real-time-delegates-listeners.mdx#L101

Did you really mean 'bannedBy'?

Check warning on line 101 in sdk/ios/all-real-time-delegates-listeners.mdx

View check run for this annotation

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

sdk/ios/all-real-time-delegates-listeners.mdx#L101

Did you really mean 'bannedFrom'?
| **onGroupMemberUnbanned(action:** [`Action`](/sdk/reference/messages#action)**, unbannedUser:** [`User`](/sdk/reference/entities#user)**, unbannedBy:** [`User`](/sdk/reference/entities#user)**, unbannedFrom:** [`Group`](/sdk/reference/entities#group)**)** | This method is triggered when a user is banned from a group. All the members of the group receive this event. |

Check warning on line 102 in sdk/ios/all-real-time-delegates-listeners.mdx

View check run for this annotation

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

sdk/ios/all-real-time-delegates-listeners.mdx#L102

Did you really mean 'unbannedUser'?

Check warning on line 102 in sdk/ios/all-real-time-delegates-listeners.mdx

View check run for this annotation

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

sdk/ios/all-real-time-delegates-listeners.mdx#L102

Did you really mean 'unbannedBy'?

Check warning on line 102 in sdk/ios/all-real-time-delegates-listeners.mdx

View check run for this annotation

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

sdk/ios/all-real-time-delegates-listeners.mdx#L102

Did you really mean 'unbannedFrom'?
| **onGroupMemberScopeChanged(action:** [`Action`](/sdk/reference/messages#action)**, updatedBy:** [`User`](/sdk/reference/entities#user)**, updatedUser:** [`User`](/sdk/reference/entities#user)**, scopeChangedTo: String, scopeChangedFrom: String, group:** [`Group`](/sdk/reference/entities#group)**)** | This method is triggered when the scope of any Group Member has been changed. All the members that are a part of that group receive this event |

Check warning on line 103 in sdk/ios/all-real-time-delegates-listeners.mdx

View check run for this annotation

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

sdk/ios/all-real-time-delegates-listeners.mdx#L103

Did you really mean 'updatedBy'?

Check warning on line 103 in sdk/ios/all-real-time-delegates-listeners.mdx

View check run for this annotation

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

sdk/ios/all-real-time-delegates-listeners.mdx#L103

Did you really mean 'updatedUser'?
| **onMemberAddedToGroup(action:** [`Action`](/sdk/reference/messages#action)**, addedby:** [`User`](/sdk/reference/entities#user)**, userAdded:** [`User`](/sdk/reference/entities#user)**, addedTo:** [`Group`](/sdk/reference/entities#group)**)** | This method is triggered when a user is added to any group. All the members including the user himself receive this event. |

Check warning on line 104 in sdk/ios/all-real-time-delegates-listeners.mdx

View check run for this annotation

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

sdk/ios/all-real-time-delegates-listeners.mdx#L104

Did you really mean 'addedby'?

Check warning on line 104 in sdk/ios/all-real-time-delegates-listeners.mdx

View check run for this annotation

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

sdk/ios/all-real-time-delegates-listeners.mdx#L104

Did you really mean 'userAdded'?

Check warning on line 104 in sdk/ios/all-real-time-delegates-listeners.mdx

View check run for this annotation

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

sdk/ios/all-real-time-delegates-listeners.mdx#L104

Did you really mean 'addedTo'?

You can receive live events related to groups. In order to receive group events, you must add protocol conformance `CometChatGroupDelegate` as shown below:

Expand All @@ -114,23 +114,23 @@
print("\\(joinedUser.name) joined the group \\(joinedGroup.name).")
}

func onGroupMemberLeft(action: ActionMessage, leftUser: User, leftGroup: Group) {

Check warning on line 117 in sdk/ios/all-real-time-delegates-listeners.mdx

View check run for this annotation

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

sdk/ios/all-real-time-delegates-listeners.mdx#L117

Did you really mean 'leftUser'?

Check warning on line 117 in sdk/ios/all-real-time-delegates-listeners.mdx

View check run for this annotation

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

sdk/ios/all-real-time-delegates-listeners.mdx#L117

Did you really mean 'leftGroup'?
print("\\(leftUser.name) left the group \\(leftGroup.name).")
}

func onGroupMemberKicked(action: ActionMessage, kickedUser: User, kickedBy: User, kickedFrom: Group) {

Check warning on line 121 in sdk/ios/all-real-time-delegates-listeners.mdx

View check run for this annotation

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

sdk/ios/all-real-time-delegates-listeners.mdx#L121

Did you really mean 'kickedUser'?

Check warning on line 121 in sdk/ios/all-real-time-delegates-listeners.mdx

View check run for this annotation

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

sdk/ios/all-real-time-delegates-listeners.mdx#L121

Did you really mean 'kickedBy'?

Check warning on line 121 in sdk/ios/all-real-time-delegates-listeners.mdx

View check run for this annotation

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

sdk/ios/all-real-time-delegates-listeners.mdx#L121

Did you really mean 'kickedFrom'?
print("\\(kickedUser.name) kicked from the group \\(kickedFrom.name) by \\(kickedBy.name).")
}

func onGroupMemberBanned(action: ActionMessage, bannedUser: User, bannedBy: User, bannedFrom: Group) {

Check warning on line 125 in sdk/ios/all-real-time-delegates-listeners.mdx

View check run for this annotation

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

sdk/ios/all-real-time-delegates-listeners.mdx#L125

Did you really mean 'bannedUser'?

Check warning on line 125 in sdk/ios/all-real-time-delegates-listeners.mdx

View check run for this annotation

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

sdk/ios/all-real-time-delegates-listeners.mdx#L125

Did you really mean 'bannedBy'?

Check warning on line 125 in sdk/ios/all-real-time-delegates-listeners.mdx

View check run for this annotation

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

sdk/ios/all-real-time-delegates-listeners.mdx#L125

Did you really mean 'bannedFrom'?
print("\\(bannedUser.name) banned from the group \\(bannedFrom.name) by \\(bannedBy.name).")
}

func onGroupMemberUnbanned(action: ActionMessage, unbannedUser: User, unbannedBy: User, unbannedFrom: Group) {

Check warning on line 129 in sdk/ios/all-real-time-delegates-listeners.mdx

View check run for this annotation

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

sdk/ios/all-real-time-delegates-listeners.mdx#L129

Did you really mean 'unbannedUser'?

Check warning on line 129 in sdk/ios/all-real-time-delegates-listeners.mdx

View check run for this annotation

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

sdk/ios/all-real-time-delegates-listeners.mdx#L129

Did you really mean 'unbannedBy'?

Check warning on line 129 in sdk/ios/all-real-time-delegates-listeners.mdx

View check run for this annotation

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

sdk/ios/all-real-time-delegates-listeners.mdx#L129

Did you really mean 'unbannedFrom'?
print("\\(unbannedUser.name) unbanned from the group \\(unbannedFrom.name) by \\(unbannedBy.name).")
}

func onGroupMemberScopeChanged(action: ActionMessage, scopeChangeduser: User, scopeChangedBy: User, scopeChangedTo: String, scopeChangedFrom: String, group: Group) {

Check warning on line 133 in sdk/ios/all-real-time-delegates-listeners.mdx

View check run for this annotation

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

sdk/ios/all-real-time-delegates-listeners.mdx#L133

Did you really mean 'scopeChangeduser'?
print("\\(scopeChangedUser.name) scope changed from \\(scopeChangedFrom) to \\(scopeChangedTo) by \\(scopeChangedBy.name) in the group \\(group.name).")
}
}
Expand Down Expand Up @@ -199,8 +199,8 @@
| **onTextMessageReceived(textMessage:** [`TextMessage`](/sdk/reference/messages#textmessage)**)** | This event is triggered when a Text Message is received. |
| **onMediaMessageReceived(mediaMessage:** [`MediaMessage`](/sdk/reference/messages#mediamessage)**)** | This event is triggered when a Media Message is received. |
| **onCustomMessageReceived(customMessage:** [`CustomMessage`](/sdk/reference/messages#custommessage)**)** | This event is triggered when a Custom Message is received. |
| **onTypingStarted(_ typingDetails:** [`TypingIndicator`](/sdk/reference/auxiliary#typingindicator)**)** | This event is triggered when a user starts typing in a user/group conversation. |

Check warning on line 202 in sdk/ios/all-real-time-delegates-listeners.mdx

View check run for this annotation

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

sdk/ios/all-real-time-delegates-listeners.mdx#L202

Did you really mean 'typingDetails'?
| **onTypingEnded(_ typingDetails:** [`TypingIndicator`](/sdk/reference/auxiliary#typingindicator)**)** | This event is triggered when a user stops typing in a user/group conversation. |

Check warning on line 203 in sdk/ios/all-real-time-delegates-listeners.mdx

View check run for this annotation

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

sdk/ios/all-real-time-delegates-listeners.mdx#L203

Did you really mean 'typingDetails'?
| **onTransisentMessageReceived(_ message:** [`TransientMessage`](/sdk/reference/auxiliary#transientmessage)**)** | This event is triggered when a transient message is received. |
| **onMessagesDelivered(receipt:** [`MessageReceipt`](/sdk/reference/auxiliary#messagereceipt)**)** | This event is triggered when a set of messages are marked as delivered for any particular conversation. |
| **onMessagesRead(receipt:** [`MessageReceipt`](/sdk/reference/auxiliary#messagereceipt)**)** | This event is triggered when a set of messages are marked as read for any particular conversation. |
Expand Down Expand Up @@ -248,11 +248,11 @@
print("Message deleted successfully.")
}

func onTypingStarted(_ typingDetails: TypingIndicator) {

Check warning on line 251 in sdk/ios/all-real-time-delegates-listeners.mdx

View check run for this annotation

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

sdk/ios/all-real-time-delegates-listeners.mdx#L251

Did you really mean 'typingDetails'?
print("Typing started received successfully")
}

func onTypingEnded(_ typingDetails: TypingIndicator) {

Check warning on line 255 in sdk/ios/all-real-time-delegates-listeners.mdx

View check run for this annotation

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

sdk/ios/all-real-time-delegates-listeners.mdx#L255

Did you really mean 'typingDetails'?
print("Typing ended received successfully")
}

Expand Down Expand Up @@ -567,6 +567,19 @@

---

## Offline listeners

With offline support enabled (SDK 4.2.0 or later), `CometChatMessageDelegate` also receives `onMessagesSynced(_:)`. It fires after the SDK catches up on reconnect and carries updates to already-cached messages that changed while offline: reactions, edits, deletes and receipts. Messages that arrived while offline still come through the typed callbacks such as `onTextMessageReceived`.

Four more listeners report what the SDK does on the device rather than events from the server. Each is documented with examples on its own page.

| Listener | What it reports | Details |
|---|---|---|
| `OutboxListener` | Every outbox transition, app-wide: a message queued, sent or failed | [Send While Offline](/sdk/ios/offline-send) |
| `SyncListener` | Progress and outcome of each catch-up sync | [Stay in Sync](/sdk/ios/offline-sync) |
| `OfflineCacheResetListener` | The on-device cache was rebuilt, for example after the encryption key was lost | [Encrypt the Cache](/sdk/ios/offline-encryption) |
| `MediaDownloadListener` | A background media download finished or failed | [Media Caching](/sdk/ios/offline-media-caching) |

## Next Steps

<CardGroup cols={2}>
Expand Down
6 changes: 6 additions & 0 deletions sdk/ios/block-users.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,18 @@

## Block Users

Block users to prevent all communication with them. Use `blockUsers()` with an array of UIDs.

Check warning on line 30 in sdk/ios/block-users.mdx

View check run for this annotation

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

sdk/ios/block-users.mdx#L30

Did you really mean 'UIDs'?

<Tabs>
<Tab title="Swift">
```swift
let blockUsers = ["UID1", "UID2", "UID3"]

Check warning on line 35 in sdk/ios/block-users.mdx

View check run for this annotation

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

sdk/ios/block-users.mdx#L35

Did you really mean 'blockUsers'?

CometChat.blockUsers(blockUsers, onSuccess: {

Check warning on line 37 in sdk/ios/block-users.mdx

View check run for this annotation

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

sdk/ios/block-users.mdx#L37

Did you really mean 'onSuccess'?

print("Blocked user successfully.")

}, onError: { (error) in

Check warning on line 41 in sdk/ios/block-users.mdx

View check run for this annotation

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

sdk/ios/block-users.mdx#L41

Did you really mean 'onError'?

print("Blocked user failed with error: \\(error?.errorDescription)")

Expand All @@ -64,22 +64,22 @@
</Tab>
</Tabs>

Returns a dictionary with UIDs as keys and `"success"` or `"fail"` as values based on if the block operation for each UID was successful.

Check warning on line 67 in sdk/ios/block-users.mdx

View check run for this annotation

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

sdk/ios/block-users.mdx#L67

Did you really mean 'UIDs'?

## Unblock Users

Unblock previously blocked users using `unblockUsers()` with an array of UIDs.

Check warning on line 71 in sdk/ios/block-users.mdx

View check run for this annotation

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

sdk/ios/block-users.mdx#L71

Did you really mean 'UIDs'?

<Tabs>
<Tab title="Swift">
```swift
let unblockUsers = ["UID1", "UID2", "UID3"]

Check warning on line 76 in sdk/ios/block-users.mdx

View check run for this annotation

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

sdk/ios/block-users.mdx#L76

Did you really mean 'unblockUsers'?

CometChat.unblockUsers(unblockUsers, onSuccess: { (users) in

Check warning on line 78 in sdk/ios/block-users.mdx

View check run for this annotation

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

sdk/ios/block-users.mdx#L78

Did you really mean 'onSuccess'?

print("Unblocked user successfully.")

}, onError: { (error) in

Check warning on line 82 in sdk/ios/block-users.mdx

View check run for this annotation

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

sdk/ios/block-users.mdx#L82

Did you really mean 'onError'?

print("Unblocked user failed with error: \\(error?.errorDescription)")

Expand All @@ -105,7 +105,7 @@
</Tab>
</Tabs>

Returns a dictionary with UIDs as keys and `"success"` or `"fail"` as values based on if the unblock operation for each UID was successful.

Check warning on line 108 in sdk/ios/block-users.mdx

View check run for this annotation

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

sdk/ios/block-users.mdx#L108

Did you really mean 'UIDs'?

## Get List of Blocked Users

Expand All @@ -131,7 +131,7 @@
<Tab title="Swift">
```swift
let blockedUserRequest = BlockedUserRequest.BlockedUserRequestBuilder
.set(searchKeyword: "abc")

Check warning on line 134 in sdk/ios/block-users.mdx

View check run for this annotation

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

sdk/ios/block-users.mdx#L134

Did you really mean 'abc'?
.set(limit: 20)
.build();
```
Expand All @@ -150,7 +150,7 @@
<Tab title="Swift">
```swift
let blockedUserRequest = BlockedUserRequest.BlockedUserRequestBuilder
.set(searchKeyword: "abc")

Check warning on line 153 in sdk/ios/block-users.mdx

View check run for this annotation

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

sdk/ios/block-users.mdx#L153

Did you really mean 'abc'?
.set(limit: 20)
.set(direction: .both)
.build();
Expand All @@ -169,7 +169,7 @@

print("Blocked users: \\(users)")

}, onError : { (error) in

Check warning on line 172 in sdk/ios/block-users.mdx

View check run for this annotation

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

sdk/ios/block-users.mdx#L172

Did you really mean 'onError'?

print("Error while fetching the blocked user request: \\(error?.errorDescription)")

Expand Down Expand Up @@ -204,6 +204,12 @@

---

## Offline support

With offline support enabled (SDK 4.2.0 or later), `fetchNext` on a `BlockedUserRequest` has an overload that first delivers `onCachedUsers` from the SDK's own blocked-users list. The SDK refreshes that list on login and on each catch-up sync, and updates it when you call `blockUsers` or `unblockUsers`. The first cached page holds the whole list and later pages are empty. Then `onServerUsers` delivers the live page to reconcile by `uid`.

The cached page is empty when no users are blocked or when `set(searchKeyword:)` is set. Offline, the read ends with `onError`, code `ERROR_INTERNET_UNAVAILABLE`, after the cached page. Blocking and unblocking need a connection and are not queued. See [Show Cached Data](/sdk/ios/offline-cached-data).

## Next Steps

<CardGroup cols={2}>
Expand Down
6 changes: 6 additions & 0 deletions sdk/ios/campaigns.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@
| NotificationFeedItem | A single notification in the feed. Contains Card Schema JSON in its `content` field, a category for filtering, timestamps, and metadata. |
| NotificationCategory | A category label used for filter chips (e.g., "Promotions", "Updates"). |
| Card Schema JSON | The fully rendered card layout (images, text, buttons) inside `NotificationFeedItem.content`. Passed directly to the CometChat Cards renderer. |
| PushNotification | Represents a campaign push notification payload received via APNs. |

Check warning on line 198 in sdk/ios/campaigns.mdx

View check run for this annotation

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

sdk/ios/campaigns.mdx#L198

Did you really mean 'APNs'?

---

Expand All @@ -208,7 +208,7 @@
1. Fetch feed items via `NotificationFeedRequest`
2. For each item, extract `item.content` — this is the Card Schema JSON
3. Pass to the Cards renderer (`CometChatCardView`)
4. The renderer produces a native UIKit view from the JSON

Check warning on line 211 in sdk/ios/campaigns.mdx

View check run for this annotation

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

sdk/ios/campaigns.mdx#L211

Did you really mean 'UIKit'?

### Card Schema JSON Structure

Expand All @@ -221,7 +221,7 @@
{ "type": "button", "id": "btn_1", "label": "Shop Now", "action": { "type": "openUrl", "url": "https://..." } }
],
"style": { "background": {"light": "#FFFFFF", "dark": "#1E1E1E"}, "borderRadius": 12, "padding": 16 },
"fallbackText": "Flash Sale! Shop Now: https://..."

Check warning on line 224 in sdk/ios/campaigns.mdx

View check run for this annotation

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

sdk/ios/campaigns.mdx#L224

Did you really mean 'fallbackText'?
}
```

Expand Down Expand Up @@ -249,8 +249,8 @@
| ------ | ---- | ------- | ----------- |
| `set(limit:)` | `Int` | 20 | Items per page. |
| `set(readState:)` | `FeedReadState` | All | Filter by `.read` or `.unread`. Omit for all. |
| `set(category:)` | `String` | nil | Filter by category name. Sent as `templateCategory` query param. If `categoryId` is also set, `categoryId` takes priority. |

Check warning on line 252 in sdk/ios/campaigns.mdx

View check run for this annotation

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

sdk/ios/campaigns.mdx#L252

Did you really mean 'param'?
| `set(categoryId:)` | `String` | nil | Filter by category ID. Sent as `templateCategory` query param. Takes priority over `category` if both are set. |

Check warning on line 253 in sdk/ios/campaigns.mdx

View check run for this annotation

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

sdk/ios/campaigns.mdx#L253

Did you really mean 'param'?
| `set(channelId:)` | `String` | nil | Filter by channel. |
| `set(tags:)` | `[String]` | nil | Filter by tags (comma-joined). |
| `set(dateFrom:)` | `String` | nil | ISO 8601 date — items sent on or after. |
Expand All @@ -275,6 +275,12 @@

Call `fetchNext()` repeatedly for pagination. When the server has no more items, subsequent calls return an empty array.

### Offline support

With offline support enabled (SDK 4.2.0 or later), `fetchNext` on a `NotificationFeedRequest` has an overload that 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`, code `ERROR_INTERNET_UNAVAILABLE`, after the cached page.

The cached page replays what the server last returned for the same builder settings. `set(limit:)`, `set(readState:)`, `set(category:)`, `set(categoryId:)`, `set(channelId:)`, `set(tags:)`, `set(dateFrom:)` and `set(dateTo:)` are all part of the request. See [Show Cached Data](/sdk/ios/offline-cached-data).

### NotificationFeedItem Fields

| Field | Type | Description |
Expand Down Expand Up @@ -422,11 +428,11 @@

## Push Notification Tracking

When a campaign push notification arrives via APNs, use these methods to report delivery and click engagement.

Check warning on line 431 in sdk/ios/campaigns.mdx

View check run for this annotation

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

sdk/ios/campaigns.mdx#L431

Did you really mean 'APNs'?

### Setting Up Notification Service Extension

1. In Xcode: **File → New → Target** → select **Notification Service Extension**.

Check warning on line 435 in sdk/ios/campaigns.mdx

View check run for this annotation

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

sdk/ios/campaigns.mdx#L435

Did you really mean 'Xcode'?
2. Enable **App Groups** on both your main app target and the extension target with the same group ID (e.g., `group.com.yourapp.cometchat`).
3. Add `CometChatSDK` as a dependency to the extension target.

Expand Down
4 changes: 4 additions & 0 deletions sdk/ios/connection-status.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<Tabs>
<Tab title="Swift">
```swift
var connectionStatus = CometChat.getConnectionStatus?.value

Check warning on line 45 in sdk/ios/connection-status.mdx

View check run for this annotation

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

sdk/ios/connection-status.mdx#L45

Did you really mean 'connectionStatus'?
```
</Tab>
</Tabs>
Expand Down Expand Up @@ -103,6 +103,10 @@

---

## Offline support

With offline support enabled (SDK 4.2.0 or later), your app keeps working without a connection. Cached chats are shown instantly, and messages you send with the `onMessagePending` overloads are queued and delivered automatically on reconnect. See [Show Cached Data](/sdk/ios/offline-cached-data) and [Send While Offline](/sdk/ios/offline-send).

## Next Steps

<CardGroup cols={2}>
Expand Down
4 changes: 4 additions & 0 deletions sdk/ios/delete-group.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
```swift
let GUID = "GUID";

CometChat.deleteGroup(GUID: GUID, onSuccess: { (response) in

Check warning on line 36 in sdk/ios/delete-group.mdx

View check run for this annotation

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

sdk/ios/delete-group.mdx#L36

Did you really mean 'onSuccess'?
print("Group deleted successfully.")
}) { (error) in
print("Group delete failed with error: " + error!.errorDescription);
Expand All @@ -55,6 +55,10 @@

---

## Offline support

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, and any messages still queued to it fail with reason `.discarded`. See [Send While Offline](/sdk/ios/offline-send).

## Next Steps

<CardGroup cols={2}>
Expand Down
4 changes: 4 additions & 0 deletions sdk/ios/delete-message.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
})
```

The deleted message object is returned with `deletedAt` (timestamp) and `deletedBy` (UID of deleter) fields set.

Check warning on line 44 in sdk/ios/delete-message.mdx

View check run for this annotation

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

sdk/ios/delete-message.mdx#L44

Did you really mean 'deleter'?

The `delete()` method returns a [`BaseMessage`](/sdk/reference/messages#basemessage) object.

Expand Down Expand Up @@ -104,6 +104,10 @@

---

## Offline support

Deleting a message needs a connection. With offline support enabled, a delete is not queued for later. After `onSuccess`, the deletion is applied to the message in the on-device cache if it is already cached. It never adds a new message. See [Send While Offline](/sdk/ios/offline-send).

## Next Steps

<CardGroup cols={2}>
Expand Down
4 changes: 4 additions & 0 deletions sdk/ios/edit-message.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@ You must be the message sender or a group admin/moderator to edit a message.

---

## Offline support

Editing a message needs a connection. With offline support enabled, an edit is not queued for later. After `onSuccess`, the edit is applied to the message in the on-device cache if it is already cached. It never adds a new message. See [Send While Offline](/sdk/ios/offline-send).

## Next Steps

<CardGroup cols={2}>
Expand Down
27 changes: 27 additions & 0 deletions sdk/ios/group-kick-member.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: "Kick Member From A Group"
sidebarTitle: "Kick & Ban Members"
description: "Learn how to kick, ban, and unban group members, fetch banned member lists, and receive real-time events using the CometChat iOS SDK."

Check warning on line 4 in sdk/ios/group-kick-member.mdx

View check run for this annotation

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

sdk/ios/group-kick-member.mdx#L4

Did you really mean 'unban'?
---

<Accordion title="AI Integration Quick Reference">
Expand Down Expand Up @@ -37,12 +37,12 @@
<Tabs>
<Tab title="Swift">
```swift
let uid = "cometchat-uid-2"

Check warning on line 40 in sdk/ios/group-kick-member.mdx

View check run for this annotation

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

sdk/ios/group-kick-member.mdx#L40

Did you really mean 'uid'?
let guid = "cometchat-guid-1"

Check warning on line 41 in sdk/ios/group-kick-member.mdx

View check run for this annotation

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

sdk/ios/group-kick-member.mdx#L41

Did you really mean 'guid'?

CometChat.kickGroupMember(UID: uid, GUID: guid, onSuccess: { (response) in

Check warning on line 43 in sdk/ios/group-kick-member.mdx

View check run for this annotation

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

sdk/ios/group-kick-member.mdx#L43

Did you really mean 'uid'?

Check warning on line 43 in sdk/ios/group-kick-member.mdx

View check run for this annotation

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

sdk/ios/group-kick-member.mdx#L43

Did you really mean 'guid'?

Check warning on line 43 in sdk/ios/group-kick-member.mdx

View check run for this annotation

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

sdk/ios/group-kick-member.mdx#L43

Did you really mean 'onSuccess'?
print("\(uid) is kicked from the group \(guid) successfully.")

Check warning on line 44 in sdk/ios/group-kick-member.mdx

View check run for this annotation

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

sdk/ios/group-kick-member.mdx#L44

Did you really mean 'uid'?

Check warning on line 44 in sdk/ios/group-kick-member.mdx

View check run for this annotation

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

sdk/ios/group-kick-member.mdx#L44

Did you really mean 'guid'?
}, onError: { (error) in

Check warning on line 45 in sdk/ios/group-kick-member.mdx

View check run for this annotation

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

sdk/ios/group-kick-member.mdx#L45

Did you really mean 'onError'?
print("Error: \(error?.errorDescription)")
})
```
Expand Down Expand Up @@ -75,12 +75,12 @@
<Tabs>
<Tab title="Swift">
```swift
let uid = "cometchat-uid-2"

Check warning on line 78 in sdk/ios/group-kick-member.mdx

View check run for this annotation

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

sdk/ios/group-kick-member.mdx#L78

Did you really mean 'uid'?
let guid = "cometchat-guid-1"

Check warning on line 79 in sdk/ios/group-kick-member.mdx

View check run for this annotation

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

sdk/ios/group-kick-member.mdx#L79

Did you really mean 'guid'?

CometChat.banGroupMember(UID: uid, GUID: guid, onSuccess: { (response) in

Check warning on line 81 in sdk/ios/group-kick-member.mdx

View check run for this annotation

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

sdk/ios/group-kick-member.mdx#L81

Did you really mean 'onSuccess'?
print("\(uid) is banned from the group \(guid) successfully.")

Check warning on line 82 in sdk/ios/group-kick-member.mdx

View check run for this annotation

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

sdk/ios/group-kick-member.mdx#L82

Did you really mean 'uid'?

Check warning on line 82 in sdk/ios/group-kick-member.mdx

View check run for this annotation

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

sdk/ios/group-kick-member.mdx#L82

Did you really mean 'guid'?
}, onError: { (error) in

Check warning on line 83 in sdk/ios/group-kick-member.mdx

View check run for this annotation

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

sdk/ios/group-kick-member.mdx#L83

Did you really mean 'onError'?
print("Error: \(error?.errorDescription)")
})
```
Expand All @@ -101,9 +101,9 @@

The banned user will be no longer part of the group and can not perform any actions in the group. A banned user cannot rejoin the same group without being unbanned.

## Unban a Group Member

Check warning on line 104 in sdk/ios/group-kick-member.mdx

View check run for this annotation

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

sdk/ios/group-kick-member.mdx#L104

Did you really mean 'Unban'?

Admins or Moderators can unban a previously banned member using `unbanGroupMember()`.

Check warning on line 106 in sdk/ios/group-kick-member.mdx

View check run for this annotation

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

sdk/ios/group-kick-member.mdx#L106

Did you really mean 'unban'?

| Parameter | Description |
|-----------|-------------|
Expand All @@ -116,9 +116,9 @@
let uid = "cometchat-uid-2"
let guid = "cometchat-guid-1"

CometChat.unbanGroupMember(UID: uid, GUID: guid, onSuccess: { (response) in

Check warning on line 119 in sdk/ios/group-kick-member.mdx

View check run for this annotation

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

sdk/ios/group-kick-member.mdx#L119

Did you really mean 'onSuccess'?
print("\(uid) is unbanned from the group \(guid) successfully.")
}, onError: { (error) in

Check warning on line 121 in sdk/ios/group-kick-member.mdx

View check run for this annotation

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

sdk/ios/group-kick-member.mdx#L121

Did you really mean 'onError'?
print("Error: \(error?.errorDescription)")
})
```
Expand Down Expand Up @@ -166,12 +166,27 @@
```swift
let bannedGroupMembersRequest = BannedGroupMembersRequest.BannedGroupMembersRequestBuilder(guid: "cometchat-guid-1")
.set(limit: 30)
.set(searchKeyword: "abc")

Check warning on line 169 in sdk/ios/group-kick-member.mdx

View check run for this annotation

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

sdk/ios/group-kick-member.mdx#L169

Did you really mean 'abc'?
.build()
```
</Tab>
</Tabs>

### Set Scopes

Filters banned members by scope.

<Tabs>
<Tab title="Swift">
```swift
let bannedGroupMembersRequest = BannedGroupMembersRequest.BannedGroupMembersRequestBuilder(guid: "cometchat-guid-1")
.set(limit: 30)
.set(scopes: ["admin", "moderator"])
.build()
```
</Tab>
</Tabs>

Once configured, call `build()` to create the request, then `fetchNext()` to retrieve banned members.

<Tabs>
Expand All @@ -188,7 +203,7 @@
for bannedMember in groupMembers {
print("Banned member: \(bannedMember.stringValue())")
}
}, onError: { (error) in

Check warning on line 206 in sdk/ios/group-kick-member.mdx

View check run for this annotation

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

sdk/ios/group-kick-member.mdx#L206

Did you really mean 'onError'?
print("Error: \(error?.errorDescription)")
})
```
Expand All @@ -211,6 +226,18 @@
</Tab>
</Tabs>

### Offline support

With offline support enabled (SDK 4.2.0 or later), `fetchNext` on a `BannedGroupMembersRequest` has an overload that first delivers `onCachedBannedGroupMembers` from the device, then `onServerBannedGroupMembers` with the live page to reconcile by `uid`. Offline, the read ends with `onError`, 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.

| Builder method | Offline |
|---|---|
| `set(limit:)` | Cached |
| `set(scopes:)` | Cached |
| `set(searchKeyword:)` | Server only |

Kicking, banning and unbanning need a connection and are not queued. See [Show Cached Data](/sdk/ios/offline-cached-data).

## Real-Time Kick/Ban/Unban Events

Implement these `CometChatGroupDelegate` methods to receive real-time notifications:
Expand Down
4 changes: 4 additions & 0 deletions sdk/ios/mentions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@
<Tabs>
<Tab title="Swift (User)">
```swift
let messageText = "Hello <@uid:cometchat-uid-1>, how are you?"

Check warning on line 48 in sdk/ios/mentions.mdx

View check run for this annotation

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

sdk/ios/mentions.mdx#L48

Did you really mean 'messageText'?
let textMessage = TextMessage(receiverUid: "cometchat-uid-2", text: messageText, receiverType: .user)

Check warning on line 49 in sdk/ios/mentions.mdx

View check run for this annotation

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

sdk/ios/mentions.mdx#L49

Did you really mean 'textMessage'?

Check warning on line 49 in sdk/ios/mentions.mdx

View check run for this annotation

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

sdk/ios/mentions.mdx#L49

Did you really mean 'messageText'?

Check warning on line 49 in sdk/ios/mentions.mdx

View check run for this annotation

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

sdk/ios/mentions.mdx#L49

Did you really mean 'receiverType'?

CometChat.sendTextMessage(message: textMessage) { message in

Check warning on line 51 in sdk/ios/mentions.mdx

View check run for this annotation

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

sdk/ios/mentions.mdx#L51

Did you really mean 'textMessage'?
print("Mentioned users: \(message.mentionedUsers)")
} onError: { error in

Check warning on line 53 in sdk/ios/mentions.mdx

View check run for this annotation

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

sdk/ios/mentions.mdx#L53

Did you really mean 'onError'?
print("Error: \(error?.errorDescription)")
}
```
Expand Down Expand Up @@ -89,7 +89,7 @@
<Tabs>
<Tab title="Swift (User)">
```swift
let messagesRequest = MessagesRequest(builder: MessagesRequest.MessageRequestBuilder()

Check warning on line 92 in sdk/ios/mentions.mdx

View check run for this annotation

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

sdk/ios/mentions.mdx#L92

Did you really mean 'messagesRequest'?
.set(uid: "cometchat-uid-2")
.set(limit: 50)
.mentionsWithTagInfo(true))
Expand All @@ -100,7 +100,7 @@
print("User tags: \(user.tags)")
}
}
} onError: { error in

Check warning on line 103 in sdk/ios/mentions.mdx

View check run for this annotation

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

sdk/ios/mentions.mdx#L103

Did you really mean 'onError'?
print("Error: \(error?.errorDescription)")
}
```
Expand Down Expand Up @@ -130,7 +130,7 @@
<Tabs>
<Tab title="Swift (User)">
```swift
let messagesRequest = MessagesRequest(builder: MessagesRequest.MessageRequestBuilder()

Check warning on line 133 in sdk/ios/mentions.mdx

View check run for this annotation

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

sdk/ios/mentions.mdx#L133

Did you really mean 'messagesRequest'?
.set(uid: "cometchat-uid-2")
.set(limit: 50)
.mentionsWithBlockedInfo(true))
Expand All @@ -142,7 +142,7 @@
print("Blocked by me: \(user.blockedByMe)")
}
}
} onError: { error in

Check warning on line 145 in sdk/ios/mentions.mdx

View check run for this annotation

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

sdk/ios/mentions.mdx#L145

Did you really mean 'onError'?
print("Error: \(error?.errorDescription)")
}
```
Expand Down Expand Up @@ -179,14 +179,14 @@
<Tabs>
<Tab title="Swift">
```swift
let wasMentioned = message.mentionedMe // Returns Bool

Check warning on line 182 in sdk/ios/mentions.mdx

View check run for this annotation

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

sdk/ios/mentions.mdx#L182

Did you really mean 'wasMentioned'?
```
</Tab>
</Tabs>

| Property | Type | Description |
|----------|------|-------------|
| mentionedMe | `Bool` | `true` if logged-in user was mentioned |

Check warning on line 189 in sdk/ios/mentions.mdx

View check run for this annotation

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

sdk/ios/mentions.mdx#L189

Did you really mean 'mentionedMe'?

---

Expand All @@ -194,7 +194,7 @@

| Property | Type | Description |
|----------|------|-------------|
| uid | `String` | Unique user identifier |

Check warning on line 197 in sdk/ios/mentions.mdx

View check run for this annotation

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

sdk/ios/mentions.mdx#L197

Did you really mean 'uid'?
| name | `String` | User's display name |
| avatar | `String?` | User's avatar URL |
| tags | `[String]` | User's tags (with `mentionsWithTagInfo`) |
Expand All @@ -203,6 +203,10 @@

---

## Offline support

With offline support enabled (SDK 4.2.0 or later), a message with mentions is sent like any other message: use the overload with `onMessagePending`, `onMessageSent` and `onError`. Offline, `onError` with code `ERROR_INTERNET_UNAVAILABLE` means the message is queued, not failed (with `autoSendPendingOnReconnect` on, the default). Mention fetches run in two phases: `onCachedMessages` delivers the cached page first (even when empty), then `onServerMessages`. See [Send While Offline](/sdk/ios/offline-send) and [Show Cached Data](/sdk/ios/offline-cached-data).

## Next Steps

<CardGroup cols={2}>
Expand Down
Loading
Loading