Create a merged message
Create a merged forward message card with the OpenIM Flutter SDK.
Package multiple messages into a merged-forward card message ready for delivery:
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
messageList | List<Message> | Yes | List of message objects to merge and forward (must be valid, previously delivered messages). |
title | String | Yes | Title displayed on the merged message card (for example, "Group Chat History"). |
summaryList | List<String> | Yes | List of preview summary strings displayed on the card in conversation views. |
Code example
final message = await OpenIM.iMManager.messageManager.createMergerMessage(
messageList: selectedMessages,
title: 'Chat history',
summaryList: summaries,
);Messages to merge should come from authentic conversation records. We recommend extracting 2 to 4 summary strings in chronological message order.
Return value
Returns a Future resolving to a merged Message object ready for transmission. Its merged data is stored in mergeElem.
The SDK assigns a fresh client message identifier clientMsgID to the merged message card; original messages remain completely unchanged.
State changes after the call
Creating a message only constructs the local message data structure in memory; it does not perform network transmission and does not trigger new-message event callbacks. Once constructed, pass the returned Message instance to Send a message to deliver it to a direct or group conversation.
Was this page helpful?