createMergerMessage
Introduction
Create a merged message for forwarding.
You can merge and forward messages as provided by WeChat in the following steps:
Create a merged message based on the list of original messages.
Send the merged message to the receiver.
The receiver receives the merged message and parses the list of original messages.
For details, you can referring to this document.
Parameter details
Parameter name | Parameter type | Required | Platform | Description |
---|---|---|---|---|
msgIDList | List< String > | yes | All | List of IDs of original messages to be merged and forwarded |
title | String | yes | All | Title of the merged message, such as "Chat History of Trump and Biden" as shown above |
abstractList | List< String > | yes | All | The abstract list of the merged message as shown above. The original message digests need to be displayed for the merged message, which will be unfolded after the user clicks the cell. |
compatibleText | String | yes | All | If the early SDK version does not support the merged message, the user will receive a text message with the content compatibleText by default. |
Returned template
V2TimValueCallback<V2TimMsgCreateInfoResult>
{
code: int,
desc: String,
data: {
id: String,
messageInfo: V2TimMessage,
}
}
Return value details
name | type | description |
---|---|---|
code | int | Request result: Error codes. 0 means success. |
desc | String | The description of the failure. |
data | V2TimMsgCreateInfoResult | The merged message created. |
Code example
V2TimValueCallback<V2TimMsgCreateInfoResult> createMergerMessageResult =
await TencentImSDKPlugin.v2TIMManager
.getMessageManager()
.createMergerMessage(
msgIDList: ["msgid1", "msgid2"],
title: "The conversation between user A and User B.",
abstractList: ["user1:hello", "user2:你好"],
compatibleText:
"Do not support this message.",
);
if (createMergerMessageResult.code == 0) {
TencentImSDKPlugin.v2TIMManager.getMessageManager().sendMessage(
id: createMergerMessageResult.data!.id!,
receiver: "receiver",
groupID: "groupID",
);
}