AI Integration Quick Reference
AI Integration Quick Reference
Pin a Message
Pinning is conversation-wide: every participant sees the message as pinned.- Swift
Pinning is permission-gated. In a group, only the owner, admins and moderators can pin or unpin; everyone can view the pinned list. In one-to-one conversations both participants can pin.
Unpin a Message
- Swift
Save a Message
Saving is private to the logged-in user and syncs across that user’s own devices. It carries no permission checks.- Swift
Unsave a Message
- Swift
BaseMessage.
Message Fields
Three fields onBaseMessage carry the state:
- Swift
Fetch Pinned Messages
Pinned messages are fetched withMessagesRequest filtered by pinned, scoped to a conversation with uid or guid.
- Group
- One-to-one
Fetch Saved Messages
Saved messages are a per-user collection spanning every conversation, so the request takes nouid or guid.
- Swift
Both limits are capped at 100 server-side, so a single page fetches the whole list.
Real-time Events
ImplementCometChatMessageDelegate to receive pin and save updates. All four callbacks are optional and each carries the full updated message.
- Swift
Feature Availability
Both features are gated per app and can be checked before showing any UI:- Swift
Error Handling
For the two limit errors, read the actual cap from the exception’s
errorParams rather than hard-coding a number — the limit is server-owned and may change.