Mention in Messages
The mention feature in chat can be used to call attention to specific members. By @mentioning their names, this will promptly notify them so you can get a faster response to your message. Mention is only supported on TEXT
message type.
Mention is supported in these channel types:
Community
Live
Mention is not supported in the Conversation channel type.
Create a message with mentions
There are 2 types of mentions:
USER
- When using mention of this type, a specific member being mentioned will receive a push notification. Up to 30 channel members can be mentioned per message.CHANNEL
- When using mention of this type, all channel members will receive push notification.
Mentioning banned users
Banned users cannot be mentioned. However, admins can still find the banned users' names in the suggestion list during search when composing the message. But once the message is sent, the banned users’ information will not be included in the message payload anymore.
Banned users will not be notified nor receive any push notification.
Users who are not admins will not be able to search for the banned users' names as the latter will not appear in the suggestion list.
Update mentions for a text message
Search members
To search members when mentioning, you must use AmityChannelParticipation’s searchMembers function:
Viewing mentions
SDK only sends push notifications according to mention input during message creation. The system doesn't handle any data related to UI rendering. However, AmityMessage has a property called metadata which can hold an object and will not be tampered by the system. So, it can be utilized as a storage for UI-related data.
UI helper
SDK provides a helper which helps in generating a metadata containing sufficient data to highlight text with indices.
Mention notifications
When users are being mentioned, they will receive push notifications. You can customize the push notification content such as the title and the body using the notification setting API.
Provide the notification title and body in the titleTemplate
and bodyTemplate
parameters respectively. Here is a sample model:
Name | Data Type | Description |
---|---|---|
|
| Event name |
|
| If set to |
|
| Notification title |
|
| Notification body |
Last updated