Skip to main content

Conversation Overview

A conversation refers to the logical relationship automatically established and maintained by RC SDK based on information such as the sender, recipient, and conversation type of each message. It is an abstract concept.

Conversation Types

RC supports multiple conversation types to meet different business scenario requirements. The client SDK uses the RCConversationType enumeration to represent various conversation types. The meanings of each enumeration value are shown in the following table:

Enumeration ValueConversation Type
ConversationType_PRIVATEOne-to-One Chat
ConversationType_GROUPGroup Chat
ConversationType_ULTRAGROUPUltra Group Chat
ConversationType_CHATROOMChatroom
ConversationType_SYSTEMSystem Conversation

The RCConversationType enumeration also defines other conversation types, which are currently deprecated and no longer maintained.

One-to-One Chat

Refers to one-on-one communication between two users, who may be friends or strangers. RC does not maintain user relationships, but establishes and maintains the conversation relationship.

Messages in one-to-one conversations are stored in the client's local database.

Group Chat

A group chat involves communication among more than two users. Group member information is provided and maintained by the App, while RC is only responsible for delivering messages to all group members. Each group has a maximum capacity of 3,000 members, with no limit on the number of groups within an App.

Messages in group conversations are stored in the client's local database.

Ultra Group Chat

Ultra group chat refers to a multi-person chat service with no member limit, supporting massive concurrent message delivery and push notification services. Group member information is provided and maintained by the App, while RC delivers messages to group members. There is no limit on the number of ultra groups in an App, and ultra groups have no member limit. A user can join up to 100 ultra groups.

Messages in ultra group conversations are stored in the client's local database. For more details, see Ultra Group Overview.

Chatroom

Chatrooms have no user limit, supporting massive concurrent message delivery. Users who leave a chatroom will no longer receive any messages from it, and there is no push notification functionality. RC establishes and maintains the conversation relationship, and users can join or leave chatrooms through relevant SDK interfaces.

The SDK does not store chatroom messages. All data is cleared when leaving a chatroom. For more details, see Chatroom Overview.

System Conversation

System conversations are established when system accounts send messages to users. This type of conversation can be created either by calling the broadcast interface to send broadcasts or through single notification messages such as friend requests.

Conversation Entity Class

The conversation entity class encapsulated in the client SDK is RCConversation, from which all conversation-related information can be obtained.

The following table lists the main properties provided by RCConversation.

PropertyTypeDescription
targetIdNSStringConversation ID (or Target ID), used to identify the conversation counterpart.
  • For one-to-one chats, the conversation ID directly uses the other user's ID.
  • For groups, chatrooms, and ultra groups, it corresponds to the respective group, chatroom, or ultra group ID.
  • For system conversations, it uses the system account ID specified by the developer.
channelIdNSStringBusiness identifier for the conversation, with a length limit of 20 characters. Only applicable to ultra groups.
conversationTitleNSStringConversation title.
conversationTypeRCConversationTypeConversation type, as described in detail above.
unreadMessageCountIntNumber of unread messages in the conversation.
isTopBOOLWhether the conversation is pinned.
latestMessageRCMessageContentThe content of the last message stored locally in the client for this conversation. For details about message storage properties, refer to the description in Message Introduction.
latestMessageIdlongThe ID of the last message stored locally in the client for this conversation.
draftNSStringDraft information saved in the conversation. Refer to Draft Details.
objectNameNSStringThe type name of the last message in the conversation, corresponding to the message content body. The objectName for predefined message types is listed in Message Type Overview. For custom message types, the ObjectName is the value you specify.
receivedTimelong longThe receive time of the last message in the conversation.
1. The value is a Unix timestamp in milliseconds.
2. The receive time is the local time on the client when the message reaches the recipient.
sentTimelong longThe send time of the last message in the conversation, as a Unix timestamp in milliseconds.
1. When the last message in the conversation is a successfully sent or received message, this method returns the time the message reached the RC server.
2. When the last message is a failed message, this method returns the local send time of the message.
3. When the conversation has draft information and the draft save time is later than the last message time, this method returns the draft save time.
operationTimelong longThe operation time of the conversation (Unix timestamp, milliseconds), used as the timestamp when paginating the conversation list. Initially, it is the same as sentTime, but operations like pinning will update this timestamp.
receivedStatusRCReceivedStatusThe receive status of the last message in the conversation.
sentStatusRCSentStatusThe send status of the last message in the conversation.
senderUserIdNSStringThe sender ID of the last message in the conversation.
latestMessageDirectionRCMessageDirectionThe direction of the last message in the conversation, either sent or received.
latestMessageUIdNSStringThe unique ID of the last message in the conversation.
1. Only successfully sent messages have a unique ID.
2. The ID is globally unique under the same AppKey.
latestMessageReadReceiptInfoRCReadReceiptInfoThe read receipt status of the last message in the conversation, applicable only to group chats.
latestMessageMessageConfigRCMessageConfigThe configuration information of the last message in the conversation.
latestMessageCanIncludeExpansionBOOLWhether the last message in the conversation can include extended information.
1. This property is determined when the message is sent and cannot be modified afterward.
2. Extended information is only supported for one-to-one chats, groups, and ultra groups; other conversation types cannot set extended information.
latestExpansionNSDictionaryThe extended information list of the last message in the conversation. For details, refer to Message Extension.
hasUnreadMentionedBOOLWhether there are unread @ messages in the conversation.
mentionedCountintThe number of messages in this conversation where you were @ mentioned.
blockStatusRCConversationNotificationStatusThe Do Not Disturb status of the conversation.
notificationLevelRCPushNotificationLevelThe Do Not Disturb level of the conversation. For details, see Do Not Disturb Overview.
channelTypeRCUltraGroupChannelTypeThe ultra group channel type. This field is valid only when ConversationType is ultra group; it is 0 for non-ultra groups.
firstUnreadMsgSendTimelong longStarting from version 5.2.5, this property supports the send time of the first unread message in the conversation, as a Unix timestamp in milliseconds. Only supported for ultra group conversations.