SDKsHarmonyOSEnterprise
Create forward message
Create a forwardable message from an existing single message.
Creates a new message object suitable for forwarding an existing message to another conversation.
Code example
import sdk, { CreateForwardMessageReq, CreateForwardMessageResp } from '@openimsdk/imsdk';
const request: CreateForwardMessageReq = { message: sourceMessage };
const response: CreateForwardMessageResp = await sdk.createForwardMessage(request);
const message = response.message;Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
message | IMMessage | Yes | Existing message to be forwarded. |
Return value
Returns a Promise resolving to CreateForwardMessageResp:
| Property | Type | Description |
|---|---|---|
message | IMMessage | Locally instantiated forward message object. |
State changes after the call
The source message should originate from query results or message events and must have already been sent successfully. Verify that the user has authorization to distribute the content before forwarding. Local file paths, expired asset URLs, and device-local extensions cannot be assumed valid in destination conversations. This operation creates the message object locally without altering the original message or picking destination targets; call Send message to dispatch it to a direct or group chat.
Was this page helpful?