- Android
- iOS
- JavaScript
- Flutter
- ReactNative
The SDK provides two APIs for retrieving message reactions: one retrieves the latest data from the backend, and the other retrieves cached message reactions locally.
Locally cached data may not be the latest version, but it can be used to render the UI immediately and improve the user experience.
API Definition
/**
* get message reactions in batches (all messages must belong to the same conversation)
* @param messageIdList message ID list
* @param conversation conversation containing the message
* @param callback result callback
*/
void getMessagesReaction(List<String> messageIdList,
Conversation conversation,
IMessageReactionListCallback callback);
/**
* get cached message reactions (cached data may not be the latest version; use it to render the UI immediately for a better user experience)
* @param messageIdList message ID list
* @return message-reaction list
*/
List<MessageReaction> getCachedMessagesReaction(List<String> messageIdList);
The SDK provides two APIs for retrieving message reactions: one retrieves the latest data from the backend, and the other retrieves cached message reactions locally.
Locally cached data may not be the latest version, but it can be used to render the UI immediately and improve the user experience.
API Definition
/// get message reactions in batches (all messages must belong to the same conversation)
/// - Parameters:
/// - messageIdList: message ID list
/// - conversation: conversation containing the message
/// - successBlock: success callback
/// - errorBlock: failure callback
- (void)getMessagesReaction:(NSArray <NSString *> *)messageIdList
conversation:(JConversation *)conversation
success:(void (^)(NSArray <JMessageReaction *> *reactionList))successBlock
error:(void (^)(JErrorCode code))errorBlock;
/// get cached message reactions (cached data may not be the latest version; use it to render the UI immediately for a better user experience)
/// - Parameter messageIdList: message ID list
- (NSArray <JMessageReaction *> *)getCachedMessagesReaction:(NSArray <NSString *> *)messageIdList;
Read the reactions property directly from the message.
The SDK provides two APIs for retrieving message reactions: one retrieves the latest data from the backend, and the other retrieves cached message reactions locally.
Locally cached data may not be the latest version, but it can be used to render the UI immediately and improve the user experience.
API Definition
/**
* get message reactions in batches (all messages must belong to the same conversation)
* @param messageIdList message ID list
* @param conversation conversation containing the message
*/
Future<Result<List<MessageReaction>>> getMessagesReaction(List<String> messageIdList, Conversation conversation) async
/**
* get cached message reactions (cached data may not be the latest version; use it to render the UI immediately for a better user experience)
* @param messageIdList message ID list
* @return message-reaction list
*/
Future<Result<List<MessageReaction>>> getCachedMessagesReaction(List<String> messageIdList) async