From 8df54dace1ed974ef205df1858fe7e7d37952315 Mon Sep 17 00:00:00 2001 From: rajdubey Date: Mon, 16 Nov 2026 18:03:34 +0530 Subject: [PATCH 01/13] docs(ios): offline support for the iOS UI Kit Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01WEaVigCRBjkftm78T25MQA --- docs.json | 1 + ui-kit/ios/core-features.mdx | 27 ++- ui-kit/ios/llms-ios-v5.mdx | 1 + ui-kit/ios/offline-support.mdx | 381 +++++++++++++++++++++++++++++++++ 4 files changed, 409 insertions(+), 1 deletion(-) create mode 100644 ui-kit/ios/offline-support.mdx diff --git a/docs.json b/docs.json index 40eea0779..4663677e8 100644 --- a/docs.json +++ b/docs.json @@ -1409,6 +1409,7 @@ "group": "Chat", "pages": [ "ui-kit/ios/core-features", + "ui-kit/ios/offline-support", "ui-kit/ios/extensions", "ui-kit/ios/ai-features" ] diff --git a/ui-kit/ios/core-features.mdx b/ui-kit/ios/core-features.mdx index 803f8232a..8bd797549 100644 --- a/ui-kit/ios/core-features.mdx +++ b/ui-kit/ios/core-features.mdx @@ -18,7 +18,8 @@ description: "Review CometChat iOS UI Kit core features for messaging, media sha {"name": "threadedConversations", "description": "Reply to specific messages in threads", "component": "CometChatThreadedMessageHeader", "enabledByDefault": true}, {"name": "threadSubscription", "description": "Subscribe to or unsubscribe from a thread's replies", "component": "CometChatMessageList", "enabledByDefault": false}, {"name": "groupChat", "description": "Create and manage group conversations", "component": "CometChatGroups", "enabledByDefault": true}, - {"name": "search", "description": "Search across conversations and messages", "component": "CometChatSearch", "enabledByDefault": true} + {"name": "search", "description": "Search across conversations and messages", "component": "CometChatSearch", "enabledByDefault": true}, + {"name": "offlineSupport", "description": "Show saved chats without a connection and queue sends until reconnect; turn on with UIKitSettings.setOfflineConfig(_:)", "component": "CometChatMessageList", "enabledByDefault": false} ], "relatedComponents": ["CometChatMessageList", "CometChatConversations", "CometChatMessageList", "CometChatMessageComposer"] } @@ -827,6 +828,30 @@ class SearchViewController: UIViewController { - [MessageHeader](/ui-kit/ios/message-header) - Search within conversation - [Conversations](/ui-kit/ios/conversations) - Search conversations +## Offline Support + +*Available since v5.3.0* + +Show chats the user has opened before without a connection, and queue messages sent offline until the connection returns. Lists show their saved rows first, unsent messages offer Retry and Delete, and every screen shows a clear "Connect to load …" state when it has nothing saved. Offline support is off by default. + +```swift lines +import CometChatUIKitSwift +import CometChatSDK + +let uikitSettings = UIKitSettings() + .set(appID: "APP_ID") + .set(region: "REGION") + .set(authKey: "AUTH_KEY") + .setOfflineConfig(OfflineConfig.Builder().setEnabled(true).build()) + .build() + +CometChatUIKit.init(uiKitSettings: uikitSettings) { result in + // Log in and show the UI Kit screens as usual. +} +``` + +Offline support needs Chat SDK 4.2.1 or later. See [Offline Support](/ui-kit/ios/offline-support) for requirements, component behaviour, texts, styling and events. + ## Moderation Automatically filter inappropriate content. diff --git a/ui-kit/ios/llms-ios-v5.mdx b/ui-kit/ios/llms-ios-v5.mdx index 45bffa8d2..165f9d36f 100644 --- a/ui-kit/ios/llms-ios-v5.mdx +++ b/ui-kit/ios/llms-ios-v5.mdx @@ -132,6 +132,7 @@ component-level corrections from the component pages on top. - [Color Resources](/ui-kit/ios/color-resources) ## Features and extras +- [Offline Support](/ui-kit/ios/offline-support) - [Extensions](/ui-kit/ios/extensions) - [Campaigns](/ui-kit/ios/campaigns) - [Localize](/ui-kit/ios/localize) diff --git a/ui-kit/ios/offline-support.mdx b/ui-kit/ios/offline-support.mdx new file mode 100644 index 000000000..7737c85e3 --- /dev/null +++ b/ui-kit/ios/offline-support.mdx @@ -0,0 +1,381 @@ +--- +title: "Offline Support" +sidebarTitle: "Offline Support" +description: "Turn on offline support in the CometChat iOS UI Kit so saved chats open without a connection, sends queue until reconnect, and every list shows clear offline states." +--- + + + +| Field | Value | +| --- | --- | +| Default | Off. Nothing changes until you pass an `OfflineConfig` | +| Enable | `UIKitSettings().setOfflineConfig(OfflineConfig(enabled: true))` before `build()`, then `CometChatUIKit.init(uiKitSettings:)` | +| UI Kit | `CometChatUIKitSwift` 5.3.0 or later (Swift Package Manager) | +| Chat SDK | `CometChatSDK` 4.2.1 or later (resolved by the UI Kit package) | +| `OfflineConfig` options | [iOS SDK offline reference](/sdk/ios/offline-reference) | +| Styling | `CometChatMessageList.offlineStyle` (`CometChatOfflineStyle`) | +| Hide notices | `hideOfflineNotices` on `CometChatMessageList` and `CometChatConversations` | +| Events | `ccMessageSendStateChanged`, `ccOfflineCacheReset` on `CometChatMessageEventListener` | +| Discarded send | `CometChatUIKit.sendFormMessage` / `sendCardMessage` / `sendSchedulerMessage` call `onError` with `ERROR_OFFLINE_MESSAGE_DISCARDED` on logout or cache reset | + + + +With offline support turned on, the iOS UI Kit reads from the Chat SDK's on-device cache. Chats the user has opened before appear at once, even with no connection. Messages sent while offline wait in a queue and go out when the connection returns. Every list shows a clear state when it has nothing saved and can't reach the server. + +The UI Kit builds on the Chat SDK's offline support. This page covers what the UI Kit adds on top. For cache settings, encryption, media caching and sync, see the [iOS SDK offline docs](/sdk/ios/offline-overview). + +## Overview + +**Works offline:** +- Conversations, users, groups and group members you have loaded before show at once from the cache. +- Saved message history, including threads, opens without a connection. +- New messages, including media, are queued and sent automatically on reconnect. A queued message shows a clock until it is sent. +- Images, video, audio and files that are on the device open from the saved copy. +- After a reconnect, the SDK's catch-up brings in what changed while you were away, including a kick, ban or leave in a group. + +**Needs a connection:** +- The first load of any chat or list that was never opened before. +- Keyword search with no saved match. +- Editing or deleting a sent message, and adding or removing a reaction. These aren't queued. They report an error when there is no connection, and a failed reaction is rolled back. +- Message information, call logs, calls and AI streamed replies. +- Media that has no copy on the device. + +## Requirements + +| Requirement | Version | +| --- | --- | +| CometChat iOS UI Kit (`CometChatUIKitSwift`) | 5.3.0 or later | +| CometChat iOS Chat SDK (`CometChatSDK`) | 4.2.1 or later | +| iOS | 15.1 or later | +| Xcode | 16 or later | + +The UI Kit links the Chat SDK directly, so the higher SDK minimum applies to every app on UI Kit 5.3.0, whether or not it turns offline on. The UI Kit calls `CometChat.initFromSettings(offlineConfig:onSuccess:onError:)`, which Chat SDK 4.2.0 doesn't have. UI Kit 5.3.0 therefore needs a later Chat SDK, even though the [SDK offline pages](/sdk/ios/offline-enable) list 4.2.0 for using the SDK on its own. + +Install or update the UI Kit with Swift Package Manager: + +1. Go to **File → Add Package Dependencies** (or select the existing package to update it). +2. Enter the repository URL: + +``` +https://github.com/cometchat/cometchat-uikit-ios +``` + +3. Select **Up to Next Major Version** and enter: + +``` +5.3.0 +``` + +4. Add the **CometChatUIKitSwift** product to your app target. + +Swift Package Manager resolves `CometChatSDK` for you. If your project pins `chat-sdk-ios` to an exact version or to **Up to Next Minor Version** on 4.1.x, package resolution fails. Change that rule to **Up to Next Major Version** from 4.2.1. + + +**CocoaPods:** the latest UI Kit on CocoaPods is 5.1.18, and new releases ship through Swift Package Manager only. Offline support isn't available through CocoaPods. Move CocoaPods projects to Swift Package Manager to use it. + + +## Enable offline support + +Offline support is **off by default**. Turn it on by passing an `OfflineConfig` to `UIKitSettings.setOfflineConfig(_:)` before you call `build()` and `CometChatUIKit.init`. The UI Kit passes the config straight to the Chat SDK and stores nothing of its own. + +```swift lines +import UIKit +import CometChatUIKitSwift +import CometChatSDK + +class SceneDelegate: UIResponder, UIWindowSceneDelegate { + + var window: UIWindow? + + func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { + guard let windowScene = (scene as? UIWindowScene) else { return } + + // Offline support is off unless you set a config with enabled = true. + let offlineConfig = OfflineConfig.Builder() + .setEnabled(true) + .build() + + let uikitSettings = UIKitSettings() + .set(appID: "APP_ID") // Replace with your App ID + .set(region: "REGION") // Replace with your Region + .set(authKey: "AUTH_KEY") // Replace with your Auth Key (dev only) + .subscribePresenceForAllUsers() + .setOfflineConfig(offlineConfig) + .build() + + CometChatUIKit.init(uiKitSettings: uikitSettings) { result in + switch result { + case .success: + // Log in, then show the UI Kit screens as usual. + debugPrint("CometChat initialized with offline support") + case .failure(let error): + debugPrint("Initialization failed: \(error.localizedDescription)") + } + } + } +} +``` + +`OfflineConfig` has more options, such as cache size, retention, the pending-message limit, encryption and media caching. Set only the ones you need. Every option is described in the [Configuration & API Reference](/sdk/ios/offline-reference#offlineconfig-options). You can also create the config with `OfflineConfig(enabled: true)`, as shown in [Enable Offline Support](/sdk/ios/offline-enable). + + +Offline support is active only while a user is logged in. Call `CometChat.isOfflineEnabled()` at the moment you need to know. See [Verify it is active](/sdk/ios/offline-enable). + + +## How the components behave offline + +### Lists: Conversations, Users, Groups and Group Members + +- Saved rows show first. The server page then loads and updates the list in place. +- Rows already on screen stay when a load can't reach the server. A failure caused by having no connection shows no error view. +- With nothing saved and no connection, the list shows an icon and **Connect to load chats** (or users, groups, members). This state has no Retry button. The list loads once by itself when the connection returns. +- Lists opened with only a filter, such as online users, tags, a scope, banned members or unread chats, behave like a plain list and show **Connect to load …**. +- Only a server answer of an empty page ends paging. + +### Search + +A **keyword** search with no saved match while offline shows **Connect to search** with a second line, **Search needs an internet connection.** It doesn't call `onError`. This applies to a non-empty keyword from the search box or from the list's request builder. A list opened with filters alone shows **Connect to load …** instead. + +`CometChatSearch` shows **Connect to search** when a keyword search can't connect, or when both the conversation and message requests fail because the device isn't connected. Results already on screen stay. A search showing the offline state runs again once when the connection returns. + +### Message list and threads + +- Saved history shows at once. Older and newer pages come from the cache first, then from the server. +- A chat that was never saved, opened offline, shows **Connect to load messages** and calls `onError`. It loads once by itself when the connection returns. +- When the list reaches the end of the saved messages with no connection, it shows a tappable **Connect to load more** row at that edge: older messages at the top, newer ones at the bottom. Tap it to try again. On reconnect each blocked edge loads once by itself, older first. Scrolling loads older messages again once the connection is back. +- Jumping to a message and starting from the first unread anchor on that message first. Paging and live messages don't scroll the list away until it has settled, for at most 6 seconds. If the target isn't saved and the server can't be reached, the chat stays on its newest page. +- When more messages arrive than one refresh can bridge, a **Jump to latest** pill appears. Your reading position stays until you tap it. +- Images, video, audio and files show the on-device copy first. With no copy and no connection, the bubble shows a placeholder with the file name, size and **Available when online**. It redraws as the normal bubble when the connection returns. Tapping it while connected asks the SDK to download the file. + +### Composer and unsent messages + +- A message sent while offline appears at once with a clock. It goes out automatically on reconnect. Media attachments queue the same way. +- An unsent message (pending, sending or failed) offers only **Retry** and **Delete** in its long-press menu and its VoiceOver actions. It offers no Copy, Reply, React or Edit until it has been sent. +- A failed message shows **Not sent. Tap to retry** under the bubble. Tapping that line or the failed icon retries it. Every failed message can be retried, whatever the reason. +- **Retry** asks the SDK to retry the queued message, so it never creates a duplicate. A message the SDK never queued (for example, refused because the queue was full or the file was too large) is sent again as a new send. +- **Delete** removes the unsent message. If it was already sent in the meantime, the sent copy is deleted instead. +- If the message is being sent at that moment, Retry and Delete change nothing and the list shows **Sending… try again in a moment** for 4 seconds. +- A full queue shows **Too many messages waiting to send**. A file that is too big for the offline media cache shows **File too large to send offline**. Each notice shows once per message. + +### Presence + +While the SDK isn't connected, nobody shows as online: there's no online dot in any list and no "Online" or last-seen subtitle in the message header. Presence returns when the UI Kit fetches users again after reconnecting. + +### Pinned, Saved, Reactions and Notifications + +`CometChatPinnedMessages`, `CometChatSavedMessages`, the reaction list and `CometChatNotificationFeed` follow the same rules as the other lists. Saved rows show first. With nothing saved and no connection, they show **Connect to load messages**, **Connect to load reactions** or **Connect to load notifications**. + +### Logout and user switch + +Cached data belongs to the logged-in user. On logout or a user switch, the UI Kit clears every list on screen, search results, the notification feed, the pinned and saved panels and the composer's upload tray before the next user's first frame. Any message still waiting to be sent is answered with `ERROR_OFFLINE_MESSAGE_DISCARDED`. See [Send completions](#send-completions). + +## Offline states and texts + +Override any of these texts by defining the same key in your app's `Localizable.strings`, as described in [Localize](/ui-kit/ios/localize). Every language the UI Kit ships includes them. + +| Text | Key | Where it appears | +| --- | --- | --- | +| Connect to load chats | `CONNECT_TO_LOAD_CHATS` | `CometChatConversations` with nothing saved, offline | +| Connect to load users | `CONNECT_TO_LOAD_USERS` | `CometChatUsers` | +| Connect to load groups | `CONNECT_TO_LOAD_GROUPS` | `CometChatGroups` | +| Connect to load members | `CONNECT_TO_LOAD_MEMBERS` | `CometChatGroupMembers` | +| Connect to load messages | `CONNECT_TO_LOAD_MESSAGES` | `CometChatMessageList`, `CometChatPinnedMessages`, `CometChatSavedMessages` | +| Connect to load reactions | `CONNECT_TO_LOAD_REACTIONS` | Reaction list | +| Connect to load notifications | `CONNECT_TO_LOAD_NOTIFICATIONS` | `CometChatNotificationFeed` | +| Connect to search | `CONNECT_TO_SEARCH` | Keyword search in a list, offline, no saved match | +| Connect to search | `CONNECT_TO_SEARCH_MESSAGES` | `CometChatSearch` | +| Search needs an internet connection. | `CONNECT_TO_SEARCH_SUBTITLE` | Second line under "Connect to search" | +| Connect to load more | `CONNECT_TO_LOAD_MORE` | Message list and threads, at a blocked edge | +| Not sent yet | `MESSAGE_NOT_SENT_YET` | VoiceOver label of a queued message's clock | +| Not sent. Tap to retry | `MESSAGE_NOT_SENT_TAP_TO_RETRY` | Under a failed message | +| Sending… try again in a moment | `SEND_IN_FLIGHT` | Retry or Delete on a message being sent | +| Available when online | `MEDIA_AVAILABLE_WHEN_ONLINE` | Media placeholder | +| Jump to latest | `JUMP_TO_LATEST` | Message list pill | +| Too many messages waiting to send | `OFFLINE_QUEUE_FULL` | Notice when the queue is full | +| File too large to send offline | `OFFLINE_FILE_TOO_LARGE` | Notice when media doesn't fit the cache | +| 1 unsent message was removed | `UNSENT_MESSAGE_REMOVED` | Notice | +| 1 message wasn't sent / %d messages weren't sent | `MESSAGES_NOT_SENT_ONE` / `MESSAGES_NOT_SENT_OTHER` | Notice | +| 1 unsent message couldn't be recovered / %d unsent messages couldn't be recovered | `UNSENT_MESSAGES_LOST_ONE` / `UNSENT_MESSAGES_LOST_OTHER` | Notice after the SDK resets its cache | +| Some unsent messages may not have been sent | `UNSENT_MESSAGES_MAYBE_LOST` | Notice after a cache reset with an unknown count | + +## Errors and callbacks + +### When `onError` fires + +With offline support on, every list follows the same rules: + +- **Rows on screen, no connection:** the rows stay. No error view, no `onError`. +- **Rows on screen, any other error:** the rows stay. `onError` fires once if the user or your app started the load: opening the screen, pull to refresh, a new keyword, paging, a jump or Retry. A reload the UI Kit starts itself after a reconnect, sync or cache reset stays quiet. +- **Nothing on screen, no connection:** the **Connect to load …** state shows, and `onError` fires once. +- **Nothing on screen, any other error:** the error view with Retry shows, and `onError` fires. +- **Keyword search offline with nothing saved:** **Connect to search** shows, with no `onError`. +- **Empty server answer:** the normal empty view. + +`CometChatSearch` and the reaction list now also have `set(onError:)`. + +### Send completions + +`CometChatUIKit.sendFormMessage`, `CometChatUIKit.sendCardMessage` and `CometChatUIKit.sendSchedulerMessage` answer each send once: + +- `onSuccess` fires when the server accepts the message. +- `onError` fires when the SDK reports a failure. +- A send that is only queued (offline) calls neither while the session lasts. +- If the user logs out, switches user, or the offline cache is reset before the message was sent, `onError` fires once, quietly, with the error code `ERROR_OFFLINE_MESSAGE_DISCARDED`. The UI Kit shows no error for it: the message row going away is the only visible signal. + +```swift lines +import CometChatUIKitSwift +import CometChatSDK + +func send(_ formMessage: FormMessage) { + CometChatUIKit.sendFormMessage(formMessage, onSuccess: { sent in + print("Form message sent: \(sent.id)") + }, onError: { error in + if error?.errorCode == "ERROR_OFFLINE_MESSAGE_DISCARDED" { + // Logout, user switch or cache reset before it was sent. Don't show an error. + return + } + print("Send failed: \(error?.errorDescription ?? "")") + }) +} +``` + +The UI Kit's own senders (the composers, stickers and smart replies) handle this case themselves and show no error. + +### Offline events + +`CometChatMessageEventListener` has two events for offline support. Both have empty default bodies, so you implement only the ones you need. Neither fires while offline support is off. + +| Event | Fires when | +| --- | --- | +| `ccMessageSendStateChanged(message:state:reason:)` | An own message moves between `CometChatMessageSendState` values: `.sending`, `.sent`, `.failed` or `.discarded`. `reason` is the SDK's `CometChat.MessageFailureReason`, if any. | +| `ccOfflineCacheReset(reason:pendingMessagesLost:)` | The Chat SDK reset its on-device cache. `pendingMessagesLost` is `CometChat.offlinePendingCountUnknown` (`-1`) when the SDK can't tell how many unsent messages were lost. | + +```swift lines +import UIKit +import CometChatUIKitSwift +import CometChatSDK + +class ChatViewController: UIViewController, CometChatMessageEventListener { + + override func viewDidLoad() { + super.viewDidLoad() + CometChatMessageEvents.addListener("offline-listener", self) + } + + override func viewWillDisappear(_ animated: Bool) { + super.viewWillDisappear(animated) + CometChatMessageEvents.removeListener("offline-listener") + } + + func ccMessageSendStateChanged(message: BaseMessage, state: CometChatMessageSendState, reason: CometChat.MessageFailureReason?) { + print("Message \(message.muid) is now \(state)") + } + + func ccOfflineCacheReset(reason: CometChat.OfflineCacheResetReason, pendingMessagesLost: Int) { + print("Offline cache reset, unsent messages lost: \(pendingMessagesLost)") + } +} +``` + +For the SDK's own reasons and error codes, see the [Configuration & API Reference](/sdk/ios/offline-reference#error-codes). + +## Customization + +### Offline style + +`CometChatMessageList.offlineStyle` is a global `CometChatOfflineStyle`. Each property defaults to the theme's existing error or secondary-text tokens, so nothing changes until you set one. + +| Property | Type | Default | Applies to | +| --- | --- | --- | --- | +| `retryTextColor` | `UIColor` | `CometChatTheme.errorColor` | "Not sent. Tap to retry" | +| `retryTextFont` | `UIFont` | `CometChatTypography.Caption1.medium` | "Not sent. Tap to retry" | +| `failedIconTint` | `UIColor?` | `nil` (the receipt style's error tint) | Failed status icon of an unsent message | +| `notSentYetTextColor` | `UIColor` | `CometChatTheme.textColorSecondary` | "Not sent yet", where shown as text | +| `notSentYetTextFont` | `UIFont` | `CometChatTypography.Caption1.regular` | "Not sent yet", where shown as text | +| `mediaPlaceholderTextColor` | `UIColor` | `CometChatTheme.textColorSecondary` | "Available when online" media placeholder | +| `mediaPlaceholderTextFont` | `UIFont` | `CometChatTypography.Caption1.regular` | "Available when online" media placeholder | +| `footerTextColor` | `UIColor` | `CometChatTheme.textColorSecondary` | "Connect to load more" rows | +| `footerTextFont` | `UIFont` | `CometChatTypography.Caption1.regular` | "Connect to load more" rows | +| `jumpToLatestTextColor` | `UIColor` | `CometChatTheme.white` | "Jump to latest" pill text | +| `jumpToLatestTextFont` | `UIFont` | `CometChatTypography.Caption1.medium` | "Jump to latest" pill text | +| `jumpToLatestBackgroundColor` | `UIColor` | `CometChatTheme.primaryColor` | "Jump to latest" pill background | + +```swift lines +import UIKit +import CometChatUIKitSwift + +var offlineStyle = CometChatOfflineStyle() +offlineStyle.retryTextColor = .systemRed +offlineStyle.footerTextColor = .systemGray +offlineStyle.jumpToLatestTextColor = .white +offlineStyle.jumpToLatestBackgroundColor = .systemIndigo +offlineStyle.jumpToLatestTextFont = .systemFont(ofSize: 13, weight: .semibold) + +CometChatMessageList.offlineStyle = offlineStyle +``` + +### Hide offline notices + +| Property | Component | Default | Hides | +| --- | --- | --- | --- | +| `hideOfflineNotices` | `CometChatMessageList` | `false` | The offline notices (a removed unsent message, a full queue, unsent messages that couldn't be recovered), the "Connect to load more" rows and the "Jump to latest" pill | +| `hideOfflineNotices` | `CometChatConversations` | `false` | Notices about the whole cache, such as unsent messages that couldn't be recovered | + +```swift +let messageList = CometChatMessageList() +messageList.hideOfflineNotices = true + +let conversations = CometChatConversations() +conversations.hideOfflineNotices = true +``` + +### Your own empty and error views + +- If you set a custom error view (`errorStateView` on a list, or `set(errorView:)` on the message list), it shows instead of the UI Kit's **Connect to load …** state. +- If you set `hideErrorView = true`, no offline state shows. +- If you set a custom `emptyStateView`, it shows instead of **Connect to search**. `disableEmptyState = true` hides it. + +## With offline support turned off + +Apps that don't turn on offline support keep today's behaviour, with these exceptions in UI Kit 5.3.0: + +- **Higher Chat SDK minimum.** The UI Kit needs Chat SDK 4.2.1 or later, whether or not offline is on. An exact or up-to-next-minor pin on 4.1.x stops package resolution until you update it. +- **New accessibility identifiers.** `accessibilityIdentifier` is now set on message rows and their menu, notices, list footers, the composer, attachment tray tiles, conversation rows, and the empty and error views. This applies to release builds too. They hold no message text and don't change what VoiceOver reads. A conversation row's identifier includes the user's uid or the group's guid. If your UI tests or view snapshots assert on these identifiers, expect them to change. +- **Group Members and Notification Feed refresh on reconnect.** Each reconnect now reloads the first page. A list on screen is never blanked. +- **`MessageListViewModel.add(message:)` replaces a message that is already shown** with the same server id, instead of adding a second row. +- **A failed reaction is rolled back correctly.** The reaction count, your own reaction and its position return to what they were. +- **The failed-send event keeps your metadata.** `ccMessageSent` with `.error` now carries the message's `metaData` with `error: true` added, instead of replacing it. +- **Paging after a jump skips unsent rows.** The older and newer requests use the oldest and newest message that has a server id. + +## Limitations and known issues + +- If a send acknowledgement is lost, the server can end up with one duplicate of the message. +- After a quick reconnect, missed messages can take up to 15 seconds to appear. +- After an app restart, the reason a message failed may be unknown. It's still offered Retry. +- If a send gets no answer while connected, the chat can stop updating until the next reconnect. +- Keyword search, message information, call logs and AI streamed replies need a connection. +- Media downloaded for offline use is stored unencrypted on the device. The message cache itself can be encrypted. See [Encrypt the Cache](/sdk/ios/offline-encryption). +- Depending on the SDK build, a queue-full or file-too-large refusal can first show as pending. The UI Kit shows these messages as failed either way and shows the notice once. + +## Next steps + + + + How the Chat SDK caches and syncs data + + + Every `OfflineConfig` option, listener and error code + + + The SDK's queue, retry and discard + + + Catch-up after reconnect and cache resets + + + Message list properties and styling + + + Override the offline texts + + From 405c8ca21f1eab399defde5dd6d232debf0b5bfa Mon Sep 17 00:00:00 2001 From: rajdubey Date: Thu, 19 Nov 2026 16:46:57 +0530 Subject: [PATCH 02/13] docs(ENG-57593): correct the iOS offline support page against UI Kit 5.3.0 Files picked in the attachment tray upload at once and are not queued; only text, voice notes and single-file sends queue. Failed edits, reactions and deletes now show a notice; the compact composer leaves edit mode on Send. Adds "Not sent yet" under queued messages, Retry and Delete removing a message the SDK no longer holds, the reaction list's tabs, the avatar cache, the logout cache wipe, the media-link and cc_media change, and corrects the notices table, presence, the event wording and the catch-up delay (10 s in the SDK). Co-Authored-By: Claude Opus 5.5 --- ui-kit/ios/core-features.mdx | 2 +- ui-kit/ios/offline-support.mdx | 45 +++++++++++++++++++--------------- 2 files changed, 26 insertions(+), 21 deletions(-) diff --git a/ui-kit/ios/core-features.mdx b/ui-kit/ios/core-features.mdx index 8bd797549..fea661c45 100644 --- a/ui-kit/ios/core-features.mdx +++ b/ui-kit/ios/core-features.mdx @@ -832,7 +832,7 @@ class SearchViewController: UIViewController { *Available since v5.3.0* -Show chats the user has opened before without a connection, and queue messages sent offline until the connection returns. Lists show their saved rows first, unsent messages offer Retry and Delete, and every screen shows a clear "Connect to load …" state when it has nothing saved. Offline support is off by default. +Show chats the user has opened before without a connection, and queue messages sent offline until the connection returns. Files picked in the attachment tray still need a connection to upload. Lists show their saved rows first, unsent messages offer Retry and Delete, and every screen shows a clear "Connect to load …" state when it has nothing saved. Offline support is off by default. ```swift lines import CometChatUIKitSwift diff --git a/ui-kit/ios/offline-support.mdx b/ui-kit/ios/offline-support.mdx index 7737c85e3..ffd4d5c18 100644 --- a/ui-kit/ios/offline-support.mdx +++ b/ui-kit/ios/offline-support.mdx @@ -1,7 +1,7 @@ --- title: "Offline Support" sidebarTitle: "Offline Support" -description: "Turn on offline support in the CometChat iOS UI Kit so saved chats open without a connection, sends queue until reconnect, and every list shows clear offline states." +description: "Turn on offline support in the CometChat iOS UI Kit so saved chats open without a connection, messages queue until reconnect, and every list shows clear offline states." --- @@ -20,7 +20,7 @@ description: "Turn on offline support in the CometChat iOS UI Kit so saved chats -With offline support turned on, the iOS UI Kit reads from the Chat SDK's on-device cache. Chats the user has opened before appear at once, even with no connection. Messages sent while offline wait in a queue and go out when the connection returns. Every list shows a clear state when it has nothing saved and can't reach the server. +With offline support turned on, the iOS UI Kit reads from the Chat SDK's on-device cache. Chats the user has opened before appear at once, even with no connection. Messages sent while offline wait in a queue and go out when the connection returns. Files picked in the attachment tray are the exception: they upload as soon as they're picked, so they need a connection. Every list shows a clear state when it has nothing saved and can't reach the server. The UI Kit builds on the Chat SDK's offline support. This page covers what the UI Kit adds on top. For cache settings, encryption, media caching and sync, see the [iOS SDK offline docs](/sdk/ios/offline-overview). @@ -29,14 +29,16 @@ The UI Kit builds on the Chat SDK's offline support. This page covers what the U **Works offline:** - Conversations, users, groups and group members you have loaded before show at once from the cache. - Saved message history, including threads, opens without a connection. -- New messages, including media, are queued and sent automatically on reconnect. A queued message shows a clock until it is sent. +- New text messages, voice notes and messages sent with the `CometChatUIKit` send methods are queued and sent automatically on reconnect. A queued message shows a clock and **Not sent yet** until it is sent. - Images, video, audio and files that are on the device open from the saved copy. +- Avatars the user has seen are kept on the device (up to 250 MB), so lists and headers show them offline. - After a reconnect, the SDK's catch-up brings in what changed while you were away, including a kick, ban or leave in a group. **Needs a connection:** - The first load of any chat or list that was never opened before. - Keyword search with no saved match. -- Editing or deleting a sent message, and adding or removing a reaction. These aren't queued. They report an error when there is no connection, and a failed reaction is rolled back. +- Uploading a photo, video, audio file or document picked in the attachment tray (`enableMultipleAttachments`, on by default). The message can be sent once its files have uploaded. +- Editing or deleting a sent message, and adding or removing a reaction. These aren't queued. When one fails, the UI Kit shows the notice **No Internet Connection. Please try again later.** (or **Something went wrong, please try again.** for any other error) and the message keeps what it had. A failed reaction is rolled back. - Message information, call logs, calls and AI streamed replies. - Media that has no copy on the device. @@ -143,31 +145,34 @@ A **keyword** search with no saved match while offline shows **Connect to search - Saved history shows at once. Older and newer pages come from the cache first, then from the server. - A chat that was never saved, opened offline, shows **Connect to load messages** and calls `onError`. It loads once by itself when the connection returns. - When the list reaches the end of the saved messages with no connection, it shows a tappable **Connect to load more** row at that edge: older messages at the top, newer ones at the bottom. Tap it to try again. On reconnect each blocked edge loads once by itself, older first. Scrolling loads older messages again once the connection is back. -- Jumping to a message and starting from the first unread anchor on that message first. Paging and live messages don't scroll the list away until it has settled, for at most 6 seconds. If the target isn't saved and the server can't be reached, the chat stays on its newest page. +- Jumping to a message, or starting from the first unread message, shows the list around that message first. Paging and live messages don't scroll the list away until it has settled, for at most 6 seconds. If the target isn't saved and the server can't be reached, the chat stays on its newest page. - When more messages arrive than one refresh can bridge, a **Jump to latest** pill appears. Your reading position stays until you tap it. - Images, video, audio and files show the on-device copy first. With no copy and no connection, the bubble shows a placeholder with the file name, size and **Available when online**. It redraws as the normal bubble when the connection returns. Tapping it while connected asks the SDK to download the file. ### Composer and unsent messages -- A message sent while offline appears at once with a clock. It goes out automatically on reconnect. Media attachments queue the same way. +- A text message or voice note sent while offline appears at once with a clock and **Not sent yet** under the bubble (unless the bubble already has a bottom view). It goes out automatically on reconnect. +- Photos, videos, audio files and documents picked in the attachment tray are **not** queued. Each file starts uploading as soon as it's picked, and uploading needs a connection, so the message can't be sent until its files have uploaded. A tile whose upload failed shows a retry control: tap it to upload that file again once you're back online. With offline support on, the files staged in a chat's tray are kept on the device for that chat, so they come back when the chat is opened again. With `enableMultipleAttachments = false`, a picked file is sent as a single media message, and that message is queued like a text message. - An unsent message (pending, sending or failed) offers only **Retry** and **Delete** in its long-press menu and its VoiceOver actions. It offers no Copy, Reply, React or Edit until it has been sent. -- A failed message shows **Not sent. Tap to retry** under the bubble. Tapping that line or the failed icon retries it. Every failed message can be retried, whatever the reason. +- A failed message shows **Not sent. Tap to retry** under the bubble. Tapping that line or the status icon retries it, and VoiceOver reads the hint "Retry" on both. Every failed message can be retried, whatever the reason. Tapping the clock of a queued message retries it too; a message the SDK is sending at that moment keeps a plain clock. - **Retry** asks the SDK to retry the queued message, so it never creates a duplicate. A message the SDK never queued (for example, refused because the queue was full or the file was too large) is sent again as a new send. - **Delete** removes the unsent message. If it was already sent in the meantime, the sent copy is deleted instead. +- If the SDK no longer holds the unsent message (for example, it was removed after you left the group), Retry and Delete remove it from the list. - If the message is being sent at that moment, Retry and Delete change nothing and the list shows **Sending… try again in a moment** for 4 seconds. - A full queue shows **Too many messages waiting to send**. A file that is too big for the offline media cache shows **File too large to send offline**. Each notice shows once per message. +- **Editing** a message needs a connection. If the edit fails, the message keeps its old text, the composer's `onError` fires, and the UI Kit shows **No Internet Connection. Please try again later.** (or **Something went wrong, please try again.**). `CometChatMessageComposer` keeps the edited text and the edit banner so you can try again. `CometChatCompactMessageComposer` leaves edit mode as soon as you tap Send, so the next message you type is a new message, not another edit. ### Presence -While the SDK isn't connected, nobody shows as online: there's no online dot in any list and no "Online" or last-seen subtitle in the message header. Presence returns when the UI Kit fetches users again after reconnecting. +While the SDK isn't connected (including while it is still connecting), nobody shows as online: there's no online dot in any list and no "Online" or last-seen subtitle in the message header. Presence shows again once the SDK is connected. The users list and the message header also fetch the user again after reconnecting. ### Pinned, Saved, Reactions and Notifications -`CometChatPinnedMessages`, `CometChatSavedMessages`, the reaction list and `CometChatNotificationFeed` follow the same rules as the other lists. Saved rows show first. With nothing saved and no connection, they show **Connect to load messages**, **Connect to load reactions** or **Connect to load notifications**. +`CometChatPinnedMessages`, `CometChatSavedMessages`, the reaction list and `CometChatNotificationFeed` follow the same rules as the other lists. Saved rows show first. With nothing saved and no connection, they show **Connect to load messages**, **Connect to load reactions** or **Connect to load notifications**. The reaction list keeps its tabs visible and shows **Connect to load reactions** below them. ### Logout and user switch -Cached data belongs to the logged-in user. On logout or a user switch, the UI Kit clears every list on screen, search results, the notification feed, the pinned and saved panels and the composer's upload tray before the next user's first frame. Any message still waiting to be sent is answered with `ERROR_OFFLINE_MESSAGE_DISCARDED`. See [Send completions](#send-completions). +Cached data belongs to the logged-in user. The Chat SDK deletes the user's offline cache on logout and when a different user logs in, and the UI Kit deletes the avatars it saved on the device. On logout or a user switch, the UI Kit also clears every list on screen, search results, the notification feed, the pinned and saved panels and the composer's upload tray before the next user's first frame. Any message still waiting to be sent is answered with `ERROR_OFFLINE_MESSAGE_DISCARDED`. See [Send completions](#send-completions). ## Offline states and texts @@ -186,16 +191,16 @@ Override any of these texts by defining the same key in your app's `Localizable. | Connect to search | `CONNECT_TO_SEARCH_MESSAGES` | `CometChatSearch` | | Search needs an internet connection. | `CONNECT_TO_SEARCH_SUBTITLE` | Second line under "Connect to search" | | Connect to load more | `CONNECT_TO_LOAD_MORE` | Message list and threads, at a blocked edge | -| Not sent yet | `MESSAGE_NOT_SENT_YET` | VoiceOver label of a queued message's clock | -| Not sent. Tap to retry | `MESSAGE_NOT_SENT_TAP_TO_RETRY` | Under a failed message | +| Not sent yet | `MESSAGE_NOT_SENT_YET` | Under a queued or sending message, and the VoiceOver label of its clock | +| Not sent. Tap to retry | `MESSAGE_NOT_SENT_TAP_TO_RETRY` | Under a failed message, and the VoiceOver label of its status icon | | Sending… try again in a moment | `SEND_IN_FLIGHT` | Retry or Delete on a message being sent | | Available when online | `MEDIA_AVAILABLE_WHEN_ONLINE` | Media placeholder | | Jump to latest | `JUMP_TO_LATEST` | Message list pill | | Too many messages waiting to send | `OFFLINE_QUEUE_FULL` | Notice when the queue is full | | File too large to send offline | `OFFLINE_FILE_TOO_LARGE` | Notice when media doesn't fit the cache | -| 1 unsent message was removed | `UNSENT_MESSAGE_REMOVED` | Notice | -| 1 message wasn't sent / %d messages weren't sent | `MESSAGES_NOT_SENT_ONE` / `MESSAGES_NOT_SENT_OTHER` | Notice | -| 1 unsent message couldn't be recovered / %d unsent messages couldn't be recovered | `UNSENT_MESSAGES_LOST_ONE` / `UNSENT_MESSAGES_LOST_OTHER` | Notice after the SDK resets its cache | +| 1 unsent message was removed | `UNSENT_MESSAGE_REMOVED` | Notice when the SDK removes a queued message, for example when a full queue drops its oldest message | +| 1 message wasn't sent / %d messages weren't sent | `MESSAGES_NOT_SENT_ONE` / `MESSAGES_NOT_SENT_OTHER` | Message list notice when offline support turns off during a session while unsent messages are shown. They turn failed and can be retried | +| 1 unsent message couldn't be recovered / %d unsent messages couldn't be recovered | `UNSENT_MESSAGES_LOST_ONE` / `UNSENT_MESSAGES_LOST_OTHER` | Message list and conversations notice after the SDK resets its cache | | Some unsent messages may not have been sent | `UNSENT_MESSAGES_MAYBE_LOST` | Notice after a cache reset with an unknown count | ## Errors and callbacks @@ -243,7 +248,7 @@ The UI Kit's own senders (the composers, stickers and smart replies) handle this ### Offline events -`CometChatMessageEventListener` has two events for offline support. Both have empty default bodies, so you implement only the ones you need. Neither fires while offline support is off. +`CometChatMessageEventListener` has two events for offline support. Both have empty default bodies, so you implement only the ones you need. An app that never turns offline support on never receives them. | Event | Fires when | | --- | --- | @@ -290,8 +295,8 @@ For the SDK's own reasons and error codes, see the [Configuration & API Referenc | `retryTextColor` | `UIColor` | `CometChatTheme.errorColor` | "Not sent. Tap to retry" | | `retryTextFont` | `UIFont` | `CometChatTypography.Caption1.medium` | "Not sent. Tap to retry" | | `failedIconTint` | `UIColor?` | `nil` (the receipt style's error tint) | Failed status icon of an unsent message | -| `notSentYetTextColor` | `UIColor` | `CometChatTheme.textColorSecondary` | "Not sent yet", where shown as text | -| `notSentYetTextFont` | `UIFont` | `CometChatTypography.Caption1.regular` | "Not sent yet", where shown as text | +| `notSentYetTextColor` | `UIColor` | `CometChatTheme.textColorSecondary` | "Not sent yet" under a queued or sending message | +| `notSentYetTextFont` | `UIFont` | `CometChatTypography.Caption1.regular` | "Not sent yet" under a queued or sending message | | `mediaPlaceholderTextColor` | `UIColor` | `CometChatTheme.textColorSecondary` | "Available when online" media placeholder | | `mediaPlaceholderTextFont` | `UIFont` | `CometChatTypography.Caption1.regular` | "Available when online" media placeholder | | `footerTextColor` | `UIColor` | `CometChatTheme.textColorSecondary` | "Connect to load more" rows | @@ -346,16 +351,16 @@ Apps that don't turn on offline support keep today's behaviour, with these excep - **A failed reaction is rolled back correctly.** The reaction count, your own reaction and its position return to what they were. - **The failed-send event keeps your metadata.** `ccMessageSent` with `.error` now carries the message's `metaData` with `error: true` added, instead of replacing it. - **Paging after a jump skips unsent rows.** The older and newer requests use the oldest and newest message that has a server id. +- **Media links that name a file on the device are used only for your own messages.** A `file://` link or an absolute path in another user's message is no longer opened, shown or shared. Image and file bubbles now keep their downloads in `Documents/cc_media/`, so files saved earlier in the app's Documents folder are downloaded again. ## Limitations and known issues - If a send acknowledgement is lost, the server can end up with one duplicate of the message. -- After a quick reconnect, missed messages can take up to 15 seconds to appear. +- After a quick reconnect, missed messages can take up to about 10 seconds to appear, because the Chat SDK waits at least 10 seconds between two catch-up syncs. - After an app restart, the reason a message failed may be unknown. It's still offered Retry. - If a send gets no answer while connected, the chat can stop updating until the next reconnect. - Keyword search, message information, call logs and AI streamed replies need a connection. - Media downloaded for offline use is stored unencrypted on the device. The message cache itself can be encrypted. See [Encrypt the Cache](/sdk/ios/offline-encryption). -- Depending on the SDK build, a queue-full or file-too-large refusal can first show as pending. The UI Kit shows these messages as failed either way and shows the notice once. ## Next steps From a258495cb71453783474807e8c35d40fdd4c8d30 Mon Sep 17 00:00:00 2001 From: rajdubey Date: Thu, 19 Nov 2026 16:46:57 +0530 Subject: [PATCH 03/13] docs(ENG-57593): mention offline support across the iOS UI Kit pages Methods documents UIKitSettings.setOfflineConfig(_:) with an example, and what logout and the send methods do with offline on. Integration, events, localize, search, message list, conversations, both composers, the thread header and bubble styling get one line each with a link to the offline page. Search no longer says it has no onError. Co-Authored-By: Claude Opus 5.5 --- ui-kit/ios/compact-message-composer.mdx | 4 +++ ui-kit/ios/conversations.mdx | 12 +++++++ ui-kit/ios/events.mdx | 2 ++ ui-kit/ios/getting-started.mdx | 5 +++ ui-kit/ios/localize.mdx | 2 ++ ui-kit/ios/message-bubble-styling.mdx | 2 ++ ui-kit/ios/message-composer.mdx | 4 +++ ui-kit/ios/message-list.mdx | 18 +++++++++++ ui-kit/ios/methods.mdx | 42 +++++++++++++++++++++++++ ui-kit/ios/search.mdx | 13 ++++++-- ui-kit/ios/threaded-messages-header.mdx | 2 ++ 11 files changed, 104 insertions(+), 2 deletions(-) diff --git a/ui-kit/ios/compact-message-composer.mdx b/ui-kit/ios/compact-message-composer.mdx index 464bcb5d9..d234602f2 100644 --- a/ui-kit/ios/compact-message-composer.mdx +++ b/ui-kit/ios/compact-message-composer.mdx @@ -275,6 +275,10 @@ compactComposer.enableMultipleAttachments = false This is composer-side only: received multi-attachment messages still render with the grouped bubbles (see [Message List](/ui-kit/ios/message-list)). +### Sending while offline + +With [offline support](/ui-kit/ios/offline-support#composer-and-unsent-messages) on, text messages and voice notes sent without a connection are queued and go out when the connection returns. Files staged in the tray still need a connection to upload, so they aren't queued. The tray keeps them for that chat, so they come back when the chat is opened again. With `enableMultipleAttachments = false`, a picked file is sent as a single media message and is queued too. In edit mode, tapping Send leaves edit mode at once. If the edit then fails, the message keeps its old text, `onError` fires and a notice shows, and the next message you type is sent as a new message. + --- ## Rich Text Formatting diff --git a/ui-kit/ios/conversations.mdx b/ui-kit/ios/conversations.mdx index 91baf9b81..45904aec4 100644 --- a/ui-kit/ios/conversations.mdx +++ b/ui-kit/ios/conversations.mdx @@ -42,6 +42,7 @@ The `CometChatConversations` component displays a list of all conversations (one "hideSearch": { "type": "Bool", "default": false }, "hideReceipts": { "type": "Bool", "default": false }, "hideUserStatus": { "type": "Bool", "default": false }, + "hideOfflineNotices": { "type": "Bool", "default": false, "note": "Offline support only (v5.3.0+)" }, "hideGroupType": { "type": "Bool", "default": false }, "hideDeleteConversationOption": { "type": "Bool", "default": false }, "hideNavigationBar": { "type": "Bool", "default": false }, @@ -1135,6 +1136,17 @@ Hides the entire navigation bar. | Type | `Bool` | | Default | `false` | +### hideOfflineNotices + +*Available since v5.3.0* + +Hides the [offline support](/ui-kit/ios/offline-support#hide-offline-notices) notices about the whole cache, such as unsent messages that couldn't be recovered. With offline support on, the list shows saved conversations first, and **Connect to load chats** when nothing is saved and there is no connection. + +| | | +|---|---| +| Type | `Bool` | +| Default | `false` | + ### hideReceipts Hides read/delivered receipt indicators. diff --git a/ui-kit/ios/events.mdx b/ui-kit/ios/events.mdx index f7c01fd7d..d6479376c 100644 --- a/ui-kit/ios/events.mdx +++ b/ui-kit/ios/events.mdx @@ -580,6 +580,8 @@ CometChatMessageEvents.ccMessageSaved(message: savedMessage, status: .success) | `onVoiceCall` | Voice call initiated | | `onVideoCall` | Video call initiated | | `onMessageError` | Message operation failed | +| `ccMessageSendStateChanged` | An own message moved between sending, sent, failed and discarded. Only with [offline support](/ui-kit/ios/offline-support#offline-events) on | +| `ccOfflineCacheReset` | The Chat SDK reset its offline cache. Only with [offline support](/ui-kit/ios/offline-support#offline-events) on | ## Card Events diff --git a/ui-kit/ios/getting-started.mdx b/ui-kit/ios/getting-started.mdx index 5db0e5e1c..de3fbefbf 100644 --- a/ui-kit/ios/getting-started.mdx +++ b/ui-kit/ios/getting-started.mdx @@ -17,6 +17,7 @@ description: "Integrate CometChat iOS UI Kit with project setup, package install | Auth Key | Dev/testing only. Use Auth Token in production | | Calling | Optional. Add `CometChatCallsSDK` 5.0.4 (Up to Next Major Version) to enable | | Dependencies | `CometChatSDK` 4.1.10+ (resolved automatically by the UI Kit package) | +| Offline support | Optional, off by default. `UIKitSettings().setOfflineConfig(_:)` before `build()`. Needs UI Kit 5.3.0+ and `CometChatSDK` 4.2.1+. See [Offline Support](/ui-kit/ios/offline-support) | | AI Skills | `npx @cometchat/skills add` — [GitHub](https://github.com/cometchat/cometchat-skills) | @@ -238,6 +239,10 @@ After running the app, you should see: For production, use [`loginWithAuthToken()`](/ui-kit/ios/methods#login-using-auth-token) instead of Auth Key. Generate tokens server-side via the REST API. + +To let users open saved chats and queue messages without a connection, add `.setOfflineConfig(OfflineConfig(enabled: true))` to `UIKitSettings` before `.build()`. Offline support is off by default and needs UI Kit 5.3.0 or later with Chat SDK 4.2.1 or later. See [Offline Support](/ui-kit/ios/offline-support). + + Having issues? Check the [Troubleshooting Guide](/ui-kit/ios/troubleshooting) for common problems and solutions. diff --git a/ui-kit/ios/localize.mdx b/ui-kit/ios/localize.mdx index 9e6197848..c5687127c 100644 --- a/ui-kit/ios/localize.mdx +++ b/ui-kit/ios/localize.mdx @@ -115,6 +115,8 @@ All localization keys used by the SDK are available in our [GitHub repository](h - Provide custom translations for them in your app - Keep your localization files in sync with SDK updates +The texts that [offline support](/ui-kit/ios/offline-support) shows, such as "Connect to load chats", "Not sent yet" and "Available when online", are listed with their keys in [Offline states and texts](/ui-kit/ios/offline-support#offline-states-and-texts). Override them the same way. + By using the `CometChatLocalize` class, you can provide a user-friendly, localized experience to your users, enhancing the overall user experience within your application. --- diff --git a/ui-kit/ios/message-bubble-styling.mdx b/ui-kit/ios/message-bubble-styling.mdx index aee661bb9..6f2c393d5 100644 --- a/ui-kit/ios/message-bubble-styling.mdx +++ b/ui-kit/ios/message-bubble-styling.mdx @@ -28,6 +28,8 @@ There are two primary classes for styling message bubbles: Both classes provide properties for customizing background color, border, corner radius, and specific styles for individual message types. +With [offline support](/ui-kit/ios/offline-support#message-list-and-threads) on, an image, video, audio or file bubble with no copy on the device and no connection shows a placeholder with the file name, size and "Available when online". Style that text, and the "Not sent yet" and "Not sent. Tap to retry" lines under unsent messages, with [`CometChatMessageList.offlineStyle`](/ui-kit/ios/offline-support#offline-style). + --- ## Properties diff --git a/ui-kit/ios/message-composer.mdx b/ui-kit/ios/message-composer.mdx index ff2b2845a..e1336c87e 100644 --- a/ui-kit/ios/message-composer.mdx +++ b/ui-kit/ios/message-composer.mdx @@ -378,6 +378,10 @@ composer.enableMultipleAttachments = false This is composer-side only: received multi-attachment messages still render with the grouped bubbles (see [Message List](/ui-kit/ios/message-list)). +### Sending while offline + +With [offline support](/ui-kit/ios/offline-support#composer-and-unsent-messages) on, text messages and voice notes sent without a connection are queued and go out when the connection returns. Files staged in the tray still need a connection to upload, so they aren't queued. The tray keeps them for that chat, so they come back when the chat is opened again. With `enableMultipleAttachments = false`, a picked file is sent as a single media message and is queued too. An edit that fails keeps the edited text and the edit banner, calls `onError` and shows a notice. + --- ## Common Patterns diff --git a/ui-kit/ios/message-list.mdx b/ui-kit/ios/message-list.mdx index 45c34fb35..55a265f18 100644 --- a/ui-kit/ios/message-list.mdx +++ b/ui-kit/ios/message-list.mdx @@ -61,6 +61,7 @@ The `CometChatMessageList` component displays a scrollable list of messages in a "hideThreadSubscriptionOption": { "type": "Bool", "default": false }, "hideGroupActionMessages": { "type": "Bool", "default": false }, "hideNewMessageIndicator": { "type": "Bool", "default": false }, + "hideOfflineNotices": { "type": "Bool", "default": false, "note": "Offline support only (v5.3.0+)" }, "hideEmptyView": { "type": "Bool", "default": false }, "hideErrorView": { "type": "Bool", "default": false }, "hideLoadingView": { "type": "Bool", "default": false } @@ -262,6 +263,12 @@ Setting it to `false` renders every media message with the classic single-attach --- +## Offline Support + +With [offline support](/ui-kit/ios/offline-support#message-list-and-threads) on, the list (and a thread's replies) shows saved history at once, then updates it from the server. Own messages that aren't sent yet offer only **Retry** and **Delete**. At the end of the saved messages with no connection, the list shows **Connect to load more**. Use `hideOfflineNotices` to hide the offline notices, and the static `CometChatMessageList.offlineStyle` ([Offline style](/ui-kit/ios/offline-support#offline-style)) to style them. + +--- + ## Actions and Events ### Callback Props @@ -1734,6 +1741,17 @@ Hides the new message indicator. | Type | `Bool` | | Default | `false` | +### hideOfflineNotices + +*Available since v5.3.0* + +Hides the [offline support](/ui-kit/ios/offline-support#hide-offline-notices) notices (a removed unsent message, a full queue, unsent messages that couldn't be recovered), the "Connect to load more" rows and the "Jump to latest" pill. Has no effect while offline support is off. + +| | | +|---|---| +| Type | `Bool` | +| Default | `false` | + ### hidePinMessageOption *Available since v5.1.22* diff --git a/ui-kit/ios/methods.mdx b/ui-kit/ios/methods.mdx index cfc026465..d67ca0203 100644 --- a/ui-kit/ios/methods.mdx +++ b/ui-kit/ios/methods.mdx @@ -15,6 +15,7 @@ sidebar_label: "Methods" - **Logout:** `CometChatUIKit.logout(user:result:)` - **Create user:** `CometChatUIKit.createUser(user:onSuccess:onError:)` - **Send message:** `CometChatUIKit.sendTextMessage(message:onSuccess:onError:)`, `sendMediaMessage`, `sendCustomMessage` +- **Offline support:** `UIKitSettings().setOfflineConfig(_:)` before `build()`. Off by default. See [Offline Support](/ui-kit/ios/offline-support) - **Related:** [Getting Started](/ui-kit/ios/getting-started) · [Events](/ui-kit/ios/events) · [SDK Overview](/sdk/ios/overview) @@ -51,6 +52,7 @@ Replace **APP_ID**, **REGION**, and **AUTH_KEY** with your CometChat App ID, Reg | **setAutoEstablishSocketConnection** | `Boolean` | Configures if web socket connections will established automatically on app initialization or be done manually, set to true by default | | **setAIFeatures** | `List` | Sets the AI Features that need to be added in UI Kit | | **setExtensions** | `List` | Sets the list of extension that need to be added in UI Kit | +| **setOfflineConfig(_:)** | `OfflineConfig` | Turns on offline support by passing the Chat SDK's `OfflineConfig` to the SDK. Off unless the config has `enabled` set to `true`. Needs UI Kit 5.3.0 or later. See [Offline Support](/ui-kit/ios/offline-support) | #### Example @@ -76,6 +78,38 @@ CometChatUIKit.init(uiKitSettings: uikitSettings) { result in +#### Enable offline support + +Offline support is off by default. To turn it on, pass an `OfflineConfig` from the Chat SDK to `setOfflineConfig(_:)` before you call `build()` and `CometChatUIKit.init`. Saved chats then open without a connection, and messages sent offline are queued until the connection returns. + + + +```swift lines +import CometChatUIKitSwift +import CometChatSDK + +let uiKitSettings = UIKitSettings() + .set(appID: "your_appId") + .set(region: "your_region") + .set(authKey: "your_authKey") + .subscribePresenceForAllUsers() + .setOfflineConfig(OfflineConfig(enabled: true)) + .build() + +CometChatUIKit.init(uiKitSettings: uiKitSettings) { result in + switch result { + case .success: + print("Initialization success") + case .failure(let error): + print("CometChat exception: \(error)") + } +} +``` + + + +UI Kit 5.3.0 needs Chat SDK 4.2.1 or later. See [Offline Support](/ui-kit/ios/offline-support) for the requirements, what each component does offline, and the other `OfflineConfig` options. + --- ### Login using Auth Key @@ -145,6 +179,10 @@ CometChatUIKit.logout(user: user) { (result) in + +With [offline support](/ui-kit/ios/offline-support) on, logout also ends the user's offline session. The Chat SDK deletes the user's offline cache, the UI Kit deletes the avatars it saved and clears the screens on display, and messages still waiting to be sent are discarded. A pending `sendFormMessage`, `sendCardMessage` or `sendSchedulerMessage` calls `onError` once with `ERROR_OFFLINE_MESSAGE_DISCARDED`. Logging in as a different user does the same for the previous user. + + --- ### Create User @@ -172,6 +210,10 @@ CometChatUIKit.create(user: user) { result in ### Base Message + +With [offline support](/ui-kit/ios/offline-support) on, the send methods below queue the message when there is no connection. It shows in the message list at once and is sent when the connection returns. + + #### Text Message To send a text message to a single user or a group, use the `sendTextMessage()` function. This function requires a `TextMessage` object containing the necessary information for delivering the message. diff --git a/ui-kit/ios/search.mdx b/ui-kit/ios/search.mdx index abad28b51..73e35ad8e 100644 --- a/ui-kit/ios/search.mdx +++ b/ui-kit/ios/search.mdx @@ -31,7 +31,8 @@ The `CometChatSearch` component is a powerful and customizable search interface "callbacks": { "onConversationClicked": "(Conversation, IndexPath) -> Void (assignable property)", "onMessageClicked": "(BaseMessage) -> Void (assignable property)", - "note": "No onBack / onError / onEmpty. Failures and empty results are VIEWS: set(errorView:), set(emptyView:), plus errorStateTitleText / errorStateSubTitleText." + "onError": "(CometChatException) -> Void (set(onError:); called only with offline support on)", + "note": "No onBack / onEmpty. Failures and empty results are VIEWS: set(errorView:), set(emptyView:), plus errorStateTitleText / errorStateSubTitleText. With offline support on, set(onError:) is also called once for a failed search." }, "visibility": { "hideUserStatus": { "type": "Bool", "default": false }, @@ -169,7 +170,7 @@ import CometChatUIKitSwift let search = CometChatSearch() -// CometChatSearch surfaces failures as an error STATE, not an onError callback. +// With offline support off, CometChatSearch surfaces failures as an error STATE, not an onError callback. // Supply your own view, or retitle the built-in one. search.set(errorView: myErrorView) @@ -179,6 +180,14 @@ search.errorStateSubTitleText = "Check your connection and try again" +With [offline support](/ui-kit/ios/offline-support#search) on, `set(onError:)` is also called, once per search that fails. A keyword search that can't connect and has no saved match shows **Connect to search** instead, without calling `onError`, and runs again once when the connection returns. + +```swift lines +search.set(onError: { error in + print("Search failed: \(error.errorDescription)") +}) +``` + --- #### 5. onEmpty diff --git a/ui-kit/ios/threaded-messages-header.mdx b/ui-kit/ios/threaded-messages-header.mdx index 7f3ab9520..592a88bea 100644 --- a/ui-kit/ios/threaded-messages-header.mdx +++ b/ui-kit/ios/threaded-messages-header.mdx @@ -194,6 +194,8 @@ Below is a list of customizations along with corresponding code snippets: | enableThreadSubscription | Shows the subscribe/unsubscribe bell on the reply-count bar. | `set(enableThreadSubscription: true)` | | hideThreadSubscriptionButton | Hides the bell while leaving the feature on, for a screen that draws its own control. | `set(hideThreadSubscriptionButton: true)` | +With [offline support](/ui-kit/ios/offline-support#message-list-and-threads) on, the reply count includes your own replies that haven't been sent yet, and takes back a reply that is discarded before it is sent. + ### Thread Subscription *Available since v5.1.22* From 525fef74441153276f01e98d205aff7139431909 Mon Sep 17 00:00:00 2001 From: rajdubey Date: Thu, 19 Nov 2026 16:53:34 +0530 Subject: [PATCH 04/13] docs(ENG-57593): stop promising queued media in the iOS offline docs Photos, videos, audio files and documents are to be sent while connected; the pages no longer say a picked file is queued. The methods note now covers sendTextMessage and sendCustomMessage only and links to the send-completions section for form, card and scheduler messages. The threaded-messages guide's offline row now matches the offline page: the composer stays enabled, text replies and voice notes queue, and edits, deletes and reactions need a connection. Co-Authored-By: Claude Opus 5.5 Co-authored-by: multica-agent --- ui-kit/ios/compact-message-composer.mdx | 2 +- ui-kit/ios/core-features.mdx | 4 ++-- ui-kit/ios/getting-started.mdx | 2 +- ui-kit/ios/guide-threaded-messages.mdx | 2 +- ui-kit/ios/message-composer.mdx | 2 +- ui-kit/ios/methods.mdx | 4 ++-- ui-kit/ios/offline-support.mdx | 8 ++++---- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/ui-kit/ios/compact-message-composer.mdx b/ui-kit/ios/compact-message-composer.mdx index d234602f2..55b748c0a 100644 --- a/ui-kit/ios/compact-message-composer.mdx +++ b/ui-kit/ios/compact-message-composer.mdx @@ -277,7 +277,7 @@ This is composer-side only: received multi-attachment messages still render with ### Sending while offline -With [offline support](/ui-kit/ios/offline-support#composer-and-unsent-messages) on, text messages and voice notes sent without a connection are queued and go out when the connection returns. Files staged in the tray still need a connection to upload, so they aren't queued. The tray keeps them for that chat, so they come back when the chat is opened again. With `enableMultipleAttachments = false`, a picked file is sent as a single media message and is queued too. In edit mode, tapping Send leaves edit mode at once. If the edit then fails, the message keeps its old text, `onError` fires and a notice shows, and the next message you type is sent as a new message. +With [offline support](/ui-kit/ios/offline-support#composer-and-unsent-messages) on, text messages and voice notes sent without a connection are queued and go out when the connection returns. Files staged in the tray still need a connection to upload, so they aren't queued. The tray keeps them for that chat, so they come back when the chat is opened again. Send photos, videos, audio files and documents while connected. In edit mode, tapping Send leaves edit mode at once. If the edit then fails, the message keeps its old text, `onError` fires and a notice shows, and the next message you type is sent as a new message. --- diff --git a/ui-kit/ios/core-features.mdx b/ui-kit/ios/core-features.mdx index fea661c45..08b795bb7 100644 --- a/ui-kit/ios/core-features.mdx +++ b/ui-kit/ios/core-features.mdx @@ -19,7 +19,7 @@ description: "Review CometChat iOS UI Kit core features for messaging, media sha {"name": "threadSubscription", "description": "Subscribe to or unsubscribe from a thread's replies", "component": "CometChatMessageList", "enabledByDefault": false}, {"name": "groupChat", "description": "Create and manage group conversations", "component": "CometChatGroups", "enabledByDefault": true}, {"name": "search", "description": "Search across conversations and messages", "component": "CometChatSearch", "enabledByDefault": true}, - {"name": "offlineSupport", "description": "Show saved chats without a connection and queue sends until reconnect; turn on with UIKitSettings.setOfflineConfig(_:)", "component": "CometChatMessageList", "enabledByDefault": false} + {"name": "offlineSupport", "description": "Show saved chats without a connection and queue text messages until reconnect; turn on with UIKitSettings.setOfflineConfig(_:)", "component": "CometChatMessageList", "enabledByDefault": false} ], "relatedComponents": ["CometChatMessageList", "CometChatConversations", "CometChatMessageList", "CometChatMessageComposer"] } @@ -832,7 +832,7 @@ class SearchViewController: UIViewController { *Available since v5.3.0* -Show chats the user has opened before without a connection, and queue messages sent offline until the connection returns. Files picked in the attachment tray still need a connection to upload. Lists show their saved rows first, unsent messages offer Retry and Delete, and every screen shows a clear "Connect to load …" state when it has nothing saved. Offline support is off by default. +Show chats the user has opened before without a connection, and queue text messages sent offline until the connection returns. Send photos, videos and files while connected: the attachment tray needs a connection to upload them. Lists show their saved rows first, unsent messages offer Retry and Delete, and every screen shows a clear "Connect to load …" state when it has nothing saved. Offline support is off by default. ```swift lines import CometChatUIKitSwift diff --git a/ui-kit/ios/getting-started.mdx b/ui-kit/ios/getting-started.mdx index de3fbefbf..639ea07b5 100644 --- a/ui-kit/ios/getting-started.mdx +++ b/ui-kit/ios/getting-started.mdx @@ -240,7 +240,7 @@ For production, use [`loginWithAuthToken()`](/ui-kit/ios/methods#login-using-aut -To let users open saved chats and queue messages without a connection, add `.setOfflineConfig(OfflineConfig(enabled: true))` to `UIKitSettings` before `.build()`. Offline support is off by default and needs UI Kit 5.3.0 or later with Chat SDK 4.2.1 or later. See [Offline Support](/ui-kit/ios/offline-support). +To let users open saved chats and queue text messages without a connection, add `.setOfflineConfig(OfflineConfig(enabled: true))` to `UIKitSettings` before `.build()`. Offline support is off by default and needs UI Kit 5.3.0 or later with Chat SDK 4.2.1 or later. See [Offline Support](/ui-kit/ios/offline-support). diff --git a/ui-kit/ios/guide-threaded-messages.mdx b/ui-kit/ios/guide-threaded-messages.mdx index 15198b5d0..1daf5fbb0 100644 --- a/ui-kit/ios/guide-threaded-messages.mdx +++ b/ui-kit/ios/guide-threaded-messages.mdx @@ -188,7 +188,7 @@ navigationItem.leftBarButtonItem = UIBarButtonItem( |----------|----------| | Parent message deleted | Display a fallback UI or disable the composer | | No replies | Show an empty state (e.g., "No replies yet") | -| Offline mode | Disable the composer and queue thread operations | +| Offline mode | With [offline support](/ui-kit/ios/offline-support) on, the composer stays enabled: text replies and voice notes are queued and sent when the connection returns. Editing, deleting and reacting need a connection. Send photos, videos and files while connected | ## Error Handling diff --git a/ui-kit/ios/message-composer.mdx b/ui-kit/ios/message-composer.mdx index e1336c87e..35c67eaba 100644 --- a/ui-kit/ios/message-composer.mdx +++ b/ui-kit/ios/message-composer.mdx @@ -380,7 +380,7 @@ This is composer-side only: received multi-attachment messages still render with ### Sending while offline -With [offline support](/ui-kit/ios/offline-support#composer-and-unsent-messages) on, text messages and voice notes sent without a connection are queued and go out when the connection returns. Files staged in the tray still need a connection to upload, so they aren't queued. The tray keeps them for that chat, so they come back when the chat is opened again. With `enableMultipleAttachments = false`, a picked file is sent as a single media message and is queued too. An edit that fails keeps the edited text and the edit banner, calls `onError` and shows a notice. +With [offline support](/ui-kit/ios/offline-support#composer-and-unsent-messages) on, text messages and voice notes sent without a connection are queued and go out when the connection returns. Files staged in the tray still need a connection to upload, so they aren't queued. The tray keeps them for that chat, so they come back when the chat is opened again. Send photos, videos, audio files and documents while connected. An edit that fails keeps the edited text and the edit banner, calls `onError` and shows a notice. --- diff --git a/ui-kit/ios/methods.mdx b/ui-kit/ios/methods.mdx index d67ca0203..254bbe3c0 100644 --- a/ui-kit/ios/methods.mdx +++ b/ui-kit/ios/methods.mdx @@ -80,7 +80,7 @@ CometChatUIKit.init(uiKitSettings: uikitSettings) { result in #### Enable offline support -Offline support is off by default. To turn it on, pass an `OfflineConfig` from the Chat SDK to `setOfflineConfig(_:)` before you call `build()` and `CometChatUIKit.init`. Saved chats then open without a connection, and messages sent offline are queued until the connection returns. +Offline support is off by default. To turn it on, pass an `OfflineConfig` from the Chat SDK to `setOfflineConfig(_:)` before you call `build()` and `CometChatUIKit.init`. Saved chats then open without a connection, and text messages sent offline are queued until the connection returns. @@ -211,7 +211,7 @@ CometChatUIKit.create(user: user) { result in ### Base Message -With [offline support](/ui-kit/ios/offline-support) on, the send methods below queue the message when there is no connection. It shows in the message list at once and is sent when the connection returns. +With [offline support](/ui-kit/ios/offline-support) on, `sendTextMessage` and `sendCustomMessage` queue the message when there is no connection. It shows in the message list at once and is sent when the connection returns. Send media messages while connected. For what form, card and scheduler messages report when a waiting send is discarded, see [Send completions](/ui-kit/ios/offline-support#send-completions). #### Text Message diff --git a/ui-kit/ios/offline-support.mdx b/ui-kit/ios/offline-support.mdx index ffd4d5c18..2f67d79e6 100644 --- a/ui-kit/ios/offline-support.mdx +++ b/ui-kit/ios/offline-support.mdx @@ -1,7 +1,7 @@ --- title: "Offline Support" sidebarTitle: "Offline Support" -description: "Turn on offline support in the CometChat iOS UI Kit so saved chats open without a connection, messages queue until reconnect, and every list shows clear offline states." +description: "Turn on offline support in the CometChat iOS UI Kit so saved chats open without a connection, text messages queue until reconnect, and every list shows clear offline states." --- @@ -20,7 +20,7 @@ description: "Turn on offline support in the CometChat iOS UI Kit so saved chats -With offline support turned on, the iOS UI Kit reads from the Chat SDK's on-device cache. Chats the user has opened before appear at once, even with no connection. Messages sent while offline wait in a queue and go out when the connection returns. Files picked in the attachment tray are the exception: they upload as soon as they're picked, so they need a connection. Every list shows a clear state when it has nothing saved and can't reach the server. +With offline support turned on, the iOS UI Kit reads from the Chat SDK's on-device cache. Chats the user has opened before appear at once, even with no connection. Text messages sent while offline wait in a queue and go out when the connection returns. Send photos, videos, audio files and documents while connected: the attachment tray uploads each file as soon as it's picked, which needs a connection. Every list shows a clear state when it has nothing saved and can't reach the server. The UI Kit builds on the Chat SDK's offline support. This page covers what the UI Kit adds on top. For cache settings, encryption, media caching and sync, see the [iOS SDK offline docs](/sdk/ios/offline-overview). @@ -29,7 +29,7 @@ The UI Kit builds on the Chat SDK's offline support. This page covers what the U **Works offline:** - Conversations, users, groups and group members you have loaded before show at once from the cache. - Saved message history, including threads, opens without a connection. -- New text messages, voice notes and messages sent with the `CometChatUIKit` send methods are queued and sent automatically on reconnect. A queued message shows a clock and **Not sent yet** until it is sent. +- New text messages and voice notes, and text and custom messages sent with the `CometChatUIKit` send methods, are queued and sent automatically on reconnect. A queued message shows a clock and **Not sent yet** until it is sent. - Images, video, audio and files that are on the device open from the saved copy. - Avatars the user has seen are kept on the device (up to 250 MB), so lists and headers show them offline. - After a reconnect, the SDK's catch-up brings in what changed while you were away, including a kick, ban or leave in a group. @@ -152,7 +152,7 @@ A **keyword** search with no saved match while offline shows **Connect to search ### Composer and unsent messages - A text message or voice note sent while offline appears at once with a clock and **Not sent yet** under the bubble (unless the bubble already has a bottom view). It goes out automatically on reconnect. -- Photos, videos, audio files and documents picked in the attachment tray are **not** queued. Each file starts uploading as soon as it's picked, and uploading needs a connection, so the message can't be sent until its files have uploaded. A tile whose upload failed shows a retry control: tap it to upload that file again once you're back online. With offline support on, the files staged in a chat's tray are kept on the device for that chat, so they come back when the chat is opened again. With `enableMultipleAttachments = false`, a picked file is sent as a single media message, and that message is queued like a text message. +- Photos, videos, audio files and documents picked in the attachment tray are **not** queued. Each file starts uploading as soon as it's picked, and uploading needs a connection, so the message can't be sent until its files have uploaded. A tile whose upload failed shows a retry control: tap it to upload that file again once you're back online. With offline support on, the files staged in a chat's tray are kept on the device for that chat, so they come back when the chat is opened again. Send photos, videos, audio files and documents while connected. - An unsent message (pending, sending or failed) offers only **Retry** and **Delete** in its long-press menu and its VoiceOver actions. It offers no Copy, Reply, React or Edit until it has been sent. - A failed message shows **Not sent. Tap to retry** under the bubble. Tapping that line or the status icon retries it, and VoiceOver reads the hint "Retry" on both. Every failed message can be retried, whatever the reason. Tapping the clock of a queued message retries it too; a message the SDK is sending at that moment keeps a plain clock. - **Retry** asks the SDK to retry the queued message, so it never creates a duplicate. A message the SDK never queued (for example, refused because the queue was full or the file was too large) is sent again as a new send. From 3c7a6be782c5909729f104fdd42d693bc81970bf Mon Sep 17 00:00:00 2001 From: rajdubey Date: Thu, 19 Nov 2026 16:59:02 +0530 Subject: [PATCH 05/13] docs(ENG-57593): scope the Chat SDK minimum to UI Kit 5.3.0 and name every queuing send method The offline page, methods, core features and integration now say that UI Kit 5.3.0, the first version with offline support, needs Chat SDK 4.2.1 or later, so they no longer disagree with the 5.2.x numbers on the other pages. The integration quick reference marks its offline row as applying from 5.3.0. The offline page and methods now list sendFormMessage, sendCardMessage and sendSchedulerMessage beside sendTextMessage and sendCustomMessage as sends that queue offline. Co-Authored-By: Claude Opus 5.5 Co-authored-by: multica-agent --- ui-kit/ios/core-features.mdx | 2 +- ui-kit/ios/getting-started.mdx | 4 ++-- ui-kit/ios/methods.mdx | 4 ++-- ui-kit/ios/offline-support.mdx | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ui-kit/ios/core-features.mdx b/ui-kit/ios/core-features.mdx index 08b795bb7..7de7aaafb 100644 --- a/ui-kit/ios/core-features.mdx +++ b/ui-kit/ios/core-features.mdx @@ -850,7 +850,7 @@ CometChatUIKit.init(uiKitSettings: uikitSettings) { result in } ``` -Offline support needs Chat SDK 4.2.1 or later. See [Offline Support](/ui-kit/ios/offline-support) for requirements, component behaviour, texts, styling and events. +UI Kit 5.3.0, the first version with offline support, needs Chat SDK 4.2.1 or later. See [Offline Support](/ui-kit/ios/offline-support) for requirements, component behaviour, texts, styling and events. ## Moderation diff --git a/ui-kit/ios/getting-started.mdx b/ui-kit/ios/getting-started.mdx index 639ea07b5..6bc44a033 100644 --- a/ui-kit/ios/getting-started.mdx +++ b/ui-kit/ios/getting-started.mdx @@ -17,7 +17,7 @@ description: "Integrate CometChat iOS UI Kit with project setup, package install | Auth Key | Dev/testing only. Use Auth Token in production | | Calling | Optional. Add `CometChatCallsSDK` 5.0.4 (Up to Next Major Version) to enable | | Dependencies | `CometChatSDK` 4.1.10+ (resolved automatically by the UI Kit package) | -| Offline support | Optional, off by default. `UIKitSettings().setOfflineConfig(_:)` before `build()`. Needs UI Kit 5.3.0+ and `CometChatSDK` 4.2.1+. See [Offline Support](/ui-kit/ios/offline-support) | +| Offline support | Optional, off by default, from UI Kit 5.3.0. UI Kit 5.3.0 and later need `CometChatSDK` 4.2.1+ (the Dependencies row above is for the 5.2.x releases). `UIKitSettings().setOfflineConfig(_:)` before `build()`. See [Offline Support](/ui-kit/ios/offline-support) | | AI Skills | `npx @cometchat/skills add` — [GitHub](https://github.com/cometchat/cometchat-skills) | @@ -240,7 +240,7 @@ For production, use [`loginWithAuthToken()`](/ui-kit/ios/methods#login-using-aut -To let users open saved chats and queue text messages without a connection, add `.setOfflineConfig(OfflineConfig(enabled: true))` to `UIKitSettings` before `.build()`. Offline support is off by default and needs UI Kit 5.3.0 or later with Chat SDK 4.2.1 or later. See [Offline Support](/ui-kit/ios/offline-support). +To let users open saved chats and queue text messages without a connection, add `.setOfflineConfig(OfflineConfig(enabled: true))` to `UIKitSettings` before `.build()`. Offline support is off by default and is available from UI Kit 5.3.0. UI Kit 5.3.0, the first version with offline support, needs Chat SDK 4.2.1 or later. See [Offline Support](/ui-kit/ios/offline-support). diff --git a/ui-kit/ios/methods.mdx b/ui-kit/ios/methods.mdx index 254bbe3c0..7a1b740d5 100644 --- a/ui-kit/ios/methods.mdx +++ b/ui-kit/ios/methods.mdx @@ -108,7 +108,7 @@ CometChatUIKit.init(uiKitSettings: uiKitSettings) { result in -UI Kit 5.3.0 needs Chat SDK 4.2.1 or later. See [Offline Support](/ui-kit/ios/offline-support) for the requirements, what each component does offline, and the other `OfflineConfig` options. +UI Kit 5.3.0, the first version with offline support, needs Chat SDK 4.2.1 or later. See [Offline Support](/ui-kit/ios/offline-support) for the requirements, what each component does offline, and the other `OfflineConfig` options. --- @@ -211,7 +211,7 @@ CometChatUIKit.create(user: user) { result in ### Base Message -With [offline support](/ui-kit/ios/offline-support) on, `sendTextMessage` and `sendCustomMessage` queue the message when there is no connection. It shows in the message list at once and is sent when the connection returns. Send media messages while connected. For what form, card and scheduler messages report when a waiting send is discarded, see [Send completions](/ui-kit/ios/offline-support#send-completions). +With [offline support](/ui-kit/ios/offline-support) on, `sendTextMessage`, `sendCustomMessage`, `sendFormMessage`, `sendCardMessage` and `sendSchedulerMessage` queue the message when there is no connection. It shows in the message list at once and is sent when the connection returns. Send media messages while connected. For what the form, card and scheduler completions report while a message is queued or discarded, see [Send completions](/ui-kit/ios/offline-support#send-completions). #### Text Message diff --git a/ui-kit/ios/offline-support.mdx b/ui-kit/ios/offline-support.mdx index 2f67d79e6..da04d2984 100644 --- a/ui-kit/ios/offline-support.mdx +++ b/ui-kit/ios/offline-support.mdx @@ -29,7 +29,7 @@ The UI Kit builds on the Chat SDK's offline support. This page covers what the U **Works offline:** - Conversations, users, groups and group members you have loaded before show at once from the cache. - Saved message history, including threads, opens without a connection. -- New text messages and voice notes, and text and custom messages sent with the `CometChatUIKit` send methods, are queued and sent automatically on reconnect. A queued message shows a clock and **Not sent yet** until it is sent. +- New text messages and voice notes are queued and sent automatically on reconnect. So are messages sent with `CometChatUIKit.sendTextMessage`, `sendCustomMessage`, `sendFormMessage`, `sendCardMessage` and `sendSchedulerMessage`. A queued message shows a clock and **Not sent yet** until it is sent. - Images, video, audio and files that are on the device open from the saved copy. - Avatars the user has seen are kept on the device (up to 250 MB), so lists and headers show them offline. - After a reconnect, the SDK's catch-up brings in what changed while you were away, including a kick, ban or leave in a group. @@ -51,7 +51,7 @@ The UI Kit builds on the Chat SDK's offline support. This page covers what the U | iOS | 15.1 or later | | Xcode | 16 or later | -The UI Kit links the Chat SDK directly, so the higher SDK minimum applies to every app on UI Kit 5.3.0, whether or not it turns offline on. The UI Kit calls `CometChat.initFromSettings(offlineConfig:onSuccess:onError:)`, which Chat SDK 4.2.0 doesn't have. UI Kit 5.3.0 therefore needs a later Chat SDK, even though the [SDK offline pages](/sdk/ios/offline-enable) list 4.2.0 for using the SDK on its own. +UI Kit 5.3.0, the first version with offline support, needs Chat SDK 4.2.1 or later. The UI Kit links the Chat SDK directly, so this applies to every app on UI Kit 5.3.0 or later, whether or not it turns offline on: the UI Kit calls `CometChat.initFromSettings(offlineConfig:onSuccess:onError:)`, which Chat SDK 4.2.0 doesn't have. (Using the Chat SDK's offline support on its own, without the UI Kit, needs 4.2.0; see [Enable Offline Support](/sdk/ios/offline-enable).) Install or update the UI Kit with Swift Package Manager: From 140b048f0863c3ae3a6435cbdad24ae760212e48 Mon Sep 17 00:00:00 2001 From: rajdubey Date: Fri, 20 Nov 2026 15:16:49 +0530 Subject: [PATCH 06/13] docs(ENG-57593): scope "media is not queued" to the attachment tray Checked against the iOS UI Kit at temp-release-offline-v5 d4d643870: - Only files picked in the attachment tray (enableMultipleAttachments, the default) need a connection. With enableMultipleAttachments = false a pick is sent through sendSingleMedia -> MessageComposerBuilder .mediaMessage -> OfflineSend.send and is queued like a voice note (MessageComposerBuilder.swift:50-53; same in the compact composer). - CometChatUIKit.sendMediaMessage also queues offline (CometChatUIKit .swift:579), so methods.mdx lists it and drops "send media while connected". - initFromSettings(offlineConfig:...) is used by the kit's own initFromSettings, not by every init: reworded. - "Saved rows show first" read as the Saved Messages component's rows: now "Rows cached on the device show first". Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01XbguTt1cqFxTDQyroF6wHx --- ui-kit/ios/compact-message-composer.mdx | 2 +- ui-kit/ios/core-features.mdx | 2 +- ui-kit/ios/guide-threaded-messages.mdx | 2 +- ui-kit/ios/message-composer.mdx | 2 +- ui-kit/ios/methods.mdx | 2 +- ui-kit/ios/offline-support.mdx | 8 ++++---- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/ui-kit/ios/compact-message-composer.mdx b/ui-kit/ios/compact-message-composer.mdx index 55b748c0a..e3fb69e0b 100644 --- a/ui-kit/ios/compact-message-composer.mdx +++ b/ui-kit/ios/compact-message-composer.mdx @@ -277,7 +277,7 @@ This is composer-side only: received multi-attachment messages still render with ### Sending while offline -With [offline support](/ui-kit/ios/offline-support#composer-and-unsent-messages) on, text messages and voice notes sent without a connection are queued and go out when the connection returns. Files staged in the tray still need a connection to upload, so they aren't queued. The tray keeps them for that chat, so they come back when the chat is opened again. Send photos, videos, audio files and documents while connected. In edit mode, tapping Send leaves edit mode at once. If the edit then fails, the message keeps its old text, `onError` fires and a notice shows, and the next message you type is sent as a new message. +With [offline support](/ui-kit/ios/offline-support#composer-and-unsent-messages) on, text messages and voice notes sent without a connection are queued and go out when the connection returns. Files staged in the tray still need a connection to upload, so they aren't queued. The tray keeps them for that chat, so they come back when the chat is opened again. Send files from the tray while connected. With `enableMultipleAttachments = false`, a picked photo, video, audio file or document is sent as a single media message instead, and is queued like a voice note. In edit mode, tapping Send leaves edit mode at once. If the edit then fails, the message keeps its old text, `onError` fires and a notice shows, and the next message you type is sent as a new message. --- diff --git a/ui-kit/ios/core-features.mdx b/ui-kit/ios/core-features.mdx index 7de7aaafb..4ce367bbb 100644 --- a/ui-kit/ios/core-features.mdx +++ b/ui-kit/ios/core-features.mdx @@ -832,7 +832,7 @@ class SearchViewController: UIViewController { *Available since v5.3.0* -Show chats the user has opened before without a connection, and queue text messages sent offline until the connection returns. Send photos, videos and files while connected: the attachment tray needs a connection to upload them. Lists show their saved rows first, unsent messages offer Retry and Delete, and every screen shows a clear "Connect to load …" state when it has nothing saved. Offline support is off by default. +Show chats the user has opened before without a connection, and queue text messages sent offline until the connection returns. Photos, videos and files picked in the attachment tray need a connection to upload. Lists show their saved rows first, unsent messages offer Retry and Delete, and every screen shows a clear "Connect to load …" state when it has nothing saved. Offline support is off by default. ```swift lines import CometChatUIKitSwift diff --git a/ui-kit/ios/guide-threaded-messages.mdx b/ui-kit/ios/guide-threaded-messages.mdx index 1daf5fbb0..0aa476a45 100644 --- a/ui-kit/ios/guide-threaded-messages.mdx +++ b/ui-kit/ios/guide-threaded-messages.mdx @@ -188,7 +188,7 @@ navigationItem.leftBarButtonItem = UIBarButtonItem( |----------|----------| | Parent message deleted | Display a fallback UI or disable the composer | | No replies | Show an empty state (e.g., "No replies yet") | -| Offline mode | With [offline support](/ui-kit/ios/offline-support) on, the composer stays enabled: text replies and voice notes are queued and sent when the connection returns. Editing, deleting and reacting need a connection. Send photos, videos and files while connected | +| Offline mode | With [offline support](/ui-kit/ios/offline-support) on, the composer stays enabled: text replies and voice notes are queued and sent when the connection returns. Editing, deleting and reacting need a connection. Photos, videos and files picked in the attachment tray need a connection to upload | ## Error Handling diff --git a/ui-kit/ios/message-composer.mdx b/ui-kit/ios/message-composer.mdx index 35c67eaba..0dead27eb 100644 --- a/ui-kit/ios/message-composer.mdx +++ b/ui-kit/ios/message-composer.mdx @@ -380,7 +380,7 @@ This is composer-side only: received multi-attachment messages still render with ### Sending while offline -With [offline support](/ui-kit/ios/offline-support#composer-and-unsent-messages) on, text messages and voice notes sent without a connection are queued and go out when the connection returns. Files staged in the tray still need a connection to upload, so they aren't queued. The tray keeps them for that chat, so they come back when the chat is opened again. Send photos, videos, audio files and documents while connected. An edit that fails keeps the edited text and the edit banner, calls `onError` and shows a notice. +With [offline support](/ui-kit/ios/offline-support#composer-and-unsent-messages) on, text messages and voice notes sent without a connection are queued and go out when the connection returns. Files staged in the tray still need a connection to upload, so they aren't queued. The tray keeps them for that chat, so they come back when the chat is opened again. Send files from the tray while connected. With `enableMultipleAttachments = false`, a picked photo, video, audio file or document is sent as a single media message instead, and is queued like a voice note. An edit that fails keeps the edited text and the edit banner, calls `onError` and shows a notice. --- diff --git a/ui-kit/ios/methods.mdx b/ui-kit/ios/methods.mdx index 7a1b740d5..870829b3e 100644 --- a/ui-kit/ios/methods.mdx +++ b/ui-kit/ios/methods.mdx @@ -211,7 +211,7 @@ CometChatUIKit.create(user: user) { result in ### Base Message -With [offline support](/ui-kit/ios/offline-support) on, `sendTextMessage`, `sendCustomMessage`, `sendFormMessage`, `sendCardMessage` and `sendSchedulerMessage` queue the message when there is no connection. It shows in the message list at once and is sent when the connection returns. Send media messages while connected. For what the form, card and scheduler completions report while a message is queued or discarded, see [Send completions](/ui-kit/ios/offline-support#send-completions). +With [offline support](/ui-kit/ios/offline-support) on, `sendTextMessage`, `sendMediaMessage`, `sendCustomMessage`, `sendFormMessage`, `sendCardMessage` and `sendSchedulerMessage` queue the message when there is no connection. It shows in the message list at once and is sent when the connection returns. A media message's files are copied to the device when it is queued. For what the form, card and scheduler completions report while a message is queued or discarded, see [Send completions](/ui-kit/ios/offline-support#send-completions). #### Text Message diff --git a/ui-kit/ios/offline-support.mdx b/ui-kit/ios/offline-support.mdx index da04d2984..e32de5cbc 100644 --- a/ui-kit/ios/offline-support.mdx +++ b/ui-kit/ios/offline-support.mdx @@ -20,7 +20,7 @@ description: "Turn on offline support in the CometChat iOS UI Kit so saved chats -With offline support turned on, the iOS UI Kit reads from the Chat SDK's on-device cache. Chats the user has opened before appear at once, even with no connection. Text messages sent while offline wait in a queue and go out when the connection returns. Send photos, videos, audio files and documents while connected: the attachment tray uploads each file as soon as it's picked, which needs a connection. Every list shows a clear state when it has nothing saved and can't reach the server. +With offline support turned on, the iOS UI Kit reads from the Chat SDK's on-device cache. Chats the user has opened before appear at once, even with no connection. Text messages and voice notes sent while offline wait in a queue and go out when the connection returns. Photos, videos, audio files and documents picked in the attachment tray (the default) need a connection: the tray uploads each file as soon as it's picked. Every list shows a clear state when it has nothing saved and can't reach the server. The UI Kit builds on the Chat SDK's offline support. This page covers what the UI Kit adds on top. For cache settings, encryption, media caching and sync, see the [iOS SDK offline docs](/sdk/ios/offline-overview). @@ -51,7 +51,7 @@ The UI Kit builds on the Chat SDK's offline support. This page covers what the U | iOS | 15.1 or later | | Xcode | 16 or later | -UI Kit 5.3.0, the first version with offline support, needs Chat SDK 4.2.1 or later. The UI Kit links the Chat SDK directly, so this applies to every app on UI Kit 5.3.0 or later, whether or not it turns offline on: the UI Kit calls `CometChat.initFromSettings(offlineConfig:onSuccess:onError:)`, which Chat SDK 4.2.0 doesn't have. (Using the Chat SDK's offline support on its own, without the UI Kit, needs 4.2.0; see [Enable Offline Support](/sdk/ios/offline-enable).) +UI Kit 5.3.0, the first version with offline support, needs Chat SDK 4.2.1 or later. The UI Kit links the Chat SDK directly, so this applies to every app on UI Kit 5.3.0 or later, whether or not it turns offline on: the UI Kit is built against `CometChat.initFromSettings(offlineConfig:onSuccess:onError:)` (its own `initFromSettings` uses it), which Chat SDK 4.2.0 doesn't have. (Using the Chat SDK's offline support on its own, without the UI Kit, needs 4.2.0; see [Enable Offline Support](/sdk/ios/offline-enable).) Install or update the UI Kit with Swift Package Manager: @@ -152,7 +152,7 @@ A **keyword** search with no saved match while offline shows **Connect to search ### Composer and unsent messages - A text message or voice note sent while offline appears at once with a clock and **Not sent yet** under the bubble (unless the bubble already has a bottom view). It goes out automatically on reconnect. -- Photos, videos, audio files and documents picked in the attachment tray are **not** queued. Each file starts uploading as soon as it's picked, and uploading needs a connection, so the message can't be sent until its files have uploaded. A tile whose upload failed shows a retry control: tap it to upload that file again once you're back online. With offline support on, the files staged in a chat's tray are kept on the device for that chat, so they come back when the chat is opened again. Send photos, videos, audio files and documents while connected. +- Photos, videos, audio files and documents picked in the attachment tray are **not** queued. Each file starts uploading as soon as it's picked, and uploading needs a connection, so the message can't be sent until its files have uploaded. A tile whose upload failed shows a retry control: tap it to upload that file again once you're back online. With offline support on, the files staged in a chat's tray are kept on the device for that chat, so they come back when the chat is opened again. Send files from the tray while connected. With `enableMultipleAttachments = false`, a picked photo, video, audio file or document is sent as a single media message instead, and is queued like a voice note. - An unsent message (pending, sending or failed) offers only **Retry** and **Delete** in its long-press menu and its VoiceOver actions. It offers no Copy, Reply, React or Edit until it has been sent. - A failed message shows **Not sent. Tap to retry** under the bubble. Tapping that line or the status icon retries it, and VoiceOver reads the hint "Retry" on both. Every failed message can be retried, whatever the reason. Tapping the clock of a queued message retries it too; a message the SDK is sending at that moment keeps a plain clock. - **Retry** asks the SDK to retry the queued message, so it never creates a duplicate. A message the SDK never queued (for example, refused because the queue was full or the file was too large) is sent again as a new send. @@ -168,7 +168,7 @@ While the SDK isn't connected (including while it is still connecting), nobody s ### Pinned, Saved, Reactions and Notifications -`CometChatPinnedMessages`, `CometChatSavedMessages`, the reaction list and `CometChatNotificationFeed` follow the same rules as the other lists. Saved rows show first. With nothing saved and no connection, they show **Connect to load messages**, **Connect to load reactions** or **Connect to load notifications**. The reaction list keeps its tabs visible and shows **Connect to load reactions** below them. +`CometChatPinnedMessages`, `CometChatSavedMessages`, the reaction list and `CometChatNotificationFeed` follow the same rules as the other lists. Rows cached on the device show first. With nothing saved and no connection, they show **Connect to load messages**, **Connect to load reactions** or **Connect to load notifications**. The reaction list keeps its tabs visible and shows **Connect to load reactions** below them. ### Logout and user switch From fb171e1959d54165d6034f57ccf222bfe57b063a Mon Sep 17 00:00:00 2001 From: rajdubey Date: Mon, 23 Nov 2026 17:26:27 +0530 Subject: [PATCH 07/13] docs(ENG-57593): bump iOS UI Kit to 5.3.0 and iOS Chat SDK to 4.2.1 The offline release ships the iOS UI Kit as a minor bump from the live 5.2.3 (-> 5.3.0) and the iOS Chat SDK as a patch from the live 4.2.0 (-> 4.2.1), so the docs that name those versions move with them. sdk/ios: every offline minimum-version statement moves 4.2.0 -> 4.2.1 across the offline pages and the 18 feature pages that carry an offline note. offline-sync and offline-media-caching had no minimum-version line at all; both now carry one. The install instructions were far older than offline and are brought to 4.2.1: setup.mdx (Podfile, the AI quick reference and the SPM dependency rule) and upgrading-from-v3-to-v4.mdx were pinned at 4.1.0, and the two push-notification extension pages at 4.0.67. The CometChatCallsSDK pins are untouched. ui-kit/ios: the UI Kit version moves 5.2.3 -> 5.3.0 in every current install instruction, and the CometChatSDK floor it resolves moves 4.1.10 -> 4.2.1, which is what Package.swift declares on the release branch (`from: "4.2.1"`). The getting-started offline row no longer needs its "the Dependencies row above is for the 5.2.x releases" caveat, since that row now reads 4.2.1. campaigns.mdx said the CometChatSDK pod stops at 4.1.9; CocoaPods trunk actually has 4.1.10, so that is corrected too. Historical "available since" notes and the "CocoaPods stops at 5.1.18" statements are untouched. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01D7Ygtnje2DAqQ4FmgWhYnt --- sdk/ios/additional-message-filtering.mdx | 2 +- sdk/ios/ai-moderation.mdx | 2 +- sdk/ios/all-real-time-delegates-listeners.mdx | 2 +- sdk/ios/block-users.mdx | 2 +- sdk/ios/campaigns.mdx | 2 +- sdk/ios/connection-status.mdx | 2 +- sdk/ios/group-kick-member.mdx | 2 +- sdk/ios/marking-delivered-with-push-notification.mdx | 4 ++-- sdk/ios/mentions.mdx | 2 +- sdk/ios/offline-cached-data.mdx | 2 +- sdk/ios/offline-enable.mdx | 6 +++--- sdk/ios/offline-encryption.mdx | 2 +- sdk/ios/offline-media-caching.mdx | 2 +- sdk/ios/offline-overview.mdx | 4 ++-- sdk/ios/offline-reference.mdx | 2 +- sdk/ios/offline-send.mdx | 2 +- sdk/ios/offline-sync.mdx | 2 +- sdk/ios/reactions.mdx | 2 +- sdk/ios/receive-message.mdx | 2 +- sdk/ios/remove-delivered-notifications.mdx | 4 ++-- sdk/ios/retrieve-conversations.mdx | 2 +- sdk/ios/retrieve-group-members.mdx | 2 +- sdk/ios/retrieve-groups.mdx | 2 +- sdk/ios/retrieve-users.mdx | 2 +- sdk/ios/send-message.mdx | 2 +- sdk/ios/setup.mdx | 6 +++--- sdk/ios/thread-subscription.mdx | 2 +- sdk/ios/threaded-messages.mdx | 2 +- sdk/ios/upgrading-from-v3-to-v4.mdx | 2 +- sdk/ios/upload-files.mdx | 2 +- ui-kit/ios/ai-assistant-chat-history.mdx | 2 +- ui-kit/ios/call-features.mdx | 2 +- ui-kit/ios/calling-integration.mdx | 2 +- ui-kit/ios/campaigns.mdx | 4 ++-- ui-kit/ios/components-overview.mdx | 2 +- ui-kit/ios/getting-started.mdx | 10 +++++----- ui-kit/ios/llms-ios-v5.mdx | 8 ++++---- ui-kit/ios/overview.mdx | 8 ++++---- ui-kit/ios/troubleshooting.mdx | 4 ++-- 39 files changed, 58 insertions(+), 58 deletions(-) diff --git a/sdk/ios/additional-message-filtering.mdx b/sdk/ios/additional-message-filtering.mdx index 3ffb23aaf..3a7a1417e 100644 --- a/sdk/ios/additional-message-filtering.mdx +++ b/sdk/ios/additional-message-filtering.mdx @@ -161,7 +161,7 @@ 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. +With offline support enabled (SDK 4.2.1 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 | |---|---| diff --git a/sdk/ios/ai-moderation.mdx b/sdk/ios/ai-moderation.mdx index e1d3f18b8..56e3dda07 100644 --- a/sdk/ios/ai-moderation.mdx +++ b/sdk/ios/ai-moderation.mdx @@ -223,7 +223,7 @@ Always remove listeners when they're no longer needed (e.g., on component unmoun ## 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). +With offline support enabled (SDK 4.2.1 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 diff --git a/sdk/ios/all-real-time-delegates-listeners.mdx b/sdk/ios/all-real-time-delegates-listeners.mdx index 033d8959c..477be309b 100644 --- a/sdk/ios/all-real-time-delegates-listeners.mdx +++ b/sdk/ios/all-real-time-delegates-listeners.mdx @@ -575,7 +575,7 @@ CometChat.removeAIAssistantListener("unique_listener_id") ## 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`. +With offline support enabled (SDK 4.2.1 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. diff --git a/sdk/ios/block-users.mdx b/sdk/ios/block-users.mdx index 7799ba08c..397c4f05b 100644 --- a/sdk/ios/block-users.mdx +++ b/sdk/ios/block-users.mdx @@ -206,7 +206,7 @@ Relevant fields to access on returned users: ## 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`. +With offline support enabled (SDK 4.2.1 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). diff --git a/sdk/ios/campaigns.mdx b/sdk/ios/campaigns.mdx index 2bc4a1c60..6697c8dc0 100644 --- a/sdk/ios/campaigns.mdx +++ b/sdk/ios/campaigns.mdx @@ -277,7 +277,7 @@ Call `fetchNext()` repeatedly for pagination. When the server has no more items, ### 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. +With offline support enabled (SDK 4.2.1 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). diff --git a/sdk/ios/connection-status.mdx b/sdk/ios/connection-status.mdx index c648434e0..8e5e43b53 100644 --- a/sdk/ios/connection-status.mdx +++ b/sdk/ios/connection-status.mdx @@ -105,7 +105,7 @@ Always remove connection listeners when they're no longer needed. Failing to rem ## 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). +With offline support enabled (SDK 4.2.1 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 diff --git a/sdk/ios/group-kick-member.mdx b/sdk/ios/group-kick-member.mdx index 1c962c75e..db313ce39 100644 --- a/sdk/ios/group-kick-member.mdx +++ b/sdk/ios/group-kick-member.mdx @@ -228,7 +228,7 @@ BannedGroupMembersRequest *bannedGroupMemberRequest = [[[[BannedGroupMembersRequ ### 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. +With offline support enabled (SDK 4.2.1 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 | |---|---| diff --git a/sdk/ios/marking-delivered-with-push-notification.mdx b/sdk/ios/marking-delivered-with-push-notification.mdx index a6cef57fc..88ac341ba 100644 --- a/sdk/ios/marking-delivered-with-push-notification.mdx +++ b/sdk/ios/marking-delivered-with-push-notification.mdx @@ -82,7 +82,7 @@ Make sure the app ID is exactly the same on both the notification extension targ target 'CometChatSwift' do - pod 'CometChatSDK', '4.1.0' + pod 'CometChatSDK', '4.2.1' pod 'CometChatCallsSDK', '4.2.2' end @@ -90,7 +90,7 @@ end # add your notification extension name here target 'NotificationExtension' do - pod 'CometChatSDK', '4.0.67' + pod 'CometChatSDK', '4.2.1' end ``` diff --git a/sdk/ios/mentions.mdx b/sdk/ios/mentions.mdx index 8229e4cb1..67b658e83 100644 --- a/sdk/ios/mentions.mdx +++ b/sdk/ios/mentions.mdx @@ -205,7 +205,7 @@ let wasMentioned = message.mentionedMe // Returns Bool ## 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). +With offline support enabled (SDK 4.2.1 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 diff --git a/sdk/ios/offline-cached-data.mdx b/sdk/ios/offline-cached-data.mdx index 4249d1722..9b4b72039 100644 --- a/sdk/ios/offline-cached-data.mdx +++ b/sdk/ios/offline-cached-data.mdx @@ -52,7 +52,7 @@ Two rules follow from this: All callbacks are delivered on the main thread. -With offline support **off**, these overloads behave like the classic call: the cached phase never fires, and the server result arrives in `onServer…` instead of `onSuccess`. Nothing changes until you enable offline (see [Enable Offline Support](/sdk/ios/offline-enable)). Requires SDK **4.2.0** or later. +With offline support **off**, these overloads behave like the classic call: the cached phase never fires, and the server result arrives in `onServer…` instead of `onSuccess`. Nothing changes until you enable offline (see [Enable Offline Support](/sdk/ios/offline-enable)). Requires SDK **4.2.1** or later. diff --git a/sdk/ios/offline-enable.mdx b/sdk/ios/offline-enable.mdx index 97d01b32a..5b7107d8e 100644 --- a/sdk/ios/offline-enable.mdx +++ b/sdk/ios/offline-enable.mdx @@ -34,16 +34,16 @@ Offline support is **off by default**. You turn it on once, at initialization, b -Offline support requires CometChat iOS SDK **4.2.0** or later. Update the dependency: +Offline support requires CometChat iOS SDK **4.2.1** or later. Update the dependency: ```ruby -pod 'CometChatSDK', '4.2.0' +pod 'CometChatSDK', '4.2.1' ``` -Set the `https://github.com/cometchat/chat-sdk-ios.git` dependency rule to `Up to Next Major Version` with version `4.2.0`. +Set the `https://github.com/cometchat/chat-sdk-ios.git` dependency rule to `Up to Next Major Version` with version `4.2.1`. diff --git a/sdk/ios/offline-encryption.mdx b/sdk/ios/offline-encryption.mdx index 517aa3c6e..b6f5c806d 100644 --- a/sdk/ios/offline-encryption.mdx +++ b/sdk/ios/offline-encryption.mdx @@ -29,7 +29,7 @@ status["leakage"] // String - what is never covered (media files on dis -Offline support keeps the logged-in user's messages in a local database on the device. Turn encryption on to store that database **encrypted at rest** using [SQLCipher](https://www.zetetic.net/sqlcipher/). Encryption is **opt-in** and off by default; nothing changes until you call `setEncryption(true)`. The minimum SDK version is **4.2.0**. +Offline support keeps the logged-in user's messages in a local database on the device. Turn encryption on to store that database **encrypted at rest** using [SQLCipher](https://www.zetetic.net/sqlcipher/). Encryption is **opt-in** and off by default; nothing changes until you call `setEncryption(true)`. The minimum SDK version is **4.2.1**. Encryption covers the **message database only**. Downloaded and outgoing media files (photos, voice notes, documents) stay as ordinary unencrypted files on disk, because their local paths are handed to native image and video loaders. See [What is and isn't encrypted](#what-is-and-isn-t-encrypted). diff --git a/sdk/ios/offline-media-caching.mdx b/sdk/ios/offline-media-caching.mdx index 252502b1e..ef4378e98 100644 --- a/sdk/ios/offline-media-caching.mdx +++ b/sdk/ios/offline-media-caching.mdx @@ -38,7 +38,7 @@ CometChat.addMediaDownloadListener("MEDIA_LISTENER", mediaObserver) // MediaDo With offline support on, the SDK can cache attachment bytes durably on the device so media stays viewable offline — even after the server's presigned URL has expired. This page covers the caching modes, what downloads automatically, how to read cached bytes, and how to download media on demand. -Media caching applies only while offline support is active for the logged-in user (`CometChat.isOfflineEnabled()` is `true`). See [Enable Offline Support](/sdk/ios/offline-enable). +Media caching applies only while offline support is active for the logged-in user (`CometChat.isOfflineEnabled()` is `true`). See [Enable Offline Support](/sdk/ios/offline-enable). Requires SDK **4.2.1** or later. ## Caching modes diff --git a/sdk/ios/offline-overview.mdx b/sdk/ios/offline-overview.mdx index 43b52bf4c..b4a0a2bfd 100644 --- a/sdk/ios/offline-overview.mdx +++ b/sdk/ios/offline-overview.mdx @@ -8,7 +8,7 @@ description: "Understand how local caching, the send outbox, and reconnect catch ```swift -// Offline support is OFF by default. Turn it on at init (SDK 4.2.0 or later). +// Offline support is OFF by default. Turn it on at init (SDK 4.2.1 or later). let offlineConfig = OfflineConfig.Builder() .setEnabled(true) .build() @@ -29,7 +29,7 @@ let active = CometChat.isOfflineEnabled() // Bool Offline support keeps the logged-in user's conversations and messages on the device so your app can show them instantly, lets the user send messages while disconnected, and catches up automatically when the connection returns. It is **off by default** — nothing changes in your app until you enable it ([Enable Offline Support](/sdk/ios/offline-enable)). This page explains the mental model; the other pages show the exact APIs. -Offline support ships in CometChat iOS SDK **4.2.0** or later. +Offline support ships in CometChat iOS SDK **4.2.1** or later. ## How it works diff --git a/sdk/ios/offline-reference.mdx b/sdk/ios/offline-reference.mdx index 28b948e81..667d02eb7 100644 --- a/sdk/ios/offline-reference.mdx +++ b/sdk/ios/offline-reference.mdx @@ -32,7 +32,7 @@ CometChat.clearOfflineCache() -This page is the full surface of CometChat's offline support on iOS: configuration options, public methods, listeners, enums, model fields, and error codes. The minimum SDK version is **4.2.0**, and offline support is **off by default**. For task-focused guides see [Enable Offline Support](/sdk/ios/offline-enable), [Show Cached Data](/sdk/ios/offline-cached-data), [Send While Offline](/sdk/ios/offline-send), [Stay in Sync](/sdk/ios/offline-sync), [Media Caching](/sdk/ios/offline-media-caching), and [Encrypt the Cache](/sdk/ios/offline-encryption). +This page is the full surface of CometChat's offline support on iOS: configuration options, public methods, listeners, enums, model fields, and error codes. The minimum SDK version is **4.2.1**, and offline support is **off by default**. For task-focused guides see [Enable Offline Support](/sdk/ios/offline-enable), [Show Cached Data](/sdk/ios/offline-cached-data), [Send While Offline](/sdk/ios/offline-send), [Stay in Sync](/sdk/ios/offline-sync), [Media Caching](/sdk/ios/offline-media-caching), and [Encrypt the Cache](/sdk/ios/offline-encryption). ## OfflineConfig options diff --git a/sdk/ios/offline-send.mdx b/sdk/ios/offline-send.mdx index 1cb006465..1e1ab0a92 100644 --- a/sdk/ios/offline-send.mdx +++ b/sdk/ios/offline-send.mdx @@ -37,7 +37,7 @@ CometChat.addOutboxListener("OUTBOX_LISTENER", outboxListener) // OutboxListen With offline support enabled, a message you send while the device has no connection is **durably queued on the device** instead of failing. It keeps its place across an app restart and is sent automatically once the connection is back and stable (with `autoSendPendingOnReconnect` on, the default). This page shows the offline-aware send overloads, how to read a message's status, how to inspect and recover the send queue, and the queue limits. -Offline support is **off by default** and requires SDK **4.2.0** or newer. Queuing only happens once you [enable it](/sdk/ios/offline-enable); with offline off, a send over no connection fails exactly as before. +Offline support is **off by default** and requires SDK **4.2.1** or newer. Queuing only happens once you [enable it](/sdk/ios/offline-enable); with offline off, a send over no connection fails exactly as before. The classic `sendTextMessage(message:onSuccess:onError:)` and its media, custom and interactive siblings are unchanged. They never queue and never report a pending stage; to get the offline behaviour, call the overloads below. diff --git a/sdk/ios/offline-sync.mdx b/sdk/ios/offline-sync.mdx index 7560d2150..c3ed0abb1 100644 --- a/sdk/ios/offline-sync.mdx +++ b/sdk/ios/offline-sync.mdx @@ -39,7 +39,7 @@ CometChat.clearOfflineCache() // destructive; fai When the device comes back online, the SDK runs a **catch-up sync**: it refreshes the conversation list, then replays everything that changed in your messages since the last sync, and merges the results into the local cache. This page covers how to observe that sync, trigger one on demand, and manage the cache it maintains. -Everything on this page is a no-op unless offline support is active for the logged-in user (`CometChat.isOfflineEnabled()` is `true`). See [Enable Offline Support](/sdk/ios/offline-enable). +Everything on this page is a no-op unless offline support is active for the logged-in user (`CometChat.isOfflineEnabled()` is `true`). See [Enable Offline Support](/sdk/ios/offline-enable). Requires SDK **4.2.1** or later. ## How catch-up works diff --git a/sdk/ios/reactions.mdx b/sdk/ios/reactions.mdx index acdd37def..3fad4ab27 100644 --- a/sdk/ios/reactions.mdx +++ b/sdk/ios/reactions.mdx @@ -398,7 +398,7 @@ class ChatViewController: UIViewController, CometChatMessageDelegate { ## Offline support -With offline support enabled (SDK 4.2.0 or later), `fetchNext` and `fetchPrevious` on a `ReactionsRequest` have overloads that deliver `onCachedReactions` first (even when empty) and then `onServerReactions`. Offline, the read ends with `onError`, code `ERROR_INTERNET_UNAVAILABLE`, after the cached page. Each direction keeps its own cached pages. +With offline support enabled (SDK 4.2.1 or later), `fetchNext` and `fetchPrevious` on a `ReactionsRequest` have overloads that deliver `onCachedReactions` first (even when empty) and then `onServerReactions`. Offline, the read ends with `onError`, code `ERROR_INTERNET_UNAVAILABLE`, after the cached page. Each direction keeps its own cached pages. The cached phase replays the page this request last received from the server online, for the same builder settings. It does not run those settings as a query against the cache. Adding or removing a reaction needs a connection and is not queued. Real-time reaction events arrive on `CometChatMessageDelegate`, as described above. See [Show Cached Data](/sdk/ios/offline-cached-data). diff --git a/sdk/ios/receive-message.mdx b/sdk/ios/receive-message.mdx index c064f6c5c..d66e04e32 100644 --- a/sdk/ios/receive-message.mdx +++ b/sdk/ios/receive-message.mdx @@ -220,7 +220,7 @@ The list of messages received is in the form of [`BaseMessage`](/sdk/reference/m ## Offline support -With offline support enabled (SDK 4.2.0 or later): +With offline support enabled (SDK 4.2.1 or later): - `fetchPrevious` and `fetchNext` have overloads that 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 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. Offline, the fetch ends with `onError`, code `ERROR_INTERNET_UNAVAILABLE`, after the cached page. - After a reconnect catch-up, a registered `CometChatMessageDelegate` also receives `onMessagesSynced(_:)`. It carries updates to messages that were already cached, such as reactions, edits, deletes and receipts. Messages that arrived while offline still come one at a time through `onTextMessageReceived`, `onMediaMessageReceived` and the other typed callbacks. diff --git a/sdk/ios/remove-delivered-notifications.mdx b/sdk/ios/remove-delivered-notifications.mdx index 811499671..55879df9f 100644 --- a/sdk/ios/remove-delivered-notifications.mdx +++ b/sdk/ios/remove-delivered-notifications.mdx @@ -56,11 +56,11 @@ platform :ios, '11.0' use_frameworks! target 'MyApp' do - pod 'CometChatSDK', '4.0.67' + pod 'CometChatSDK', '4.2.1' end target 'NotificationExtension' do - pod 'CometChatSDK', '4.0.67' + pod 'CometChatSDK', '4.2.1' end ``` diff --git a/sdk/ios/retrieve-conversations.mdx b/sdk/ios/retrieve-conversations.mdx index d14f5708f..d741f3c7e 100644 --- a/sdk/ios/retrieve-conversations.mdx +++ b/sdk/ios/retrieve-conversations.mdx @@ -255,7 +255,7 @@ CometChat.getConversation(conversationWith: "cometchat-guid-101", conversationTy ### Offline support -With offline support enabled (SDK 4.2.0 or later), `fetchNext` on a `ConversationRequest` has an overload that delivers a cached page first (`onCachedConversations`, even when empty) and then the server list (`onServerConversations`). Offline, the read ends with `onError`, code `ERROR_INTERNET_UNAVAILABLE`, after the cached page. The cached page is answered only when every builder filter on the request can be computed on the device. A single server-only filter blanks the cached page while the server phase still answers in full. +With offline support enabled (SDK 4.2.1 or later), `fetchNext` on a `ConversationRequest` has an overload that delivers a cached page first (`onCachedConversations`, even when empty) and then the server list (`onServerConversations`). Offline, the read ends with `onError`, code `ERROR_INTERNET_UNAVAILABLE`, after the cached page. The cached page is answered only when every builder filter on the request can be computed on the device. A single server-only filter blanks the cached page while the server phase still answers in full. | Builder method | Offline | |---|---| diff --git a/sdk/ios/retrieve-group-members.mdx b/sdk/ios/retrieve-group-members.mdx index d1f2c7a67..b1e4dff73 100644 --- a/sdk/ios/retrieve-group-members.mdx +++ b/sdk/ios/retrieve-group-members.mdx @@ -134,7 +134,7 @@ The `fetchNext()` method returns an array of [`GroupMember`](/sdk/reference/enti ## Offline support -With offline support enabled (SDK 4.2.0 or later), `fetchNext` on a `GroupMembersRequest` has an overload that first delivers `onCachedGroupMembers` from the device, then `onServerGroupMembers` 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. +With offline support enabled (SDK 4.2.1 or later), `fetchNext` on a `GroupMembersRequest` has an overload that first delivers `onCachedGroupMembers` from the device, then `onServerGroupMembers` 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 | |---|---| diff --git a/sdk/ios/retrieve-groups.mdx b/sdk/ios/retrieve-groups.mdx index f0d3d324b..5a9ad3b6a 100644 --- a/sdk/ios/retrieve-groups.mdx +++ b/sdk/ios/retrieve-groups.mdx @@ -146,7 +146,7 @@ GroupsRequest *groupRequest = [[[GroupsRequestBuilder alloc]initWithLimit:limit] ### Offline support -With offline support enabled (SDK 4.2.0 or later), `fetchNext` on a `GroupsRequest` has an overload that first delivers `onCachedGroups` from the device, then `onServerGroups` with the live page to reconcile by `guid`. The cached page is the pages the server last returned for this exact request. It is empty when nothing was recorded. Offline, the read ends with `onError`, code `ERROR_INTERNET_UNAVAILABLE`, after the cached page. A request that uses `set(searchKeyword:)` records nothing, so its cached page is always empty. See [Show Cached Data](/sdk/ios/offline-cached-data). +With offline support enabled (SDK 4.2.1 or later), `fetchNext` on a `GroupsRequest` has an overload that first delivers `onCachedGroups` from the device, then `onServerGroups` with the live page to reconcile by `guid`. The cached page is the pages the server last returned for this exact request. It is empty when nothing was recorded. Offline, the read ends with `onError`, code `ERROR_INTERNET_UNAVAILABLE`, after the cached page. A request that uses `set(searchKeyword:)` records nothing, so its cached page is always empty. See [Show Cached Data](/sdk/ios/offline-cached-data). ## Retrieve Particular Group Details diff --git a/sdk/ios/retrieve-users.mdx b/sdk/ios/retrieve-users.mdx index 388a2e0c6..15c25a402 100644 --- a/sdk/ios/retrieve-users.mdx +++ b/sdk/ios/retrieve-users.mdx @@ -283,7 +283,7 @@ UsersRequest *userRequest = [[[UsersRequestBuilder alloc]initWithLimit:limit] bu ### Offline support -With offline support enabled (SDK 4.2.0 or later), `fetchNext` on a `UsersRequest` has an overload that first delivers `onCachedUsers` from the device, then `onServerUsers` with the live page to reconcile by `uid`. The cached page is the pages the server last returned for this exact request, replayed on the device. It is empty when nothing was recorded. Offline, the read ends with `onError`, code `ERROR_INTERNET_UNAVAILABLE`, after the cached page. +With offline support enabled (SDK 4.2.1 or later), `fetchNext` on a `UsersRequest` has an overload that first delivers `onCachedUsers` from the device, then `onServerUsers` with the live page to reconcile by `uid`. The cached page is the pages the server last returned for this exact request, replayed on the device. It is empty when nothing was recorded. 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. diff --git a/sdk/ios/send-message.mdx b/sdk/ios/send-message.mdx index e7b08e495..2544fe992 100644 --- a/sdk/ios/send-message.mdx +++ b/sdk/ios/send-message.mdx @@ -412,7 +412,7 @@ To handle incoming Card Messages on the client, implement [`onCardMessageReceive ## Offline support -With offline support enabled (SDK 4.2.0 or later), send with the overloads that take `onMessagePending`, `onMessageSent` and `onError`. They exist for text, media, custom and interactive messages. +With offline support enabled (SDK 4.2.1 or later), send with the overloads that take `onMessagePending`, `onMessageSent` and `onError`. They exist for text, media, custom and interactive messages. ```swift CometChat.sendTextMessage(message: textMessage, onMessagePending: { message in diff --git a/sdk/ios/setup.mdx b/sdk/ios/setup.mdx index 2fe67f208..20edb5819 100644 --- a/sdk/ios/setup.mdx +++ b/sdk/ios/setup.mdx @@ -9,7 +9,7 @@ description: "Install, configure, and initialize the CometChat iOS SDK with app ```swift // CocoaPods -pod 'CometChatSDK', '4.1.0' +pod 'CometChatSDK', '4.2.1' // Swift Package Manager // https://github.com/cometchat/chat-sdk-ios.git @@ -67,7 +67,7 @@ platform :ios, '11.0' use_frameworks! target 'MyApp' do - pod 'CometChatSDK', '4.1.0' + pod 'CometChatSDK', '4.2.1' end ``` @@ -96,7 +96,7 @@ CometChatSDK includes video calling components. We suggest you run on physical d -3. Enter the repository URL [`https://github.com/cometchat/chat-sdk-ios.git`](https://github.com/cometchat/chat-sdk-ios.git), set dependency rule to `Up to Next Major Version` with version `4.1.0`, and click **Add Package**. +3. Enter the repository URL [`https://github.com/cometchat/chat-sdk-ios.git`](https://github.com/cometchat/chat-sdk-ios.git), set dependency rule to `Up to Next Major Version` with version `4.2.1`, and click **Add Package**. diff --git a/sdk/ios/thread-subscription.mdx b/sdk/ios/thread-subscription.mdx index 337e894f3..e439eaa92 100644 --- a/sdk/ios/thread-subscription.mdx +++ b/sdk/ios/thread-subscription.mdx @@ -166,7 +166,7 @@ The list starts **empty** for every user when the feature launches — it fills ### Offline support -With offline support enabled (SDK 4.2.0 or later), `fetchNext` on a `ThreadsRequest` has an overload that delivers a cached page first (`onCachedThreads`, even when empty) and then the server list (`onServerThreads`). Offline, it ends with `onError`, code `ERROR_INTERNET_UNAVAILABLE`, after the cached page. +With offline support enabled (SDK 4.2.1 or later), `fetchNext` on a `ThreadsRequest` has an overload that delivers a cached page first (`onCachedThreads`, even when empty) and then the server list (`onServerThreads`). Offline, it ends with `onError`, code `ERROR_INTERNET_UNAVAILABLE`, after the cached page. - With `set(participatedByMe: true)` (the default), `onCachedThreads` holds the threads you take part in that the cache already knows about, in the same order. `set(uid:)` and `set(guid:)` scope that list to one conversation. - With `set(participatedByMe: false)`, the cached page is always empty. diff --git a/sdk/ios/threaded-messages.mdx b/sdk/ios/threaded-messages.mdx index ac77336b6..f77708cd2 100644 --- a/sdk/ios/threaded-messages.mdx +++ b/sdk/ios/threaded-messages.mdx @@ -176,7 +176,7 @@ messagesRequest.fetchPrevious(onSuccess: { (messages) in ## Offline support -With offline support enabled (SDK 4.2.0 or later), a thread fetch (a `MessagesRequest` with `setParentMessageId(parentMessageId:)`) has an overload that delivers the cached thread page first (`onCachedMessages`, even when empty), then the server copy (`onServerMessages`). Offline, the fetch ends with `onError`, code `ERROR_INTERNET_UNAVAILABLE`, after the cached page. A reply sent from a thread is queued like any other message. See [Show Cached Data](/sdk/ios/offline-cached-data) and [Send While Offline](/sdk/ios/offline-send). +With offline support enabled (SDK 4.2.1 or later), a thread fetch (a `MessagesRequest` with `setParentMessageId(parentMessageId:)`) has an overload that delivers the cached thread page first (`onCachedMessages`, even when empty), then the server copy (`onServerMessages`). Offline, the fetch ends with `onError`, code `ERROR_INTERNET_UNAVAILABLE`, after the cached page. A reply sent from a thread is queued like any other message. See [Show Cached Data](/sdk/ios/offline-cached-data) and [Send While Offline](/sdk/ios/offline-send). ## Next Steps diff --git a/sdk/ios/upgrading-from-v3-to-v4.mdx b/sdk/ios/upgrading-from-v3-to-v4.mdx index 03fceaa87..0b6d70431 100644 --- a/sdk/ios/upgrading-from-v3-to-v4.mdx +++ b/sdk/ios/upgrading-from-v3-to-v4.mdx @@ -22,7 +22,7 @@ Change the SDK name CometChatPro to CometChatSDK for chat SDK and provide it v4' ```ruby -pod 'CometChatSDK', '4.1.0' +pod 'CometChatSDK', '4.2.1' pod 'CometChatCallsSDK', '4.2.2' ``` diff --git a/sdk/ios/upload-files.mdx b/sdk/ios/upload-files.mdx index ac3d5b1f1..8512a6204 100644 --- a/sdk/ios/upload-files.mdx +++ b/sdk/ios/upload-files.mdx @@ -339,7 +339,7 @@ Server-side rejections at presign time (e.g. policy or plan denials) carry the s ## Offline support -With offline support enabled (SDK 4.2.0 or later), an upload batch and its files are kept on the device. A batch that was in progress survives an app restart, but it never resumes on its own. Fetch it with `CometChat.getExistingUploadFileRequest` and call `retryAttachment(fileId:)` for each file that came back `.failed`. A media message you send without a connection is queued and sent on reconnect. See [Send While Offline](/sdk/ios/offline-send#durable-media-uploads). +With offline support enabled (SDK 4.2.1 or later), an upload batch and its files are kept on the device. A batch that was in progress survives an app restart, but it never resumes on its own. Fetch it with `CometChat.getExistingUploadFileRequest` and call `retryAttachment(fileId:)` for each file that came back `.failed`. A media message you send without a connection is queued and sent on reconnect. See [Send While Offline](/sdk/ios/offline-send#durable-media-uploads). ## Next Steps diff --git a/ui-kit/ios/ai-assistant-chat-history.mdx b/ui-kit/ios/ai-assistant-chat-history.mdx index 980e1d9a3..2ab6c2971 100644 --- a/ui-kit/ios/ai-assistant-chat-history.mdx +++ b/ui-kit/ios/ai-assistant-chat-history.mdx @@ -56,7 +56,7 @@ The `CometChatAIAssistanceChatHistory` component displays past conversations bet -In Xcode, go to **File → Add Package Dependencies**, enter `https://github.com/cometchat/cometchat-uikit-ios`, select **Up to Next Major Version** from `5.2.3`, and add the `CometChatUIKitSwift` product. See [Getting Started](/ui-kit/ios/getting-started). +In Xcode, go to **File → Add Package Dependencies**, enter `https://github.com/cometchat/cometchat-uikit-ios`, select **Up to Next Major Version** from `5.3.0`, and add the `CometChatUIKitSwift` product. See [Getting Started](/ui-kit/ios/getting-started). diff --git a/ui-kit/ios/call-features.mdx b/ui-kit/ios/call-features.mdx index 3dde67856..ff558f321 100644 --- a/ui-kit/ios/call-features.mdx +++ b/ui-kit/ios/call-features.mdx @@ -43,7 +43,7 @@ In Xcode, go to **File → Add Package Dependencies** and add both packages with | Package URL | Version | Product | | --- | --- | --- | -| `https://github.com/cometchat/cometchat-uikit-ios` | `5.2.3` | `CometChatUIKitSwift` | +| `https://github.com/cometchat/cometchat-uikit-ios` | `5.3.0` | `CometChatUIKitSwift` | | `https://github.com/cometchat/calls-sdk-ios` | `5.0.4` | `CometChatCallsSDK` | The UI Kit brings in `CometChatSDK` itself, and requires iOS 15.1+. CocoaPods stops at UI Kit 5.1.18, so use Swift Package Manager for current releases. diff --git a/ui-kit/ios/calling-integration.mdx b/ui-kit/ios/calling-integration.mdx index 8cfcd6ac3..e79cc2f31 100644 --- a/ui-kit/ios/calling-integration.mdx +++ b/ui-kit/ios/calling-integration.mdx @@ -26,7 +26,7 @@ https://github.com/cometchat/calls-sdk-ios - Your app target needs iOS 15.1 or later, the UI Kit's minimum deployment target. -- Keep the UI Kit on **Up to Next Major Version** from `5.2.3`, as set up in [Getting Started](/ui-kit/ios/getting-started). +- Keep the UI Kit on **Up to Next Major Version** from `5.3.0`, as set up in [Getting Started](/ui-kit/ios/getting-started). diff --git a/ui-kit/ios/campaigns.mdx b/ui-kit/ios/campaigns.mdx index 958d3028d..77f35dad9 100644 --- a/ui-kit/ios/campaigns.mdx +++ b/ui-kit/ios/campaigns.mdx @@ -102,10 +102,10 @@ Both your main app and the extension need to share data via an App Group: The app target gets `CometChatSDK` through the UI Kit package, but that package's only product is `CometChatUIKitSwift`, so the extension can't link `CometChatSDK` from it. Link the chat SDK package to the extension directly: 1. Go to **File → Add Package Dependencies** and enter `https://github.com/cometchat/chat-sdk-ios`. -2. Select **Up to Next Major Version** from `4.1.10` (the same floor the UI Kit declares, so SPM resolves one shared version). +2. Select **Up to Next Major Version** from `4.2.1` (the same floor the UI Kit declares, so SPM resolves one shared version). 3. Add the **CometChatSDK** product to the **extension target** only — not the app target, which already gets it from the UI Kit. -Use Swift Package Manager rather than CocoaPods here: the `CometChatSDK` pod stops at 4.1.9, older than the 4.1.10 the UI Kit resolves. +Use Swift Package Manager rather than CocoaPods here: the `CometChatSDK` pod stops at 4.1.10, older than the 4.2.1 the UI Kit resolves. ### Step 4: Implement the Extension diff --git a/ui-kit/ios/components-overview.mdx b/ui-kit/ios/components-overview.mdx index 5540fb5c9..e7f63610e 100644 --- a/ui-kit/ios/components-overview.mdx +++ b/ui-kit/ios/components-overview.mdx @@ -9,7 +9,7 @@ description: "Understand CometChat iOS UI Kit component types, base components, { "platform": "iOS UI Kit", "package": "CometChatUIKitSwift", - "version": "5.2.3", + "version": "5.3.0", "componentTypes": { "base": "Simple UI elements with no business logic", "components": "UI elements with built-in business logic", diff --git a/ui-kit/ios/getting-started.mdx b/ui-kit/ios/getting-started.mdx index 6bc44a033..1d723779a 100644 --- a/ui-kit/ios/getting-started.mdx +++ b/ui-kit/ios/getting-started.mdx @@ -9,15 +9,15 @@ description: "Integrate CometChat iOS UI Kit with project setup, package install | Field | Value | | --- | --- | | Package | `CometChatUIKitSwift` | -| Version | `5.2.3` (Swift Package Manager, Up to Next Major Version) | +| Version | `5.3.0` (Swift Package Manager, Up to Next Major Version) | | Requirements | Xcode 16+, iOS 15.1+, Swift 5.3+ | | Init | `CometChatUIKit.init(uiKitSettings:)` — must complete before `login()` | | Login | `CometChatUIKit.login(uid:)` — must complete before rendering components | | Order | `init()` → `login()` → render. Breaking this order = blank screen | | Auth Key | Dev/testing only. Use Auth Token in production | | Calling | Optional. Add `CometChatCallsSDK` 5.0.4 (Up to Next Major Version) to enable | -| Dependencies | `CometChatSDK` 4.1.10+ (resolved automatically by the UI Kit package) | -| Offline support | Optional, off by default, from UI Kit 5.3.0. UI Kit 5.3.0 and later need `CometChatSDK` 4.2.1+ (the Dependencies row above is for the 5.2.x releases). `UIKitSettings().setOfflineConfig(_:)` before `build()`. See [Offline Support](/ui-kit/ios/offline-support) | +| Dependencies | `CometChatSDK` 4.2.1+ (resolved automatically by the UI Kit package) | +| Offline support | Optional, off by default, from UI Kit 5.3.0. `UIKitSettings().setOfflineConfig(_:)` before `build()`. See [Offline Support](/ui-kit/ios/offline-support) | | AI Skills | `npx @cometchat/skills add` — [GitHub](https://github.com/cometchat/cometchat-skills) | @@ -102,12 +102,12 @@ https://github.com/cometchat/cometchat-uikit-ios 3. Select **Up to Next Major Version** and enter: ``` -5.2.3 +5.3.0 ``` 4. Add the **CometChatUIKitSwift** product to your app target. -The UI Kit package declares its own dependencies, so SPM also resolves `CometChatSDK` (4.1.10 or later) and `CometChatCardsSwift`. Don't add `chat-sdk-ios` to the app target yourself (a [Notification Service Extension](/ui-kit/ios/campaigns#step-3-add-cometchatsdk-to-the-extension) is the exception: it links `CometChatSDK` from `chat-sdk-ios` directly). If an older integration pins it to an exact version, remove that pin or change it to **Up to Next Major Version** from 4.1.10; an exact pin below 4.1.10 makes package resolution fail. +The UI Kit package declares its own dependencies, so SPM also resolves `CometChatSDK` (4.2.1 or later) and `CometChatCardsSwift`. Don't add `chat-sdk-ios` to the app target yourself (a [Notification Service Extension](/ui-kit/ios/campaigns#step-3-add-cometchatsdk-to-the-extension) is the exception: it links `CometChatSDK` from `chat-sdk-ios` directly). If an older integration pins it to an exact version, remove that pin or change it to **Up to Next Major Version** from 4.2.1; an exact pin below 4.2.1 makes package resolution fail. For voice and video calling, also add `https://github.com/cometchat/calls-sdk-ios` with **Up to Next Major Version** from `5.0.4`. A chat-only app doesn't need it. diff --git a/ui-kit/ios/llms-ios-v5.mdx b/ui-kit/ios/llms-ios-v5.mdx index 165f9d36f..e20605834 100644 --- a/ui-kit/ios/llms-ios-v5.mdx +++ b/ui-kit/ios/llms-ios-v5.mdx @@ -38,11 +38,11 @@ the page for the intent, then read the API there. 5.1.18 and new releases ship through Swift Package Manager only. `Podfile`/`.xcworkspace` remain valid *detection* signals for an existing project, but new integration uses SPM. - **Add one package for chat:** `https://github.com/cometchat/cometchat-uikit-ios`, rule - **Up to Next Major Version** from `5.2.3`, product `CometChatUIKitSwift`. + **Up to Next Major Version** from `5.3.0`, product `CometChatUIKitSwift`. - **The Chat SDK comes in transitively.** The UI Kit package declares `CometChatSDK` - (`chat-sdk-ios`, `from: "4.1.10"`) and `CometChatCardsSwift` itself, so do not add - `chat-sdk-ios` separately. An exact pin below 4.1.10 left over from an older integration makes - resolution fail — remove it or change it to Up to Next Major from 4.1.10. + (`chat-sdk-ios`, `from: "4.2.1"`) and `CometChatCardsSwift` itself, so do not add + `chat-sdk-ios` separately. An exact pin below 4.2.1 left over from an older integration makes + resolution fail — remove it or change it to Up to Next Major from 4.2.1. - **Calls SDK is optional.** Add `https://github.com/cometchat/calls-sdk-ios`, Up to Next Major from `5.0.4`, only for voice/video calling; the kit weak-links it, so a chat-only app builds without it. diff --git a/ui-kit/ios/overview.mdx b/ui-kit/ios/overview.mdx index c0b589aeb..856bf98bf 100644 --- a/ui-kit/ios/overview.mdx +++ b/ui-kit/ios/overview.mdx @@ -9,11 +9,11 @@ description: "Integrate chat functionality into iOS applications with prebuilt, { "platform": "iOS UI Kit", "package": "CometChatUIKitSwift", - "version": "5.2.3", + "version": "5.3.0", "description": "Pre-built UI components for iOS chat applications using SwiftUI", "metadata": { "peerDependencies": { - "CometChatSDK": ">= 4.1.10 (resolved by SPM)" + "CometChatSDK": ">= 4.2.1 (resolved by SPM)" }, "supportedPlatforms": ["iOS 15.1+", "iPadOS 15.1+"], "language": "Swift 5.3+", @@ -31,8 +31,8 @@ description: "Integrate chat functionality into iOS applications with prebuilt, | Property | Value | |----------|-------| | Package | CometChatUIKitSwift | -| Version | 5.2.3 | -| Dependencies | CometChatSDK >= 4.1.10 (resolved by SPM) | +| Version | 5.3.0 | +| Dependencies | CometChatSDK >= 4.2.1 (resolved by SPM) | | Platforms | iOS 15.1+, iPadOS 15.1+ | | Language | Swift 5.3+ | | AI Skills | `npx @cometchat/skills add` — [GitHub](https://github.com/cometchat/cometchat-skills) | diff --git a/ui-kit/ios/troubleshooting.mdx b/ui-kit/ios/troubleshooting.mdx index eb70c2241..1b02e1089 100644 --- a/ui-kit/ios/troubleshooting.mdx +++ b/ui-kit/ios/troubleshooting.mdx @@ -58,8 +58,8 @@ If CocoaPods continues to fail, use SPM instead: 1. In your project folder (where the `Podfile` is), run `pod deintegrate` to take CocoaPods out of the Xcode project, then delete the `Podfile`, `Podfile.lock`, `Pods` folder and `.xcworkspace` 2. Open your `.xcodeproj` in Xcode and set the app target's **Minimum Deployments** to iOS 15.1 or later (the UI Kit package requires it) 3. Go to **File → Add Package Dependencies** -4. Add `https://github.com/cometchat/cometchat-uikit-ios` with **Up to Next Major Version** from `5.2.3` -5. Don't add `chat-sdk-ios` yourself — the UI Kit package resolves `CometChatSDK` 4.1.10 or later. For calling, add `https://github.com/cometchat/calls-sdk-ios` with **Up to Next Major Version** from `5.0.4`. +4. Add `https://github.com/cometchat/cometchat-uikit-ios` with **Up to Next Major Version** from `5.3.0` +5. Don't add `chat-sdk-ios` yourself — the UI Kit package resolves `CometChatSDK` 4.2.1 or later. For calling, add `https://github.com/cometchat/calls-sdk-ios` with **Up to Next Major Version** from `5.0.4`. --- From e1a6f35355abbec1bbaafa3d8bffc7fec6d3eecc Mon Sep 17 00:00:00 2001 From: rajdubey Date: Mon, 23 Nov 2026 20:02:54 +0530 Subject: [PATCH 08/13] docs(ENG-57593): remove duplicate-message mentions from iOS UI Kit offline docs Public docs must not mention duplicate messages from offline sends, even indirectly (Aditya, 23 Nov). Removes the lost-send-acknowledgement bullet from "Limitations and known issues", and the "so it never creates a duplicate" clause from the Retry bullet. That clause was also factually wrong: delivery is at-least-once, so a retry can duplicate (BEH-SEND-23, OutboxAckReconciler.swift:24-27). Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01D7Ygtnje2DAqQ4FmgWhYnt --- ui-kit/ios/offline-support.mdx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ui-kit/ios/offline-support.mdx b/ui-kit/ios/offline-support.mdx index e32de5cbc..9c90868de 100644 --- a/ui-kit/ios/offline-support.mdx +++ b/ui-kit/ios/offline-support.mdx @@ -155,7 +155,7 @@ A **keyword** search with no saved match while offline shows **Connect to search - Photos, videos, audio files and documents picked in the attachment tray are **not** queued. Each file starts uploading as soon as it's picked, and uploading needs a connection, so the message can't be sent until its files have uploaded. A tile whose upload failed shows a retry control: tap it to upload that file again once you're back online. With offline support on, the files staged in a chat's tray are kept on the device for that chat, so they come back when the chat is opened again. Send files from the tray while connected. With `enableMultipleAttachments = false`, a picked photo, video, audio file or document is sent as a single media message instead, and is queued like a voice note. - An unsent message (pending, sending or failed) offers only **Retry** and **Delete** in its long-press menu and its VoiceOver actions. It offers no Copy, Reply, React or Edit until it has been sent. - A failed message shows **Not sent. Tap to retry** under the bubble. Tapping that line or the status icon retries it, and VoiceOver reads the hint "Retry" on both. Every failed message can be retried, whatever the reason. Tapping the clock of a queued message retries it too; a message the SDK is sending at that moment keeps a plain clock. -- **Retry** asks the SDK to retry the queued message, so it never creates a duplicate. A message the SDK never queued (for example, refused because the queue was full or the file was too large) is sent again as a new send. +- **Retry** asks the SDK to retry the queued message. A message the SDK never queued (for example, refused because the queue was full or the file was too large) is sent again as a new send. - **Delete** removes the unsent message. If it was already sent in the meantime, the sent copy is deleted instead. - If the SDK no longer holds the unsent message (for example, it was removed after you left the group), Retry and Delete remove it from the list. - If the message is being sent at that moment, Retry and Delete change nothing and the list shows **Sending… try again in a moment** for 4 seconds. @@ -355,7 +355,6 @@ Apps that don't turn on offline support keep today's behaviour, with these excep ## Limitations and known issues -- If a send acknowledgement is lost, the server can end up with one duplicate of the message. - After a quick reconnect, missed messages can take up to about 10 seconds to appear, because the Chat SDK waits at least 10 seconds between two catch-up syncs. - After an app restart, the reason a message failed may be unknown. It's still offered Retry. - If a send gets no answer while connected, the chat can stop updating until the next reconnect. From 6ec45aa44c59ddd7cb230b61bdc8544f155d2940 Mon Sep 17 00:00:00 2001 From: rajdubey Date: Tue, 24 Nov 2026 15:21:19 +0530 Subject: [PATCH 09/13] docs(ENG-57335): reconcile the iOS SDK floor, sync cooldown and offline-off list Review fixes on the iOS offline docs, checked against UI Kit 5.3.0 and aligned with the Android and Flutter pages where those are the correct reference. - offline-support.mdx:54 said standalone SDK offline needs 4.2.0, contradicting offline-enable.mdx:37 and the 15 other SDK pages this branch moves to 4.2.1. - sdk/ios/offline-sync.mdx said the cooldown rejects a sync that "ended less than 15 seconds ago". The SDK's SweepThrottle uses a 10 s cooldown counted from when a sync starts; drop the number, as the Android and Flutter pages do. - Add the three missing offline-off changes (conversation pin/unpin keeping the row, search no longer showing the previous query's results, saved-message rows named from the message). - Give hideOfflineNotices its full list, as the Flutter page does, and correct the offlineStyle defaults sentence for the three jumpToLatest properties. - Add an Offline Support section to troubleshooting, restore the offline-off case on guide-threaded-messages, give the two new event rows their signatures, and fix the unused windowScene binding in the SceneDelegate snippet. CocoaPods install lines are left as they are: we no longer publish there, so removing those sections is a separate change. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01XbguTu9in5yKt5CNV4rjXF --- sdk/ios/offline-sync.mdx | 2 +- ui-kit/ios/events.mdx | 4 ++-- ui-kit/ios/guide-threaded-messages.mdx | 2 +- ui-kit/ios/offline-support.mdx | 13 ++++++++----- ui-kit/ios/troubleshooting.mdx | 12 ++++++++++++ 5 files changed, 24 insertions(+), 9 deletions(-) diff --git a/sdk/ios/offline-sync.mdx b/sdk/ios/offline-sync.mdx index c3ed0abb1..463e7b1ad 100644 --- a/sdk/ios/offline-sync.mdx +++ b/sdk/ios/offline-sync.mdx @@ -163,7 +163,7 @@ If you do not need the acceptance result, call the no-argument `CometChat.forceS | Rejection code (`CometChatConstants.Errors`) | Meaning | |---|---| | `ERROR_OFFLINE_SYNC_IN_PROGRESS` | A sync (automatic or manual) is already running. | -| `ERROR_OFFLINE_SYNC_COOLDOWN` | A sync ended less than 15 seconds ago; the error description carries the remaining cooldown in milliseconds. | +| `ERROR_OFFLINE_SYNC_COOLDOWN` | A sync started too recently; the error description carries the remaining cooldown in milliseconds (retry-after). | | `ERROR_OFFLINE_DISABLED` | A user is logged in but offline support is not active. | | `ERROR_USER_NOT_LOGGED_IN` | Nobody is logged in. | diff --git a/ui-kit/ios/events.mdx b/ui-kit/ios/events.mdx index d6479376c..e722ecfc4 100644 --- a/ui-kit/ios/events.mdx +++ b/ui-kit/ios/events.mdx @@ -580,8 +580,8 @@ CometChatMessageEvents.ccMessageSaved(message: savedMessage, status: .success) | `onVoiceCall` | Voice call initiated | | `onVideoCall` | Video call initiated | | `onMessageError` | Message operation failed | -| `ccMessageSendStateChanged` | An own message moved between sending, sent, failed and discarded. Only with [offline support](/ui-kit/ios/offline-support#offline-events) on | -| `ccOfflineCacheReset` | The Chat SDK reset its offline cache. Only with [offline support](/ui-kit/ios/offline-support#offline-events) on | +| `ccMessageSendStateChanged(message:state:reason:)` | An own message moved between sending, sent, failed and discarded. Only with [offline support](/ui-kit/ios/offline-support#offline-events) on | +| `ccOfflineCacheReset(reason:pendingMessagesLost:)` | The Chat SDK reset its offline cache. Only with [offline support](/ui-kit/ios/offline-support#offline-events) on | ## Card Events diff --git a/ui-kit/ios/guide-threaded-messages.mdx b/ui-kit/ios/guide-threaded-messages.mdx index 0aa476a45..508fd72bd 100644 --- a/ui-kit/ios/guide-threaded-messages.mdx +++ b/ui-kit/ios/guide-threaded-messages.mdx @@ -188,7 +188,7 @@ navigationItem.leftBarButtonItem = UIBarButtonItem( |----------|----------| | Parent message deleted | Display a fallback UI or disable the composer | | No replies | Show an empty state (e.g., "No replies yet") | -| Offline mode | With [offline support](/ui-kit/ios/offline-support) on, the composer stays enabled: text replies and voice notes are queued and sent when the connection returns. Editing, deleting and reacting need a connection. Photos, videos and files picked in the attachment tray need a connection to upload | +| Offline mode | With [offline support](/ui-kit/ios/offline-support) on, the composer stays enabled: text replies and voice notes are queued and sent when the connection returns. Editing, deleting and reacting need a connection. Photos, videos and files picked in the attachment tray need a connection to upload. With offline support off (the default), a reply sent without a connection fails and shows as failed | ## Error Handling diff --git a/ui-kit/ios/offline-support.mdx b/ui-kit/ios/offline-support.mdx index 9c90868de..5250a1bdb 100644 --- a/ui-kit/ios/offline-support.mdx +++ b/ui-kit/ios/offline-support.mdx @@ -51,7 +51,7 @@ The UI Kit builds on the Chat SDK's offline support. This page covers what the U | iOS | 15.1 or later | | Xcode | 16 or later | -UI Kit 5.3.0, the first version with offline support, needs Chat SDK 4.2.1 or later. The UI Kit links the Chat SDK directly, so this applies to every app on UI Kit 5.3.0 or later, whether or not it turns offline on: the UI Kit is built against `CometChat.initFromSettings(offlineConfig:onSuccess:onError:)` (its own `initFromSettings` uses it), which Chat SDK 4.2.0 doesn't have. (Using the Chat SDK's offline support on its own, without the UI Kit, needs 4.2.0; see [Enable Offline Support](/sdk/ios/offline-enable).) +UI Kit 5.3.0, the first version with offline support, needs Chat SDK 4.2.1 or later. The UI Kit links the Chat SDK directly, so this applies to every app on UI Kit 5.3.0 or later, whether or not it turns offline on: the UI Kit is built against `CometChat.initFromSettings(offlineConfig:onSuccess:onError:)` (its own `initFromSettings` uses it), which Chat SDK 4.2.0 doesn't have. Using the Chat SDK's offline support on its own, without the UI Kit, also needs 4.2.1 or later; see [Enable Offline Support](/sdk/ios/offline-enable). Install or update the UI Kit with Swift Package Manager: @@ -90,7 +90,7 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate { var window: UIWindow? func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { - guard let windowScene = (scene as? UIWindowScene) else { return } + guard scene is UIWindowScene else { return } // Offline support is off unless you set a config with enabled = true. let offlineConfig = OfflineConfig.Builder() @@ -288,7 +288,7 @@ For the SDK's own reasons and error codes, see the [Configuration & API Referenc ### Offline style -`CometChatMessageList.offlineStyle` is a global `CometChatOfflineStyle`. Each property defaults to the theme's existing error or secondary-text tokens, so nothing changes until you set one. +`CometChatMessageList.offlineStyle` is a global `CometChatOfflineStyle`. Each property defaults to an existing theme token, so nothing changes until you set one. The notice and status properties take the theme's error or secondary-text tokens; the three `jumpToLatest*` properties take the pill's own white, primary and caption tokens, as the table shows. | Property | Type | Default | Applies to | | --- | --- | --- | --- | @@ -323,7 +323,7 @@ CometChatMessageList.offlineStyle = offlineStyle | Property | Component | Default | Hides | | --- | --- | --- | --- | -| `hideOfflineNotices` | `CometChatMessageList` | `false` | The offline notices (a removed unsent message, a full queue, unsent messages that couldn't be recovered), the "Connect to load more" rows and the "Jump to latest" pill | +| `hideOfflineNotices` | `CometChatMessageList` | `false` | Every offline notice the list would show: a removed unsent message, a full queue, "File too large to send offline", "Sending… try again in a moment", "N messages weren't sent", and unsent messages that couldn't be recovered. It also hides the "Connect to load more" row and the "Jump to latest" pill. The "Not sent" rows, the offline states and "Available when online" still show | | `hideOfflineNotices` | `CometChatConversations` | `false` | Notices about the whole cache, such as unsent messages that couldn't be recovered | ```swift @@ -351,11 +351,14 @@ Apps that don't turn on offline support keep today's behaviour, with these excep - **A failed reaction is rolled back correctly.** The reaction count, your own reaction and its position return to what they were. - **The failed-send event keeps your metadata.** `ccMessageSent` with `.error` now carries the message's `metaData` with `error: true` added, instead of replacing it. - **Paging after a jump skips unsent rows.** The older and newer requests use the oldest and newest message that has a server id. +- **A conversation pin or unpin from another device keeps the row.** `CometChatConversations` now takes only `pinnedAt` and `pinnedBy` onto the row, so its name, avatar, last message and unread count stay as they were. +- **A changed or cleared search no longer shows the previous search's results.** This applies to `CometChatUsers`, `CometChatGroups`, `CometChatGroupMembers` and `CometChatSearch`. +- **`CometChatSavedMessages` rows are named from the message**, not from a `getUser` or `getGroup` lookup. This fixes a raw uid showing on a row for a message you sent, and the wrong name on a received one-to-one row. - **Media links that name a file on the device are used only for your own messages.** A `file://` link or an absolute path in another user's message is no longer opened, shown or shared. Image and file bubbles now keep their downloads in `Documents/cc_media/`, so files saved earlier in the app's Documents folder are downloaded again. ## Limitations and known issues -- After a quick reconnect, missed messages can take up to about 10 seconds to appear, because the Chat SDK waits at least 10 seconds between two catch-up syncs. +- After a quick reconnect, missed messages can take up to about 10 seconds to appear, because the Chat SDK waits about 10 seconds from the start of one catch-up sync to the start of the next. - After an app restart, the reason a message failed may be unknown. It's still offered Retry. - If a send gets no answer while connected, the chat can stop updating until the next reconnect. - Keyword search, message information, call logs and AI streamed replies need a connection. diff --git a/ui-kit/ios/troubleshooting.mdx b/ui-kit/ios/troubleshooting.mdx index 1b02e1089..a97d76cf1 100644 --- a/ui-kit/ios/troubleshooting.mdx +++ b/ui-kit/ios/troubleshooting.mdx @@ -160,6 +160,18 @@ If CocoaPods continues to fail, use SPM instead: --- +## Offline Support + +| Issue | Solution | +|-------|----------| +| Package resolution fails after updating to UI Kit 5.3.0 | UI Kit 5.3.0 needs Chat SDK 4.2.1 or later, whether or not offline is on. An exact pin, or an up-to-next-minor pin, on 4.1.x or 4.2.0 stops resolution. Use **Up to Next Major** from 4.2.1 | +| Offline is enabled but nothing is cached or queued | Offline support is active only while a user is logged in. Check `CometChat.isOfflineEnabled()` after login, and that the `OfflineConfig` you built with `enabled = true` reached `setOfflineConfig(_:)` before `build()` | +| "Connect to load …" shows where a custom view used to | That is the offline state for a list with nothing saved. A custom `errorStateView` replaces it, and `hideErrorView = true` hides it | +| No notices, and no "Connect to load more" row | `hideOfflineNotices` is `true` on that component | +| A pin or save does not update until the screen is reopened | Since Chat SDK 4.2.1 the acting device gets no listener callback for its own pin or save. Update your UI from the call's `onSuccess` | + +--- + ## Message Composer | Issue | Solution | From 9170476e62afc0401a694b2c7c95099aabc9d2de Mon Sep 17 00:00:00 2001 From: rajdubey Date: Tue, 24 Nov 2026 15:49:47 +0530 Subject: [PATCH 10/13] docs(ios): keep the CocoaPods snippets at the versions the pod actually has, and carry scope only in the limitations list The CometChatSDK pod stops at 4.1.10, so revert the 4.2.1 pod bumps and install offline support through Swift Package Manager only. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01XbguTu9in5yKt5CNV4rjXF --- .../marking-delivered-with-push-notification.mdx | 4 ++-- sdk/ios/offline-enable.mdx | 15 ++++----------- sdk/ios/remove-delivered-notifications.mdx | 4 ++-- sdk/ios/setup.mdx | 4 ++-- sdk/ios/upgrading-from-v3-to-v4.mdx | 2 +- ui-kit/ios/offline-support.mdx | 5 +++-- 6 files changed, 14 insertions(+), 20 deletions(-) diff --git a/sdk/ios/marking-delivered-with-push-notification.mdx b/sdk/ios/marking-delivered-with-push-notification.mdx index 88ac341ba..a6cef57fc 100644 --- a/sdk/ios/marking-delivered-with-push-notification.mdx +++ b/sdk/ios/marking-delivered-with-push-notification.mdx @@ -82,7 +82,7 @@ Make sure the app ID is exactly the same on both the notification extension targ target 'CometChatSwift' do - pod 'CometChatSDK', '4.2.1' + pod 'CometChatSDK', '4.1.0' pod 'CometChatCallsSDK', '4.2.2' end @@ -90,7 +90,7 @@ end # add your notification extension name here target 'NotificationExtension' do - pod 'CometChatSDK', '4.2.1' + pod 'CometChatSDK', '4.0.67' end ``` diff --git a/sdk/ios/offline-enable.mdx b/sdk/ios/offline-enable.mdx index 5b7107d8e..78cb353fd 100644 --- a/sdk/ios/offline-enable.mdx +++ b/sdk/ios/offline-enable.mdx @@ -34,18 +34,11 @@ Offline support is **off by default**. You turn it on once, at initialization, b -Offline support requires CometChat iOS SDK **4.2.1** or later. Update the dependency: +Offline support requires CometChat iOS SDK **4.2.1** or later, installed with Swift Package Manager. Set the `https://github.com/cometchat/chat-sdk-ios.git` dependency rule to `Up to Next Major Version` with version `4.2.1`. - - -```ruby -pod 'CometChatSDK', '4.2.1' -``` - - -Set the `https://github.com/cometchat/chat-sdk-ios.git` dependency rule to `Up to Next Major Version` with version `4.2.1`. - - + +The `CometChatSDK` CocoaPod stops at 4.1.10. New Chat SDK releases ship through Swift Package Manager only, so offline support can't be installed with CocoaPods. + If you are new to the SDK, complete the [standard setup](/sdk/ios/setup) first; the steps below only add offline configuration to your existing `init`. diff --git a/sdk/ios/remove-delivered-notifications.mdx b/sdk/ios/remove-delivered-notifications.mdx index 55879df9f..811499671 100644 --- a/sdk/ios/remove-delivered-notifications.mdx +++ b/sdk/ios/remove-delivered-notifications.mdx @@ -56,11 +56,11 @@ platform :ios, '11.0' use_frameworks! target 'MyApp' do - pod 'CometChatSDK', '4.2.1' + pod 'CometChatSDK', '4.0.67' end target 'NotificationExtension' do - pod 'CometChatSDK', '4.2.1' + pod 'CometChatSDK', '4.0.67' end ``` diff --git a/sdk/ios/setup.mdx b/sdk/ios/setup.mdx index 20edb5819..18371fb26 100644 --- a/sdk/ios/setup.mdx +++ b/sdk/ios/setup.mdx @@ -9,7 +9,7 @@ description: "Install, configure, and initialize the CometChat iOS SDK with app ```swift // CocoaPods -pod 'CometChatSDK', '4.2.1' +pod 'CometChatSDK', '4.1.0' // Swift Package Manager // https://github.com/cometchat/chat-sdk-ios.git @@ -67,7 +67,7 @@ platform :ios, '11.0' use_frameworks! target 'MyApp' do - pod 'CometChatSDK', '4.2.1' + pod 'CometChatSDK', '4.1.0' end ``` diff --git a/sdk/ios/upgrading-from-v3-to-v4.mdx b/sdk/ios/upgrading-from-v3-to-v4.mdx index 0b6d70431..03fceaa87 100644 --- a/sdk/ios/upgrading-from-v3-to-v4.mdx +++ b/sdk/ios/upgrading-from-v3-to-v4.mdx @@ -22,7 +22,7 @@ Change the SDK name CometChatPro to CometChatSDK for chat SDK and provide it v4' ```ruby -pod 'CometChatSDK', '4.2.1' +pod 'CometChatSDK', '4.1.0' pod 'CometChatCallsSDK', '4.2.2' ``` diff --git a/ui-kit/ios/offline-support.mdx b/ui-kit/ios/offline-support.mdx index 5250a1bdb..bb22a5583 100644 --- a/ui-kit/ios/offline-support.mdx +++ b/ui-kit/ios/offline-support.mdx @@ -356,11 +356,12 @@ Apps that don't turn on offline support keep today's behaviour, with these excep - **`CometChatSavedMessages` rows are named from the message**, not from a `getUser` or `getGroup` lookup. This fixes a raw uid showing on a row for a message you sent, and the wrong name on a received one-to-one row. - **Media links that name a file on the device are used only for your own messages.** A `file://` link or an absolute path in another user's message is no longer opened, shown or shared. Image and file bubbles now keep their downloads in `Documents/cc_media/`, so files saved earlier in the app's Documents folder are downloaded again. -## Limitations and known issues +## Limitations +- The cache holds only what the user loaded while online, plus what the catch-up brings in on reconnect. A user who has never been online on this device has nothing to show offline. +- Edits, deletes and reactions on sent messages are not queued offline. They need a connection when the user makes them. - After a quick reconnect, missed messages can take up to about 10 seconds to appear, because the Chat SDK waits about 10 seconds from the start of one catch-up sync to the start of the next. - After an app restart, the reason a message failed may be unknown. It's still offered Retry. -- If a send gets no answer while connected, the chat can stop updating until the next reconnect. - Keyword search, message information, call logs and AI streamed replies need a connection. - Media downloaded for offline use is stored unencrypted on the device. The message cache itself can be encrypted. See [Encrypt the Cache](/sdk/ios/offline-encryption). From 20852c6ff95c2b62f196f452c46de06fe9ec80fe Mon Sep 17 00:00:00 2001 From: rajdubey Date: Tue, 24 Nov 2026 16:14:57 +0530 Subject: [PATCH 11/13] docs(ENG-57335): limitations carries scope only, fix the encryption anchor Removed the 10-second catch-up and unknown-failure-reason-after-restart items (known issues in the kit's release notes, not docs content), and corrected the #what-is-and-isnt-encrypted anchor. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01XbguTu9in5yKt5CNV4rjXF --- sdk/ios/offline-encryption.mdx | 2 +- ui-kit/ios/offline-support.mdx | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/sdk/ios/offline-encryption.mdx b/sdk/ios/offline-encryption.mdx index b6f5c806d..049803cb1 100644 --- a/sdk/ios/offline-encryption.mdx +++ b/sdk/ios/offline-encryption.mdx @@ -32,7 +32,7 @@ status["leakage"] // String - what is never covered (media files on dis Offline support keeps the logged-in user's messages in a local database on the device. Turn encryption on to store that database **encrypted at rest** using [SQLCipher](https://www.zetetic.net/sqlcipher/). Encryption is **opt-in** and off by default; nothing changes until you call `setEncryption(true)`. The minimum SDK version is **4.2.1**. -Encryption covers the **message database only**. Downloaded and outgoing media files (photos, voice notes, documents) stay as ordinary unencrypted files on disk, because their local paths are handed to native image and video loaders. See [What is and isn't encrypted](#what-is-and-isn-t-encrypted). +Encryption covers the **message database only**. Downloaded and outgoing media files (photos, voice notes, documents) stay as ordinary unencrypted files on disk, because their local paths are handed to native image and video loaders. See [What is and isn't encrypted](#what-is-and-isnt-encrypted). ## No extra dependency diff --git a/ui-kit/ios/offline-support.mdx b/ui-kit/ios/offline-support.mdx index bb22a5583..db81b5cf9 100644 --- a/ui-kit/ios/offline-support.mdx +++ b/ui-kit/ios/offline-support.mdx @@ -360,8 +360,6 @@ Apps that don't turn on offline support keep today's behaviour, with these excep - The cache holds only what the user loaded while online, plus what the catch-up brings in on reconnect. A user who has never been online on this device has nothing to show offline. - Edits, deletes and reactions on sent messages are not queued offline. They need a connection when the user makes them. -- After a quick reconnect, missed messages can take up to about 10 seconds to appear, because the Chat SDK waits about 10 seconds from the start of one catch-up sync to the start of the next. -- After an app restart, the reason a message failed may be unknown. It's still offered Retry. - Keyword search, message information, call logs and AI streamed replies need a connection. - Media downloaded for offline use is stored unencrypted on the device. The message cache itself can be encrypted. See [Encrypt the Cache](/sdk/ios/offline-encryption). From 6442a28a99f546d75c11f33b7b4f7aeffbe15a06 Mon Sep 17 00:00:00 2001 From: rajdubey Date: Tue, 24 Nov 2026 16:17:40 +0530 Subject: [PATCH 12/13] docs: name the encryption section "What gets encrypted", as on Android, Flutter and React Native MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The rendered id of "What is and isn't encrypted" keeps a typographic apostrophe (verified on the live page: id="what-is-and-isn’t-encrypted"), so the in-page link #what-is-and-isn-t-encrypted never resolved. Android, Flutter and React Native already head this section "What gets encrypted"; the JavaScript and iOS pages now match, with the link text unchanged. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01XbguTu9in5yKt5CNV4rjXF --- sdk/ios/offline-encryption.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/ios/offline-encryption.mdx b/sdk/ios/offline-encryption.mdx index 049803cb1..7e8ed4f93 100644 --- a/sdk/ios/offline-encryption.mdx +++ b/sdk/ios/offline-encryption.mdx @@ -32,7 +32,7 @@ status["leakage"] // String - what is never covered (media files on dis Offline support keeps the logged-in user's messages in a local database on the device. Turn encryption on to store that database **encrypted at rest** using [SQLCipher](https://www.zetetic.net/sqlcipher/). Encryption is **opt-in** and off by default; nothing changes until you call `setEncryption(true)`. The minimum SDK version is **4.2.1**. -Encryption covers the **message database only**. Downloaded and outgoing media files (photos, voice notes, documents) stay as ordinary unencrypted files on disk, because their local paths are handed to native image and video loaders. See [What is and isn't encrypted](#what-is-and-isnt-encrypted). +Encryption covers the **message database only**. Downloaded and outgoing media files (photos, voice notes, documents) stay as ordinary unencrypted files on disk, because their local paths are handed to native image and video loaders. See [What is and isn't encrypted](#what-gets-encrypted). ## No extra dependency @@ -111,7 +111,7 @@ The string values are also available as constants on `CometChat.OfflineEncryptio The single most useful support signal is `enabled == true` with `atRest == "NONE"`: encryption was switched on but is not in effect — the cache is dormant, still opening, or was opened unencrypted under `.plaintextFallback`. -## What is and isn't encrypted +## What gets encrypted | Data | Encrypted at rest? | |---|---| From 08b1fad708bad5f92c8f3a55ad60b8f4d6cb68cf Mon Sep 17 00:00:00 2001 From: rajdubey Date: Tue, 24 Nov 2026 17:35:59 +0530 Subject: [PATCH 13/13] docs(ENG-57593): match the encryption link text to the renamed heading The heading became "What gets encrypted" and the anchor was updated with it, but the link text still read "What is and isn't encrypted". Same fix as on the JavaScript page in #611. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01XbguTu9in5yKt5CNV4rjXF --- sdk/ios/offline-encryption.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/ios/offline-encryption.mdx b/sdk/ios/offline-encryption.mdx index 7e8ed4f93..050c10cbc 100644 --- a/sdk/ios/offline-encryption.mdx +++ b/sdk/ios/offline-encryption.mdx @@ -32,7 +32,7 @@ status["leakage"] // String - what is never covered (media files on dis Offline support keeps the logged-in user's messages in a local database on the device. Turn encryption on to store that database **encrypted at rest** using [SQLCipher](https://www.zetetic.net/sqlcipher/). Encryption is **opt-in** and off by default; nothing changes until you call `setEncryption(true)`. The minimum SDK version is **4.2.1**. -Encryption covers the **message database only**. Downloaded and outgoing media files (photos, voice notes, documents) stay as ordinary unencrypted files on disk, because their local paths are handed to native image and video loaders. See [What is and isn't encrypted](#what-gets-encrypted). +Encryption covers the **message database only**. Downloaded and outgoing media files (photos, voice notes, documents) stay as ordinary unencrypted files on disk, because their local paths are handed to native image and video loaders. See [What gets encrypted](#what-gets-encrypted). ## No extra dependency