downloadMergerMessage
功能介绍
获取合并消息的子消息列表(web不支持)
参数详解
参数名称 |
参数类型 |
是否必填 |
描述 |
msgID |
String |
是 |
需要获取的合并消息的 |
返回值
V2TimValueCallback<List<V2TimMessage>>
{
code : int
desc : String
data : List<V2TimMessage>
}
返回值详解
名称 |
数值类型 |
描述 |
code |
int |
请求结果错误码 |
desc |
String |
请求结果描述 |
data |
List< V2TimMessage > |
获取到的合并消息列表 |
代码示例
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: "user1与user2的聊天",
abstractList: ["user1:hello", "user2:你好"],
compatibleText:
"当前版本不支持该消息",
);
if (createMergerMessageResult.code == 0) {
TencentImSDKPlugin.v2TIMManager.getMessageManager().sendMessage(
id: createMergerMessageResult.data!.id!,
receiver: "receiver",
groupID: "groupID",
);
}