[**RongIMLib**](../README.md) *** [RongIMLib](../globals.md) / getTotalUnreadCount # Function: getTotalUnreadCount() > **getTotalUnreadCount**(`includeMuted?`, `conversationTypes?`): `Promise`\<[`RCResult`](../interfaces/RCResult.md)\<`number`\>\> 获取当前所有会话的消息未读数 ## Parameters ### includeMuted? `boolean` 是否包含免打扰会话 ### conversationTypes? [`ConversationType`](../enumerations/ConversationType.md)[] 要获取未读数的会话类型,若为空,则默认获取单聊、群聊及系统消息未读数 ## Returns `Promise`\<[`RCResult`](../interfaces/RCResult.md)\<`number`\>\> 返回一个 [RCResult](../interfaces/RCResult.md) 类型 Promise,data 中返回会话未读数 ## Description 1. 清除浏览器缓存会导致会话未读数不准确 2. 会话消息未读数存储在 WebStorage 中,若浏览器不支持或禁用 WebStorage,未读消息数将不会保存,浏览器页面刷新未读消息数将不会存在 3. 其他端删除会话可能会导致会话未读数不准确 4. 自 5.20.0 版本开始,在开启了会话列表支持超级群功能后,该接口返回的未读数包含超级群未读数 ## Default Values includeMuted: false ## Example 获取当前所有会话的消息未读数示例: ```ts const totalUnreadCount = await RongIMLib.getTotalUnreadCount(); console.info('获取当前所有会话的消息未读数结果:', totalUnreadCount); ```