please select
  • UIKit
  • SDK
  • Server APIs
Chat/
SDK/
Flutter/
Conversation/
SDK
  • Install Chat SDK
    • Install
  • Initialize Chat SDK
    • Initialize
  • Login And Logout
    • Login and Logout
  • Message
    • Message Overview
    • Sending Message
    • Receiving Message
    • Historical Message
    • Forwarding Message
    • Modifying Message
    • Message Inserting
    • Deleting Message
    • Clearing Messages
    • Recalling Message
    • Online Message
    • Read Receipt
    • Querying Message
    • Group @ Message
    • Targeted Group Message
    • Notification Muting
    • Message Extension
  • Conversation
    • Conversation Overview
    • Conversation List
    • Getting Conversation
    • Conversation Unread Count
    • Pinning Conversation to the Top
    • Deleting Conversation
    • Conversation Draft
    • Conversation Group
  • Group
    • Group Overview
    • Group Management
    • Group Profile
    • Group Member Management
    • Group Member Profile
    • Custom Group Attribute
  • User
    • User Profile
    • Friend Management
    • Friend List
    • Blocklist
  • Offline Push
    • Offline Push
  • Signaling
    • Signaling Management
  • Local Search
    • Searching for Message
    • Searching for Friend
    • Searching Group
    • Searching for Group Member
  • API Reference
    • Client APIs
  • Guideline for Beginners
  • Console Guide
    • Creating and Upgrading an Application
    • Basic Configuration
    • Feature Configuration
    • Account Management
    • Group Management
    • Webhook Configuration
  • Product Introduction
    • Message Management
      • One-to-One Message
      • Message Storage
      • Offline Push
      • Group Message
      • Message Formats
    • Account System
      • Login Authentication
      • Online Status Management
    • Group Related
      • Group System
      • Group Management
    • User Profile and Relationship Chain
      • Profile Management
      • Relationship Chain Management
  • Purchase Guide
    • Billing Overview
    • Pricing
  • Error Codes

Conversation Overview

Conversation

When a user creates a one-to-one or group chat, a conversation will be created. In the Tencent Cloud IM SDK, the conversation class is TencentImSDKPlugin.v2TIMManager.getConversationManager(). You can use the conversation management class APIs to display/update the conversation list, update the unread count, pin a conversation to the top, make a conversation draft, and mute message notifications.

Conversation Class

The conversation class is V2TIMConversation (Details), which defines the following content:
Attribute
Definition
Description
type
Conversation type
See the definition of V2TIMConversationType, which can be C2C or Group.
conversationID
Unique conversation ID
It is in the format of c2c_userID for a one-to-one chat or group_groupID for a group chat.
userID
User ID of the message receiver
userID stores the user ID of the message receiver if the conversation type is one-to-one chat; otherwise, it is nil/null.
groupID
Group ID
groupID stores the group ID if the conversation type is group chat; otherwise, it is nil/null.
groupType
Group type
groupType is the type of the group if the conversation type is group chat; otherwise, it is nil/null.
showName
Displayed conversation name
The name of a group conversation is displayed in the following order of priority: group name > group ID;
The name of a one-to-one conversation is displayed in the following order of priority: friend remarks of the message receiver > nickname of the message receiver > userID of the message receiver.
faceUrl
Displayed conversation profile photo
It is the group profile photo for a group chat or the profile photo of the message receiver for a one-to-one chat.
unreadCount
Unread message count of the conversation
For detailed directions, see unreadCount property. It is invalid and defaults to 0 for an audio-video group (AVChatRoom).
recvOpt
Message receiving option
See the definition of V2TIMReceiveMessageOpt. For detailed directions, see V2TimReceiveMessageOptInfo class.
lastMessage
Last message in the conversation
For detailed directions, see getConversationList metho.
groupAtInfolist
List of @ information in the group conversation
Generally, it is used to display the notifications of "someone@me" and "@all".
draftText
Draft information
The draft information can be set by calling the setConversationDraft API. For detailed directions, see setConversationDraft method.
draftTimestamp
Draft editing time
It is automatically generated when a draft is set.
isPinned
Whether to pin the conversation to the top
For detailed directions, see pinConversation method.
orderKey
Field for sorting conversations
For detailed directions, see getConversationList method.
customData
Conversation's custom data
For detailed directions, see setConversationCustomData method

Conversation Storage Policy

There is no limit on the number of locally stored conversations. Up to 100 conversations can be stored in the cloud. To increase this limit, upgrade to the Ultimate edition. Then you can set the limit to 500 in the console.
Up to 100 conversations can be stored in the cloud. To increase this limit, upgrade to the Ultimate edition. Then you can set the limit to 500 in the console:



If the information of a conversation has not been updated for a long time, the conversation can be stored in the cloud for up to seven days. To extend the conversation storage period, contact us for application.
Locally stored conversations may not always be consistent with those stored in the cloud. If the user does not call the deleteConversation API to delete the local conversations, the conversations will always exist. However, up to 100 conversations can be stored in the cloud, and if the information of a conversation has not been updated for a long time, the conversation can be stored in the cloud for up to seven days. Therefore, local conversations displayed on different terminals may differ.