AI Integration Quick Reference
AI Integration Quick Reference
Add a Reaction
Users can add a reaction to a message by callingaddReaction with the message ID and the reaction emoji.
- Swift
You can react on Text, Media and Custom messages.
Remove a Reaction
Removing a reaction from a message can be done using theremoveReaction method.
Both addReaction() and removeReaction() return a BaseMessage object with the updated reactions.
- Swift
Fetch Reactions for a Message
To get all reactions for a specific message, create aReactionsRequest using ReactionsRequestBuilder.
Fetch Next Reactions
- Swift
Fetch Reactions for Specific Emoji
- Swift
Fetch Previous Reactions
- Swift
Real-time Reaction Events
Keep the chat interactive with real-time updates for reactions.- Swift
Get Reactions List
To retrieve the list of reactions on a particular message. Returns an array ofReactionCount objects:
- Swift
Check if Logged-in User Has Reacted
- Swift
Update Message With Reaction Info
When you receive a real-time reaction event, use this method to update the message with the latest reaction information. This keeps your local message state in sync with the server.Method Signature
- Swift
Parameters
ReactionAction Enum Values
Usage Example - Reaction Added
- Swift
Usage Example - Reaction Removed
- Swift
Complete Real-Time Handling Example
- Swift
Notes:
- This is a synchronous method - no callbacks needed
- Always use this method to keep local message state in sync
- The returned message has updated reactions array
- Works with both user and group messages
- Handle both
REACTION_ADDEDandREACTION_REMOVEDevents
ReactionCount Object Properties
MessageReaction Object Properties
ReactionEvent Object Properties
Common Error Codes
Next Steps
Send Messages
Send text, media, and custom messages to users and groups
Receive Messages
Listen for incoming messages in real-time and fetch missed messages
Mentions
Mention specific users in messages
Threaded Messages
Organize conversations with message threads