SDKsHarmonyOSEnterprise
Create merge forward message
Combine multiple existing messages into a single merged forward message.
Consolidates multiple chat messages into a single forwardable chat record card.
Code example
import sdk, { CreateMergerMessageReq, CreateMergerMessageResp } from '@openimsdk/imsdk';
const request: CreateMergerMessageReq = {
messages: selectedMessages,
title: 'Project Discussion History',
summaries: ['Alex: Please confirm deployment time', 'Morgan: Scheduled for Friday release'],
};
const response: CreateMergerMessageResp = await sdk.createMergerMessage(request);
const message = response.message;Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
messages | IMMessage[] | Yes | Array of messages to include in the merged record. |
title | string | Yes | Title displayed at the top of the merged record card. |
summaries | string[] | Yes | Array of summary preview strings shown on the message bubble. |
Return value
Returns a Promise resolving to CreateMergerMessageResp:
| Property | Type | Description |
|---|---|---|
message | IMMessage | Locally instantiated merged message object. |
State changes after the call
The sequence of messages defines the order presented in the expanded chat history viewer. summaries must be formatted by the application layer; the SDK does not automatically generate summaries. This operation instantiates the IMMessage locally; call Send message to dispatch it.
Was this page helpful?