ConvInfo information of each conversation and add the conv_unread_num values of all the ConvInfo objects to get the final result and display it on the UI.ConvGetTotalUnreadMessageCount API to query the total unread count of all the conversations.
When the total unread count changes, the SDK will notify you of the latest total unread count through the SetConvTotalUnreadMessageCountChangedCallback callback.ConvGetTotalUnreadMessageCount (Details) to get the total unread count of all the conversations and update it on the UI.// Get the total unread countTIMResult res = TencentIMSDK.ConvGetTotalUnreadMessageCount((int code, string desc, GetTotalUnreadNumberResult unread, string user_data)=>{// Process the async logic});
SetConvTotalUnreadMessageCountChangedCallback (Details) to add a conversation listener to receive notifications of a change in the total unread count.TencentIMSDK.SetConvTotalUnreadMessageCountChangedCallback((int total_unread_count, string user_data)=>{// Process the callback logic});
MsgReportReaded is used to clear the unread count of a one-to-one conversation.MsgSendMessageReadReceipts is used to clear the unread count of a group conversation.MsgMarkAllMessageAsRead is used to clear the unread count of all the conversations.// `message` can be set to `null`. In that case, the timestamp of the latest message (if any) in the conversation or the current time is used as the read timestamp for reporting. If a message needs to be specified, the timestamp of this specified message is used as the read timestamp for reporting. We recommend you use the message JSON content in the message array obtained from the received new message or the message JSON content located by the message locator; otherwise, repeated message JSON content will be constructed.TIMResult res = TencentIMSDK.MsgReportReaded(conv_id, TIMConvType TIMConvType.kTIMConv_C2C, null, (int code, string desc, string user_data)=>{// Process the async logic});
MsgReportReaded is called successfully:SetConvEventCallback to add a conversation listener, it will receive the ConvEventCallback callback and update the UI.MsgReadedReceiptCallback callback that contains the timestamp when the conversation unread count is cleared.MsgSendMessageReadReceipts (Details) to clear the unread count of a specified group conversation.TIMResult res = TencentIMSDK.MsgSendMessageReadReceipts(msg_array, (int code, string desc, string user_data)=>{// Process the async logic});
MsgReportReaded is called successfully:SetConvEventCallback to add a conversation listener, it will receive the ConvEventCallback callback and update the UI.MsgReadedReceiptCallback callback that contains the timestamp when the conversation unread count is cleared.TIMResult res = TencentIMSDK.MsgMarkAllMessageAsRead((int code, string desc, string user_data)=>{// Process the async logic});
MsgMarkAllMessageAsRead is called successfully, if the caller has called SetConvEventCallback to add a conversation listener, it will receive the ConvEventCallback callback and update the UI.TencentIMSDK.SetConvEventCallback((TIMConvEvent conv_event, List<ConvInfo> conv_list, string user_data)=>{// Process the callback logic});
Feedback