Skip to main content

Unread Message Count

The unread message count is a feature provided by default in Global IM UIKit, which informs users of the number of unread messages in each conversation. The unread message count is displayed in the RCChatCell of the RCChatListViewController class. The number of unread messages for each conversation is shown in the top-right corner of the conversation icon. If the number of unread messages exceeds 100, it will be displayed as 99+.

tip

To use the unread message count feature, you must first build the conversation list page. Global IM UIKit does not implement the display of unread message counts in the Tab Bar by default.

(width=250)

Usage

Global IM UIKit has already implemented a complete set of logic for obtaining and displaying unread message counts by default. When using the default conversation list and conversation pages, there is no need to call additional conversation-related APIs.

Global IM UIKit will reset the unread message count when a user enters a one-to-one chat, group chat, or system conversation page. In the case of multi-device login, Global IM UIKit will synchronize the conversation's read status across devices. You can also choose to disable this feature based on business requirements, as detailed in the section below Synchronizing Read Status Across Devices.

Customization

If the existing implementation in Global IM UIKit does not meet your needs, you can use the relevant APIs in Global IM UIKit or IMLib SDK.

Clearing Unread Message Count

Global IM UIKit does not directly provide APIs for obtaining or clearing unread message counts. If you have custom requirements, you can call the relevant methods in the IMLib SDK. For example:

  • Get the unread message count for all conversations
  • Get the unread message count by conversation type
  • Clear the unread message count for a single conversation

For specific core classes, APIs, and usage methods, refer to the IMLib documentation Handling Unread Message Counts.

tip

The methods in IMLib do not provide page refresh capabilities. You will need to customize the notification mechanism for page refreshes based on your business requirements.

Unread Message Bubble Reminder

Global IM UIKit supports displaying unread message bubble reminders in the conversation page (RCChatViewController).

(width=250)