TIMConvCleanConversationUnreadMessageCount
Introduction
Clean Conversation unread message count
When you want to clear the unread message counts of all single-chat sessions, please pass in "c2c" for conversation_id, that is, do not specify a specific userID
When you want to clear the unread message counts of all group chat sessions, please pass in "group" for conversation_id, that is, do not specify a specific groupID
When you want to clear the unread message count of all conversations, please pass in "" or null for conversation_id
After the interface is successfully called, the SDK will notify you of the latest unread count of the corresponding conversation through the onConversationChanged callback
Parameter details
Parameter name | Parameter type | Required | Description |
---|---|---|---|
CleanUnreadMessageCoutParam | CleanUnreadMessageCoutParam | yes | Clean Conversation unread message count |
Returned template
Promise<commonResult<Array<TIMConversationOperationResult>>>
{
code: TIMResult | TIMErrCode;
desc?: string | undefined;
json_param?: Array<TIMConversationOperationResult> | undefined;
json_params?: Array<TIMConversationOperationResult> | undefined;
user_data?: string | undefined;
}
Return value details
name | type | description |
---|---|---|
code | TIMResult | TIMErrCode | Request result: Error codes. 0 means success. |
desc | string | undefined | The description of the error. It will be empty if success. |
json_param | Array< TIMConversationOperationResult > | undefined | Return value of calling API |
json_params | Array< TIMConversationOperationResult > | undefined | Return value of calling API. Compatible field, which is returned in some cases. |
user_data | string | undefined | ImSDK is responsible for transporting user-defined data without any processing |
Code example
import TimRender from "im_electron_sdk/dist/renderer";
const timRenderInstance = new TimRender();
let param :CleanUnreadMessageCoutParam = {
conversation_id: "c2c_test",
clean_timestamp: 0,
clean_sequence: 0
}
timRenderInstance.TIMConvCleanConversationUnreadMessageCount(param)