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 Value | Conversation Type |
|---|---|
| ConversationType_PRIVATE | One-to-One Chat |
| ConversationType_GROUP | Group Chat |
| ConversationType_ULTRAGROUP | Ultra Group Chat |
| ConversationType_CHATROOM | Chatroom |
| ConversationType_SYSTEM | System 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.
| Property | Type | Description |
|---|---|---|
| targetId | NSString | Conversation ID (or Target ID), used to identify the conversation counterpart.
|
| channelId | NSString | Business identifier for the conversation, with a length limit of 20 characters. Only applicable to ultra groups. |
| conversationTitle | NSString | Conversation title. |
| conversationType | RCConversationType | Conversation type, as described in detail above. |
| unreadMessageCount | Int | Number of unread messages in the conversation. |
| isTop | BOOL | Whether the conversation is pinned. |
| latestMessage | RCMessageContent | The 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. |
| latestMessageId | long | The ID of the last message stored locally in the client for this conversation. |
| draft | NSString | Draft information saved in the conversation. Refer to Draft Details. |
| objectName | NSString | The 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. |
| receivedTime | long long | The 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. |
| sentTime | long long | The 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. |
| operationTime | long long | The 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. |
| receivedStatus | RCReceivedStatus | The receive status of the last message in the conversation. |
| sentStatus | RCSentStatus | The send status of the last message in the conversation. |
| senderUserId | NSString | The sender ID of the last message in the conversation. |
| latestMessageDirection | RCMessageDirection | The direction of the last message in the conversation, either sent or received. |
| latestMessageUId | NSString | The 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. |
| latestMessageReadReceiptInfo | RCReadReceiptInfo | The read receipt status of the last message in the conversation, applicable only to group chats. |
| latestMessageMessageConfig | RCMessageConfig | The configuration information of the last message in the conversation. |
| latestMessageCanIncludeExpansion | BOOL | Whether 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. |
| latestExpansion | NSDictionary | The extended information list of the last message in the conversation. For details, refer to Message Extension. |
| hasUnreadMentioned | BOOL | Whether there are unread @ messages in the conversation. |
| mentionedCount | int | The number of messages in this conversation where you were @ mentioned. |
| blockStatus | RCConversationNotificationStatus | The Do Not Disturb status of the conversation. |
| notificationLevel | RCPushNotificationLevel | The Do Not Disturb level of the conversation. For details, see Do Not Disturb Overview. |
| channelType | RCUltraGroupChannelType | The ultra group channel type. This field is valid only when ConversationType is ultra group; it is 0 for non-ultra groups. |
| firstUnreadMsgSendTime | long long | Starting 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. |