SDKsReact Native
Create an @ message
OpenIM React Native SDK guide for create an @ message.
Use createTextAtMessage() to create a mention message in a group chat. The mentions in text must correspond to atUserIDList.
const message = await OpenIMSDK.createTextAtMessage({
text: '@user-001 Please confirm the release content.',
atUserIDList: ['user-001'],
atUsersInfo: [
{
atUserID: 'user-001',
groupNickname: 'Lee',
},
],
});Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
text | string | Yes | Body text of the mention message. |
atUserIDList | string[] | Yes | User IDs of the mentioned members. |
atUsersInfo | AtUsersInfoItem[] | No | Display names of mentioned members in the group. |
message | MessageItem | No | An attached message object. |
The call returns a MessageItem ready to send. Pass it as message to Send a message.
Was this page helpful?