getConversation

Introduction

Load the specific conversation.

A locally stored conversation list can have unlimited number of conversations. A conversation list stored in the cloud can have up to 100 conversations.

If the information of a conversation has not been updated for a long time, this conversation can be stored in the cloud for at most 7 days. To adjust the period for storing the conversation, contact us.

Locally stored conversations may not always be consistent with those stored in the cloud. If you do not call the deleteConversation API to delete the local conversations, these conversations will always exist. However, at most 100 conversations can be stored in the cloud. In addition, if the information of a conversation has not been updated for a long time, this conversation can be stored in the cloud for at most 7 days. Therefore, local conversations displayed on different mobile phones may be inconsistent with each other.

Parameter details

Parameter name Parameter type Required Platform Description
conversationID String yes All The unique identifier of a conversation, it will be format in "c2c_${userId}" or "${groupID}".

Returned template

V2TimValueCallback<V2TimConversation>

{
    code : int
    desc : String
    data : {
      conversationID : String
      type : ConversationType
      userID : String
      groupID : String
      showName : String
      faceUrl : String
      groupType : String
      unreadCount : int
      lastMessage;
      draftText : String
      draftTimestamp : int
      isPinned : bool
      recvOpt : int
      groupAtInfoList : List<V2TimGroupAtInfo>
      orderkey : int
    }
}

Return value details

name type description
code int Request result: Error codes. 0 means success.
desc String The description of the error. It will be empty if success.
data V2TimConversation The conversation obtained.

Code example

    V2TimValueCallback<V2TimConversation> getConversationtRes =
        await TencentImSDKPlugin.v2TIMManager
            .getConversationManager()
            .getConversation(conversationID: "");
    if (getConversationtRes.code == 0) {
       getConversationtRes.data?.conversationID;
       getConversationtRes.data?.draftText;
       getConversationtRes.data?.draftTimestamp;
       getConversationtRes.data?.faceUrl;
       getConversationtRes.data?.groupAtInfoList;
       getConversationtRes.data?.groupID;
       getConversationtRes.data?.groupType;
       getConversationtRes.data?.isPinned;
       getConversationtRes.data?.lastMessage;
       getConversationtRes.data?.orderkey;
       getConversationtRes.data?.recvOpt;
       getConversationtRes.data?.showName;
       getConversationtRes.data?.type;
       getConversationtRes.data?.unreadCount;
       getConversationtRes.data?.userID;
    }

results matching ""

    No results matching ""