Skip to main content
CometChatSavedMessages is a full-screen list of the messages the logged-in user has saved, newest save first. Saves are private to the user and span every conversation, so each row is labelled with the chat it came from.

Where It Fits

This is a user-level screen, not a per-conversation one. It takes no user or group — it always shows the logged-in user’s saves across every chat. Open it from your app’s chrome (a tab, the chats-screen menu, a profile or settings entry), not from a conversation header.
Contrast with Pinned Messages, which is scoped to one conversation and visible to everyone in it. Saves are private: only the saving user sees them, synced across that user’s own devices. Pin and save are off by default — see the Pin and Save Messages guide to turn them on. This screen is read-only by design: opening it never marks anything as read, sends receipts, or changes the unread count.

Minimal Render

CometChatSavedMessages is a view controller with a no-argument initializer.
If you push this screen from a tab that hides the navigation bar, set hideNavigationBar = false or the title and back button never appear.Do not also set hideBackButton = false. The component supplies its own back chevron as a left bar button item, so clearing that flag renders two back buttons side by side.

Filtering

The list is fetched with a MessagesRequest.MessageRequestBuilder. The default comes from SavedMessagesBuilder:
Unlike the pinned builder there is no uid or guid to set — saved messages are a per-user collection spanning every conversation. The server caps saves at 100, so a limit of 100 fetches the entire list in one page.
A custom request builder must keep set(saved: true). Without it the request returns every message the user can see and the screen lists them all as though they were saved.

Actions and Events

Callback Props

onMessageClicked

Fires when a row is tapped. Because a row can belong to any conversation, use it to open that message’s own chat — see Common Patterns.

onError

Fires when the fetch fails, and again when an unsave fails.

onLoad

Fires with the fetched messages each time the list reloads.

onEmpty

Fires when the fetch completes with nothing saved.

onBack

Inherited from CometChatListBase. The component ships a default that pops the navigation stack; set your own to replace it — useful when you also need to re-hide the navigation bar on the way out.

Actions Reference

Global UI Events

See Events for the full listener surface.

Custom View Slots

Each slot receives the row’s BaseMessage and returns a view that replaces the default.

set(titleView:)

Replaces the row title, which by default is the source conversation name rather than the sender.

set(subtitle:)

Replaces the message-preview line.

set(leadingView:)

Replaces the leading slot, which holds the source conversation’s avatar by default.

set(trailingView:)

Replaces the trailing slot, which holds the timestamp by default.

set(listItemView:)

Replaces the entire row.

Styling

Style Hierarchy

SavedMessagesStyle conforms to ListBaseStyle and ListItemStyle, so it carries the standard list properties plus two save-specific ones.

Global Level Styling

Instance Level Styling

Key Style Properties

Customization Matrix


Props

All props are optional. Sorted alphabetically.

avatarStyle

Styling for the row avatar, which shows the source conversation.

dateStyle

Styling for the row timestamp.

dateTimeFormatter

Custom timestamp formatting.

hideUnsaveOption

Hides the per-row unsave swipe action.

style

The component’s style object.

Methods

set(requestBuilder:)

Replaces the request used to fetch the list. Must retain set(saved: true).

set(textFormatters:)

Applies custom text formatters to the message previews.
SavedMessagesViewModel is public in name only — every member except setRequestBuilder(requestBuilder:) is internal. Customize through the props and view slots above rather than the view model.

Common Patterns

Open from the chats screen menu

Saves are user-level, so the entry point belongs in app chrome rather than a conversation.

Open the conversation a row came from

A saved row can belong to any chat, so resolve the conversation from the message before navigating. For a group, look it up by receiverUid. For one-to-one, a received message is addressed to the logged-in user, so the conversation is with its sender.

Custom empty state


Pin and Save Messages Guide

End-to-end setup for pinning and saving

Chat SDK: Pin and Save

The underlying SDK methods and message fields