SDKsuni-app
Pin or unpin a conversation
OpenIM uni-app / uni-app x SDK guide for Pin or unpin a conversation.
Use setConversation() to pin or unpin one conversation. Pass only the field being changed.
import { setConversation } from '@/uni_modules/unix-openim-sdk'
await setConversation({ conversationID, isPinned: true })
// Unpin the conversation.
await setConversation({ conversationID, isPinned: false })Promise success means that the update request completed. Apply the final onConversationChanged snapshot before deriving list order, rather than assuming the Promise defines final sorting. Omitted fields retain their values; do not copy and write a complete conversation merely to update the pin state.
The list store should merge by conversationID, then sort pinned conversations with the product's stable ordering rule. Concurrent changes from another device are reconciled by the event or a new query.
Was this page helpful?