Browse SDKs · Android
Platform
SDKsAndroid

Create a forwarded message

Use createForwardMessage to create a forwarded copy of a message.

Copy

Wrap an existing historical message into a new forwarded message object. The SDK clones the original message payload and resets its delivery state to pending, making it ready to forward to another conversation.

Code example

Message message = OpenIMClient.getInstance().messageManager.createForwardMessage(sourceMessage);

Parameters

ParameterTypeRequiredDescription
messageMessageYesThe original historical Message object to forward.

Return value

Returns a new Message object cloned from the source message and prepared for forwarding.

State changes after the call

  1. Local initialization: Initializes the local cloned Message structure without sending data to the server.
  2. Transmission: Call Send a message to forward the message to a new recipient or group. To forward multiple messages as a single bundle, see Create a merged message.