Pin or unpin a conversation
Pin or unpin a conversation at the top of the conversation list for the authenticated user.
Pin or unpin a conversation in the authenticated user's conversation list. Pinned conversations remain anchored at the top of the list view.
Code example
OpenIMClient.getInstance().conversationManager.pinConversation(
new OnBase<String>() {
@Override
public void onSuccess(String data) {
// Pin request succeeded.
}
@Override
public void onError(int code, String error) {
// code and error describe the failure.
}
},
conversationID,
true
);Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
base | OnBase<String> | Yes | Callback delivering the asynchronous operation result. |
conversationID | String | Yes | Target conversation identifier. |
isPinned | boolean | Yes | Set to true to pin the conversation, or false to unpin it. |
Return value
The successful callback indicates that the server recorded the updated pinning status. Pinning affects only the authenticated user's view and does not modify the conversation layout for peer users or group members.
State changes after the call
Once the call succeeds, the SDK dispatches the OnConversationListener.onConversationChanged event. When your listener receives this event, locate the matching local conversation by conversationID, update its isPinned flag, and re-sort the conversation list. For complete listener registration details, see Get the conversation list.
Was this page helpful?