SDKsReact Native
Pin or unpin a conversation
Pin a conversation to the top of the list or remove its pin state using the OpenIM React Native SDK.
Toggle the pin-to-top status on a conversation for the current account. Pinned conversations are rendered at the top of the conversation list:
await OpenIMSDK.pinConversation({
conversationID,
isPinned: true,
});Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
conversationID | string | Yes | Target conversation ID to update. |
isPinned | boolean | Yes | Set true to pin the conversation to the top, or false to unpin. |
Return value
A resolved Promise confirms that the conversation pin state was updated on the server and local database.
The update triggers the OnConversationChanged event. Use conversationID to identify the conversation in your local state store and update isPinned so the list order recalculates immediately. For event listeners, see Retrieve conversation list.
Was this page helpful?