Message Reaction
Interactions are more fun when you can express yourself! Let users react using emojis, stickers, or thumbs up to messages.
To maximize engagement on the content of your application, you can use reactions on messages, posts, or comments. The reaction is similar to Facebook's Like. While a user can add many reactions to a model, it can add each reaction one time only.
Reaction Description
Name | Data Type | Description | Attributes |
|
| ID of a document | |
|
| Type of document | |
|
| List of mapping between reaction and reactor ID. |
|
Reading the reactions
Each model which can be reacted upon will carry a set of properties useful to display its reactions. You will find:
reactions
: an object containing the name of the reactions as key, and their count as value (ex:{ like: 1, love: 1 }
)reactionCount
: the sum of all the counts for all the reactionsmyReactions
: an array containing the current's users reactions
Reacting on a message
Before you can add or remove reactions, the message must be fetched from the server first using either of these methods:
Add Reaction
To add a reaction, call the addReaction
and pass along the identifier for your reaction.
Remove Reaction
Just as you did for adding a reaction, you can call removeReaction
to remove a reaction.
Reactions
can be "like", "love", "wow" and other reaction names which has a maximum length of 100 characters. It is case sensitive. This means that "like" and "Like" are two different reactions.
Last updated