Skip to main content

Message Reference Reply

Global IM UIKit supports the message reference reply feature, allowing users to reply to each other's messages in the chat UI. The referenced reply message will appear in the message list component of the conversation list.

alt(width=250) alt(width=250)

Limitations

The message reference reply feature currently has the following limitations:

  • Only supports referencing text messages, file messages, and image messages.
  • The reference depth is limited to one level, meaning only the original message can be referenced. If multiple references are made, only the content of the previous referenced message will be displayed.

Usage

The message reference reply feature is enabled by default in the Global IM UIKit chat UI. Users can long-press a message in the chat UI, select Reply from the pop-up menu to reference the message. After adding content in the input area, the SDK will automatically combine the input content with the referenced message into an RCReferenceMessage and send it to the conversation.

Customization

Customizing the UI for Application Messages

The SDK generates and sends reference messages (RC:ReferenceMsg) by default, which are displayed in the message list using the RCReferenceMessageCell template.

All message templates in the SDK inherit from RCMessageCell, and custom message cells also need to inherit from RCMessageCell. For more details, see Modifying Message Display Styles.

Customizing the Reference UI in the Input Bar

In the chat UI, the input bar component RCInputBar provides an instance property RCReferenceView. You can customize the reference UI in the input bar by inheritance. Set the custom reference UI when the chat UI is loaded.

- (void)viewDidLoad {
[super viewDidLoad];
// Custom reference UI, RCDReferenceView : RCReferenceView
RCDReferenceView *referenceView = [[RCDReferenceView alloc] init];
self.inputBar.referenceView = referenceView;
}