pinConversation
Introduction
Pin a specific conversation to the top of the conversation list.
The default order of conversation is sorts by orderKey
, this parameter is int, and will be increased by the time of sending and receiving messages, setting draft for conversation,etc.
The pinned conversations will be front of the unpinned conversations, while the sequence of those pinned conversations will be sorted by orderKey
.
Pinned conversations will be returned as priority when requesting conversation list with getConversationList.
You can check whether a conversation be pinned by isPinned
in V2TimConversation.
You can also get the changing of conversation and isPinned
, after adding a conversation listener by addConversationListener, from onConversationChanged
method invokes, to update the rendering list on UI.
Parameter details
Parameter name | Parameter type | Required | Platform | Description |
---|---|---|---|---|
conversationID | String | yes | All | The ID of the conversation needs to operate. |
isPinned | bool | yes | All | Is needs to be pinned to top. |
Returned template
V2TimCallback
{
code : int
desc : String
}
Return value details
name | type | description |
---|---|---|
code | int | Request result: Error codes. 0 means success. |
desc | String | The description of the error. It will be empty if success. |
Code example
V2TimCallback pinConversationRes = await TencentImSDKPlugin.v2TIMManager
.getConversationManager()
.pinConversation(
conversationID: "",
isPinned: true);
if (pinConversationRes.code == 0) {
}