Skip to main content

Message Forwarding

IMKit supports forwarding single messages, as well as sequential forwarding/combined forwarding of multiple messages, allowing users to forward messages from a chat UI to other conversations. Forwarded messages will appear in the message list component of the target conversation's chat UI.

tip

The combined forwarding feature is disabled by default in IMKit. You can enable it as needed.

(width=220) alt(width=220) alt(width=220)

Limitations

  • Not all message types support combined forwarding.
    • Supported message types: text, image, image-text, GIF, animated stickers (RC:StkMsg), business card, location, short video, file, standard voice, HD voice, and RTC call summary (RC:VCSummary).
    • Unsupported cases: Message types not listed above (e.g., quoted messages) and special cases like unsent messages cannot be forwarded. Custom messages do not support combined forwarding.
  • Combined forwarding supports merging up to 100 messages.

Usage

The forwarding feature is enabled by default in IMKit conversation pages. Users can long-press a message in the conversation UI, select More from the pop-up menu to display forwarding options.

  • Sequential Forwarding: Enabled by default. Allows forwarding one-to-one or multiple messages to target conversations.
  • Combined Forwarding: Disabled by default (hidden). When enabled, the SDK merges selected messages into a single combined message containing a CombineMessage object (type identifier: RC:CombineMsg). Combined messages are displayed collapsed by default and can be expanded with a tap.

Enabling Combined Forwarding

IMKit supports combined forwarding, which is disabled by default. You can modify global configurations to enable this feature.

RongConfigCenter.conversationConfig().rc_enable_send_combine_message = true;

To configure via XML resources, create an rc_config.xml file in your app's res/values directory and add:

<bool name="rc_enable_send_combine_message">true</bool>

Customization

Modifying Forwarding Quantity Limits

The number of forwarded messages depends on multi-selection functionality. IMKit implements message multi-selection by default. You can adjust the upper limit for selected messages. For details, refer to Conversation Page. Note: Combined forwarding supports a maximum of 100 messages; this limit cannot be increased via configuration.

Redirecting to Custom Forwarding Lists

After selecting sequential or combined forwarding in IMKit, the SDK defaults to navigating to a locally stored recent conversation list.

If your app requires redirection to a custom Activity during forwarding, register your custom page with the SDK using the built-in RouteUtils:

Configure before entering the conversation UI:

// Example using MyForwardSelectActivity as the custom page.
RouteUtils.registerActivity(RouteUtils.RongActivityType.ForwardSelectConversationActivity, MyForwardSelectActivity.class);

Disabling Forwarding

To disable forwarding entirely, hide the More option in the long-press menu. For implementation, see Conversation Page.

multi-01-v5(height=500)