setConversationToTop

public abstract void setConversationToTop(ConversationType conversationType, String id, boolean isTop, RongIMClient.ResultCallback<Boolean> callback)

Sets the pinned status of a conversation.

Pinning a conversation: Places this conversation at the top of the conversation list (when multiple conversations are pinned, they are sorted by the time they were pinned, with the earliest pinned conversation appearing first). Example: If conversations A, B, and C are pinned in sequence, the order will be A, B, C. If a conversation does not exist when pinned, it will be created in the conversation list; if a pinned conversation is deleted, the pinned status will be automatically removed.

Parameters

conversationType

The type of conversation Conversation.ConversationType.

id

The conversation ID. Depending on the conversationType, this could be a user ID, discussion group ID, group ID, or chatroom ID.

isTop

Whether to pin the conversation.

callback

Callback indicating whether the pinning operation was successful.


public abstract void setConversationToTop(ConversationType conversationType, String id, boolean isTop, boolean needCreate, RongIMClient.ResultCallback<Boolean> callback)

Sets the pinned status of a conversation.

If the conversation does not exist, the SDK will automatically create it and pin it.

Parameters

conversationType

The type of conversation Conversation.ConversationType.

id

The conversation ID. Depending on the conversationType, this could be a user ID, discussion group ID, group ID, or chatroom ID.

isTop

Whether to pin the conversation.

needCreate

Whether to create the conversation if it does not exist.

callback

Callback to indicate whether the pinning was successful.