The Sceyt Chat Android UIKit includes a local persistence layer built on top of Room. Channels, messages, members, and attachment metadata are stored on device, so your users can browse conversations and read history even without a network connection. When connectivity is restored, the UIKit automatically reconciles local state with the server.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/sceyt/sceyt-chat-android-uikit/llms.txt
Use this file to discover all available pages before exploring further.
How It Works
On first launch the UIKit fetches channel and message data from the Sceyt platform and writes it into the local Room database. Subsequent opens load from the database first, delivering near-instant rendering before any network round-trip completes. A background sync manager (SceytSyncManager) then fetches any deltas from the server and updates the UI reactively through Kotlin Flow.
Enabling the Database
The database layer is controlled by theenableDatabase parameter of SceytChatUIKit.initialize(). It is true by default.
What Is Cached
The following data is persisted locally:| Entity | Scope |
|---|---|
| Channels | All channels the user is a member of |
| Messages | All messages fetched within open conversations |
| Members | Channel member list and roles |
| Attachments | File metadata (path, type, size); binary files are cached on demand |
Automatic Sync on Reconnect
WhenSceytChatUIKit.config.syncChannelsAfterConnect is true (the default), the UIKit triggers a background sync as soon as the WebSocket connection is re-established after a disconnect or app backgrounding. This fetches updated channel metadata and any missed messages.
Accessing Cached Data Programmatically
TheSceytChatUIFacade exposes the channelInteractor for reading cached channel records directly from the database without going through the network:
Both
getChannelFromDb and getChannelsCountFromDb are suspend functions and must be called from a coroutine or lifecycleScope.Manual Sync
If your app needs to trigger a sync at a specific moment (for example, when the user performs a pull-to-refresh), useSceytChatUIKit.chatUIFacade.sceytSyncManager:
Preventing Duplicate Attachment Uploads
ThepreventDuplicateAttachmentUpload flag (default true) tells the UIKit to skip re-uploading a file that has already been successfully transferred, using a content-based fingerprint check.