ConvGetConvList
API (details) to get the conversation list. This API pulls locally cached conversations. If any server conversation is updated, the SDK will automatically sync the update and notify you in the TIMConvEventCallback
callback.ConvInfo
objects.TIMResult res = TencentIMSDK.ConvGetConvList((int code, string desc, List<ConvInfo> info_list, string user_data)=>{// Process the async logic});
SetConvEventCallback
API (details) to add a conversation listener to receive conversation change events.TencentIMSDK.SetConvEventCallback((TIMConvEvent conv_event, List<ConvInfo> conv_list, string user_data)=>{// Process the callback logic});
TIMConvEvent
(details) to get the notification of a conversation list change.Event | Description | Suggestion |
kTIMConvEvent_Add | A new conversation was added. | Re-sort the conversations when the user receives a one-to-one message from a new colleague or is invited to a new group. |
kTIMConvEvent_Del | A conversation was deleted. | Trigger this event when the user deletes a conversation. |
kTIMConvEvent_Update | A conversation was updated. | Trigger this event when the unread count of a conversation changes or a new message is received. |
kTIMConvEvent_Start | A conversation was started. | - |
kTIMConvEvent_Finish | A conversation was ended. | - |
RemoveConvEventCallback
API (details) to remove a specified conversation listener to stop receiving conversation change events. If null
is passed in, all conversation listeners will be removed.
This step is optional and can be performed as needed.TencentIMSDK.RemoveConvEventCallback();
conv_last_msg
of ConvInfo
as the data source for implementation. However, in some cases, if you don't want some messages (such as system tips) to be displayed as the latest message in a conversation, you can set message_excluded_from_last_message
to false
/no
when calling MsgSendMessage
.
Was this page helpful?