Implement user mentions in posts, comments, and messages to boost engagement and enable direct communication within your social application
mentionUsers(userIds)
- In order to mention users and notify specific users. This function supports all mentionable models.
mentionChannel(channelId)
- In order to mention and notify the whole channel. This function supports only a message model.
metadata
- a free-form JSON object that can accommodate any information regarding the mentioned users. Our default structure for representing mentions is also in the metadata property.
Mention Properties
Property | Type | Description |
---|---|---|
type | enum | Always "user" for user mentions |
index | number | Start index of the mention in text |
userId | string | ID of the mentioned user |
length | number | Length of the mention text (excluding ”@” symbol) |
length
property doesn’t include the ”@” symbol. For “@alice”, the length is 5, not 6.mentionUsers
- The AmityUser object array contains details about users mentioned in the current content.
metadata
- a free-form JSON object that can accommodate any information regarding the mentioned users. Our predefined structure for representing mentions is also in the metadata property.
Validation & Data Integrity
User Experience
Performance
Spam Prevention
Security & Privacy
Technical Issues
Mentions not triggering notifications
mentionUsers
array in the parameterMention highlighting not working
Performance issues with mention input
Mention data inconsistency