Browse SDKs · Flutter
Platform
SDKsFlutter

Pin or unpin a conversation

Set the pin state of a specified conversation in the conversation list using the OpenIM Flutter SDK.

Copy

Pin a specified conversation to the top of the conversation list, or unpin it. This pin status takes effect only for the currently signed-in user:

Parameters

ParameterTypeRequiredDescription
conversationIDStringYesTarget conversation ID.
reqConversationReqYesConversation modification request object. Set isPinned to true to pin the conversation, or false to unpin it.

Code example

await OpenIM.iMManager.conversationManager.setConversation(
  conversationID,
  ConversationReq(isPinned: true),
);

Return value

A successful Future indicates that the pin state has been saved on the server. The client uses conversationID as the merge key to update isPinned on the local conversation model and reorder the conversation list.

State changes after the call

Multi-device synchronization or arriving changes trigger conversation change events. For complete event listening, see Retrieve conversation list.