downloadMergerMessage

Introduction

Download the message instances for merged messages.

For details, you can referring to this document.

Parameter details

Parameter name Parameter type Required Platform Description
msgID String yes All The merged message ID.

Returned template

V2TimValueCallback<List<V2TimMessage>>

{
    code : int
    desc : String
    data : List<V2TimMessage>
}

Return value details

name type description
code int Request result: Error codes. 0 means success.
desc String The description of the failure.
data List< V2TimMessage > The list of original messages instances from merged messages.

Code example

    V2TimAdvancedMsgListener listener = V2TimAdvancedMsgListener(
      onRecvNewMessage: (V2TimMessage message) async {
        if (message.elemType == MessageElemType.V2TIM_ELEM_TYPE_MERGER) {
          message.mergerElem?.abstractList; 
          message.mergerElem?.isLayersOverLimit; 
          message.mergerElem?.title; 
          V2TimValueCallback<List<V2TimMessage>> download =
              await TencentImSDKPlugin.v2TIMManager
                  .getMessageManager()
                  .downloadMergerMessage(
                    msgID: message.msgID!,
                  );
          if (download.code == 0) {
            List<V2TimMessage> messageList = download.data!;
          }
        }
      },
    );
    TencentImSDKPlugin.v2TIMManager
        .getMessageManager()
        .addAdvancedMsgListener(listener: listener);
    V2TimValueCallback<V2TimMsgCreateInfoResult> createMergerMessageResult =
        await TencentImSDKPlugin.v2TIMManager
            .getMessageManager()
            .createMergerMessage(
              msgIDList: [
                "msgid1",
                "msgid2"
              ], 
              title: "The conversation between User A and B.", 
              abstractList: ["User A: Hi", "User B: Hello"], 
              compatibleText:
                  "Do not support this message.", 
            );
    if (createMergerMessageResult.code == 0) {
      TencentImSDKPlugin.v2TIMManager.getMessageManager().sendMessage(
            id: createMergerMessageResult.data!.id!,
            receiver: "receiver",
            groupID: "groupID",
          );
    }

results matching ""

    No results matching ""