Skip to main content

Forward messages

Chat UI SDK supports forwarding a single message or multiple messages through individual forwarding or combined forwarding. Users can forward messages to other channels from the chat page. Forwarded messages appear in the message list component on the target channel page.

tip

Chat UI SDK disables combined forwarding by default. You can enable combined forwarding as needed.

Limitations

  • Not all message types support combined forwarding.
    • Supported message types: text, image, rich text, GIF, sticker (RC:StkMsg), contact card, location, short video, file, voice, high-quality voice, audio/video call summary (RC:VCSummary).
    • Unsupported cases: message types not in the supported list (such as reference messages), messages that failed to send, and other special cases. Custom messages do not support combined forwarding.
  • Combined forwarding supports merging up to 100 messages.

Usage

The Chat UI SDK channel page enables message forwarding by default. Users can long-press a message on the channel page and select More in the popup to display forwarding options.

  • Individual forwarding: Enabled by default. Forwards single or multiple messages to the target channel individually.
  • Combined forwarding: Disabled by default and not displayed. When combined forwarding is used, the SDK merges selected messages into a single combined message containing a CombineMessage content object (type identifier: RC:CombineMsg). Combined forwarded messages are collapsed by default and can be expanded by tapping.

Enable combined forwarding

Chat UI SDK supports combined forwarding, but this feature is disabled by default. You can modify the global configuration to enable combined forwarding.

Java
NCChatUIConfig.channelConfig().NC_enable_send_combine_message = true;

To modify the Chat UI SDK default configuration through XML resources, create an nc_config.xml file in your application's res/values directory and add the following configuration:

xml
<bool name="nc_enable_send_combine_message">true</bool>

Customization

Modify the forwarding message limit

The forwarding message limit is controlled by the multi-select message feature. Chat UI SDK implements multi-select capability by default. You can modify the multi-select message limit. For details, see Channel page. Note that combined forwarding supports merging up to 100 messages, and this limit cannot be increased through configuration.

After selecting individual forwarding or combined forwarding in Chat UI SDK, the default page displays the recent channel list stored locally by the SDK.

To navigate to a custom page when selecting channels for forwarding, register your custom Activity with the SDK by calling the following method in the built-in router RouteUtils.

Configure before entering the channel page:

Java
// This example uses a custom page named MyForwardSelectActivity.
RouteUtils.registerActivity(RouteUtils.ChatUIActivityType.ForwardSelectChannelActivity, MyForwardSelectActivity.class);

Disable message forwarding

To disable message forwarding, hide the More option in the long-press message popup. For details, see Channel page.

Message forwarding menu