AI Integration Quick Reference
AI Integration Quick Reference
CometChatSavedMessages lists every message the logged-in user has saved, newest save first. Unlike a
pin, a save is private and spans conversations — nobody else can see it, and the list is not scoped
to a single chat.
messagesRequestBuilder and textFormatters require @cometchat/chat-uikit-react-native 5.5.1 or later. Neither prop exists in 5.5.0. Everything else on this page works on either version.Where It Fits
Because the list is account-wide, this panel belongs at app level — a tab, a drawer entry, or a profile screen — not inside a single conversation.
Minimal Render
There is deliberately nouser or group prop. Scoping it to one conversation would defeat the point.
- TypeScript
- JavaScript
Filtering
Pass amessagesRequestBuilder to control which saved messages are fetched — a search term, a
category or type filter, or the page size. Set setSavedOnly(true) on the builder to make the
intent explicit; the component re-asserts it on its own copy, so leaving it out is safe.
- TypeScript
The component works on a copy of your builder and re-asserts
setSavedOnly(true) and
setPinnedOnly(false) on it, so those are safe even if you omit them. Any uid / guid on the
builder is cleared: saved messages are account-wide, and scoping them to one conversation would
turn this cross-conversation inbox into a per-chat list. Your own instance is never mutated, so the
same builder can also go to CometChatPinnedMessages.limit prop, then the builder’s own
setLimit(), then 30.
Actions and Events
Callback Props
onItemPress
Fires when a saved row is tapped. Because the rows come from different conversations, it hands you asource alongside the message so you can open the right chat.
source is null when the conversation could not be resolved. Otherwise it carries:
You can also read the routing off the message itself:
onBack
Fires when the back affordance in the header is pressed.Events
The panel keeps itself current without a manual refresh, so a save made on a phone appears on that
user’s tablet on its own.
A save is per-viewer. The same message reads saved for the user who saved it and unsaved for
everybody else — it is never a property of the message globally.
Custom View Slots
The empty, error and loading states are not view slots on this component. Restyle them through
style.emptyStateStyle and style.errorStateStyle instead — see Styling.
ItemView
Replace the whole row. The default row is a conversation row — avatar, source conversation name, and a one-line preview — so a replacement usually wants the same three pieces.Common Patterns
A saved-messages tab
Because the list is account-wide, a tab or drawer entry is the natural home for it.Read-only list
A custom title and close icon
Styling
The component uses the theme system fromCometChatThemeProvider. Pass a style prop to customize the appearance. Every default value resolves from a semantic theme token, so retheming the kit restyles this panel without touching it.
SavedMessagesStyle deliberately has no itemStyle. The rows are conversation rows and take
their chrome from theme.conversationStyles.itemStyle — the same tokens the conversation list
uses — so the two surfaces cannot drift apart. Restyle the rows there and both update together.Style Properties
Props
All props are optional. There is deliberately nouser or group prop — see Minimal Render.
limit
Page size for the fetch.
The server rejects a value above 100.
messagesRequestBuilder
Base request used to fetch the saved messages — a search term, a category or type filter, or the page size. See Filtering.
The component copies the builder and re-asserts
setSavedOnly(true) on the copy, so your instance is never
mutated. The limit prop wins over the builder’s own setLimit().
textFormatters
Text formatters used when rendering the saved rows. Pass the same array you giveCometChatMessageList, otherwise a message reads differently
here than it does in the conversation. See
Text Formatters.
onBack
Called when the back affordance is pressed.onItemPress
Called when a row is pressed.source identifies which conversation the message belongs to.
SavedMessageSource is not exported from the package root, so annotate the parameter with its shape
rather than importing the name:
null when the payload has no hydrated conversation to resolve.
hideUnsaveMessageOption
Hides Unsave in the row’s long-press menu.ItemView
Replaces the default row entirely.title
Panel title.style
Per-instance style overrides, merged over the theme’ssavedMessagesStyles.
See Styling.
Next Steps
Pinned Messages
The conversation-wide, everyone-sees-it counterpart
Message List
Where the Save option is raised
Save A Message (SDK)
The SDK methods underneath this component
Events
Every UI Kit event, in one place