Skip to main content

Mentions (@ Messages)

Feature Description

Developers can send @ messages in group conversations to notify all group members or specific users.

Type Description

@ Message Class: RCIMIWMentionedInfo

Property Description:

Property NameTypeDescription
typeRCIMIWMentionedTypeThe type of @ mention
userIdListList<String>List of user IDs to be mentioned
mentionedContentStringContent displayed in local and remote push notifications for messages containing @ mentions

Code Example

// 1. Create a message
RCIMIWTextMessage? textMessage = await engine.createTextMessage(
conversationType,
targetId,
channelId,
text,
);
// 2. Create @ mention configuration
RCIMIWMentionedInfo mentionedInfo = RCIMIWMentionedInfo.create(
type: mentionedType,
userIdList: users,
mentionedContent: 'Content displayed in local and remote push notifications for messages containing @ mentions',
);
// 3. Set the created @ mention configuration to the message
textMessage.mentionedInfo = mentionedInfo;
// 4. Send the message
int code = await engine?.sendMessage(textMessage) ?? -1;