AI Integration Quick Reference
AI Integration Quick Reference
This is separate from an admin-global pin, which is managed from the
CometChat Dashboard and shows for every user.
Those cannot be created or removed from the SDK, only observed.
Pin a Conversation
A conversation is addressed by its peer — the other user’s UID for a one-on-one conversation, or the GUID for a group — together with the conversation type.- TypeScript (User)
- JavaScript (User)
- TypeScript (Group)
- JavaScript (Group)
Conversation, with pinnedAt and pinnedBy set. Pinning is idempotent.
Unpin a Conversation
- TypeScript
- JavaScript
getPinnedBy() is "app_system".
Fetch Pinned Conversations
The default conversation list is already pin-ordered by the server: admin-global pins first, then the user’s own pins, then everything else. Each row already carriespinnedAt and pinnedBy, so a pinned strip usually needs no separate call.
When you do want the pinned set standalone, use setPinnedBy().
- TypeScript
- JavaScript
These are plain strings in the React Native SDK — there is no
CometChat.PINNED_BY constant to import. The server rejects any other value
with ERR_BAD_REQUEST — end users cannot query another user’s pins — so the
builder drops unrecognised entries before the request is sent.Check if a Conversation is Pinned
As with messages, the React Native SDK has noisPinned() helper — the presence of pinnedAt is the boolean.
- TypeScript
- JavaScript
Keeping the List in Sync
Update your list from the promise on the device that performed the action, and re-fetch the conversation list when the screen regains focus to pick up pins made elsewhere.- TypeScript
- JavaScript
Pin Limit
- TypeScript
- JavaScript
null when the app settings carry no value. getSystemPinConversationLimit() is the separate admin/global cap, enforced independently — system pins do not consume a user’s allowance.
The conversation pin cap and the message pin cap are separate quotas with
different values, and both are server-owned and tenant-overridable. Read
each one at runtime rather than assuming a number or reusing the other.
Feature Availability
- TypeScript
- JavaScript
false as the normal case for a new app, not as an error.
Next Steps
Retrieve Conversations
Fetch and order the conversation list
Pin A Message
Highlight a message for everyone in a conversation
Save A Message
Bookmark a message privately, across conversations
Delete A Conversation
Remove a conversation from the list