HyphenateChatSDK 4.0.0
Instance Methods | List of all members
<IEMChatManager> Protocol Reference

#import <IEMChatManager.h>

Inheritance diagram for <IEMChatManager>:

Instance Methods

(void) - addDelegate:delegateQueue:
 
(void) - removeDelegate:
 
(NSArray< EMConversation * > *_Nullable) - getAllConversations
 
(void) - getConversationsFromServer:
 
(void) - getConversationsFromServerByPage:pageSize:completion:
 
(EMConversation *_Nullable) - getConversationWithConvId:
 
(EMConversation *_Nullable) - getConversation:type:createIfNotExist:
 
(EMConversation *_Nullable) - getConversation:type:createIfNotExist:isThread:
 
(void) - deleteConversation:isDeleteMessages:completion:
 
(void) - deleteServerConversation:conversationType:isDeleteServerMessages:completion:
 
(void) - deleteConversations:isDeleteMessages:completion:
 
(void) - importConversations:completion:
 
(EMChatMessage *_Nullable) - getMessageWithMessageId:
 
(NSString *_Nullable) - getMessageAttachmentPath:
 
(void) - importMessages:completion:
 
(void) - updateMessage:completion:
 
(void) - sendMessageReadAck:toUser:completion:
 
(void) - sendGroupMessageReadAck:toGroup:content:completion:
 
(void) - ackConversationRead:completion:
 
(void) - recallMessageWithMessageId:completion:
 
(void) - sendMessage:progress:completion:
 
(void) - resendMessage:progress:completion:
 
(void) - downloadMessageThumbnail:progress:completion:
 
(void) - downloadMessageAttachment:progress:completion:
 
(EMCursorResult< EMChatMessage * > *_Nullable) - fetchHistoryMessagesFromServer:conversationType:startMessageId:fetchDirection:pageSize:error:
 
(EMCursorResult< EMChatMessage * > *_Nullable) - fetchHistoryMessagesFromServer:conversationType:startMessageId:pageSize:error:
 
(void) - asyncFetchHistoryMessagesFromServer:conversationType:startMessageId:pageSize:completion:
 
(void) - asyncFetchHistoryMessagesFromServer:conversationType:startMessageId:fetchDirection:pageSize:completion:
 
(void) - asyncFetchGroupMessageAcksFromServer:groupId:startGroupAckId:pageSize:completion:
 
(void) - reportMessageWithId:tag:reason:completion:
 
(void) - deleteMessagesBefore:completion:
 
(void) - removeMessagesFromServerWithConversation:messageIds:completion:
 
(void) - removeMessagesFromServerWithConversation:timeStamp:completion:
 
(void) - translateMessage:targetLanguages:completion:
 
(void) - fetchSupportedLanguages:
 
(NSArray< EMChatMessage * > *_Nullable) - loadMessagesWithType:timestamp:count:fromUser:searchDirection:
 
(void) - loadMessagesWithType:timestamp:count:fromUser:searchDirection:completion:
 
(NSArray< EMChatMessage * > *) - loadMessagesWithKeyword:timestamp:count:fromUser:searchDirection:
 
(void) - loadMessagesWithKeyword:timestamp:count:fromUser:searchDirection:completion:
 
(void) - addReaction:toMessage:completion:
 
(void) - removeReaction:fromMessage:completion:
 
(void) - getReactionList:groupId:chatType:completion:
 
(void) - getReactionDetail:reaction:cursor:pageSize:completion:
 

Detailed Description

This protocol that defines the operations of chat.

The current messages are loaded from the local database, not from the server.

Method Documentation

◆ ackConversationRead:completion:

- (void) ackConversationRead: (NSString *_Nonnull)  conversationId
completion: (void(^)(EMError *_Nullable aError))  aCompletionBlock 
required

Sends the conversation read receipt to the server.

This method applies to one-to-one chats only.

This method call notifies the server to set the number of unread messages of the specified conversation as 0, and triggers the onConversationRead callback on the recipient's client.

To reduce the number of method calls, we recommend that you call this method when the user enters a conversation with many unread messages, and call sendMessageReadAck during a conversation to send the message read receipts.

This is an asynchronous method.

Parameters
conversationIdThe conversation ID.
aCompletionBlockThe completion block, which contains the error message if the method fails.

◆ addDelegate:delegateQueue:

- (void) addDelegate: (id< EMChatManagerDelegate > _Nullable)  aDelegate
delegateQueue: (dispatch_queue_t _Nullable)  aQueue 
required

Adds a delegate.

Parameters
aDelegateThe object that implements the protocol.
aQueue(optional) The queue of calling delegate methods. If you want to run the app on the main thread, set this parameter as nil.

◆ addReaction:toMessage:completion:

- (void) addReaction: (NSString *)  reaction
toMessage: (NSString *)  messageId
completion: (nullable void(^)(EMError *_Nullable))  completion 
required

Adds a Reaction.

Parameters
reactionThe Reaction content.
messageIdThe message ID.
completionThe completion block which contains the error code and error information if the method fails.

◆ asyncFetchGroupMessageAcksFromServer:groupId:startGroupAckId:pageSize:completion:

- (void) asyncFetchGroupMessageAcksFromServer: (NSString *_Nonnull)  aMessageId
groupId: (NSString *_Nonnull)  aGroupId
startGroupAckId: (NSString *_Nonnull)  aGroupAckId
pageSize: (int)  aPageSize
completion: (void(^)(EMCursorResult< EMGroupMessageAck * > *_Nullable aResult, EMError *_Nullable error, int totalCount))  aCompletionBlock 
required

Gets the read receipts of a specified group message from the server.

By getting the read receipts of a group message, you can see how many group members have read this message.

This is an asynchronous method.

Parameters
aMessageIdThe message ID.
aGroupIdThe group ID.
aGroupAckIdThe ID of the read receipt to get from the server.
aPageSizeThe number of read receipts that you expect to get on each page.
aCompletionBlockThe completion block, which contains the error message if the method fails.

◆ asyncFetchHistoryMessagesFromServer:conversationType:startMessageId:fetchDirection:pageSize:completion:

- (void) asyncFetchHistoryMessagesFromServer: (NSString *_Nonnull)  aConversationId
conversationType: (EMConversationType)  aConversationType
startMessageId: (NSString *_Nullable)  aStartMessageId
fetchDirection: (EMMessageFetchHistoryDirection)  direction
pageSize: (int)  aPageSize
completion: (void(^)(EMCursorResult< EMChatMessage * > *_Nullable aResult, EMError *_Nullable aError))  aCompletionBlock 
required

Fetches conversation messages from server.

This is an asynchronous method.

Parameters
aConversationIdThe conversation ID.
aConversationTypeThe conversation type.
aStartMessageIdThe starting message ID for query. If you set this parameter as nil or "", the SDK gets messages from the latest one.
directionThe message search direction. See EMMessageFetchHistoryDirection.
aPageSizeThe number of messages that you expect to get on each page. The value range is [1,50].
aCompletionBlockThe callback block, which contains the error message if the method fails.

◆ asyncFetchHistoryMessagesFromServer:conversationType:startMessageId:pageSize:completion:

- (void) asyncFetchHistoryMessagesFromServer: (NSString *_Nonnull)  aConversationId
conversationType: (EMConversationType)  aConversationType
startMessageId: (NSString *_Nullable)  aStartMessageId
pageSize: (int)  aPageSize
completion: (void(^)(EMCursorResult< EMChatMessage * > *_Nullable aResult, EMError *_Nullable aError))  aCompletionBlock 
required

Gets messages in a conversation from the server.

This is an asynchronous method.

Parameters
aConversationIdThe conversation ID.
aConversationTypeThe conversation type.
aStartMessageIdThe starting message ID for query. If you set this parameter as nil or "", the SDK gets messages from the latest one.
aPageSizeThe number of messages that you expect to get on each page.
aCompletionBlockThe completion block, which contains the error message if the method fails.

◆ deleteConversation:isDeleteMessages:completion:

- (void) deleteConversation: (NSString *_Nonnull)  aConversationId
isDeleteMessages: (BOOL)  aIsDeleteMessages
completion: (void(^)(NSString *_Nullable aConversationId, EMError *_Nullable aError))  aCompletionBlock 
required

Deletes a conversation from the local database.

Parameters
aConversationIdThe conversation ID.
aIsDeleteMessagesWhether to delete the messages in the conversation.
  • YES: Yes;
  • NO: No.
aCompletionBlockThe completion block, which contains the error message if the method call fails.

◆ deleteConversations:isDeleteMessages:completion:

- (void) deleteConversations: (NSArray< EMConversation * > *_Nullable)  aConversations
isDeleteMessages: (BOOL)  aIsDeleteMessages
completion: (void(^)(EMError *_Nullable aError))  aCompletionBlock 
required

Deletes multiple conversations.

Parameters
aConversationsThe conversation list.
aIsDeleteMessagesWhether to delete the messages with the conversations.
  • YES: Yes;
  • NO: No.
aCompletionBlockThe completion block, which contains the error message if the method fails.

◆ deleteMessagesBefore:completion:

- (void) deleteMessagesBefore: (NSUInteger)  aTimestamp
completion: (void(^)(EMError *error))  aCompletion 
required

Deletes local historical messages with a Unix timestamp before a specified one.

Parameters
aTimestampThe specified Unix timestamp in miliseconds. Messages with a Unix timestamp before a specified one will be deleted.
aCompletionThe completion block, which contains the error message if the method fails.

◆ deleteServerConversation:conversationType:isDeleteServerMessages:completion:

- (void) deleteServerConversation: (NSString *_Nonnull)  aConversationId
conversationType: (EMConversationType)  aConversationType
isDeleteServerMessages: (BOOL)  aIsDeleteServerMessages
completion: (void(^)(NSString *_Nullable aConversationId, EMError *_Nullable aError))  aCompletionBlock 
required

Deletes a conversation from the server.

Parameters
aConversationIdThe conversation ID.
aConversationTypeThe conversation type.
aIsDeleteMessagesWhether to delete the related messages with the conversation.
  • YES: Yes;
  • NO: No.
aCompletionBlockThe completion block, which contains the error message if the method call fails.

◆ downloadMessageAttachment:progress:completion:

- (void) downloadMessageAttachment: (EMChatMessage *_Nonnull)  aMessage
progress: (void(^)(int progress))  aProgressBlock
completion: (void(^)(EMChatMessage *_Nullable message, EMError *_Nullable error))  aCompletionBlock 
required

Downloads message attachment (voice, video, image or file).

The SDK automatically downloads voice messages. If the automatic download fails, you can download voice messages manually.

This is an asynchronous method.

Parameters
aMessageThe message object.
aProgressBlockThe callback block of attachment download progress. The progress value range is [0,100].
aCompletionBlockThe completion block, which contains the error message if the method fails.

◆ downloadMessageThumbnail:progress:completion:

- (void) downloadMessageThumbnail: (EMChatMessage *_Nonnull)  aMessage
progress: (void(^)(int progress))  aProgressBlock
completion: (void(^)(EMChatMessage *_Nullable message, EMError *_Nullable error))  aCompletionBlock 
required

Downloads the message thumbnail (the thumbnail of an image message or the first frame of a video message).

The SDK automatically downloads the thumbnail. If the auto-download fails, you can call this method to manually download the thumbnail.

Parameters
aMessageThe message object.
aProgressBlockThe callback block of attachment download progress. The progress value range is [0,100].
aCompletionBlockThe completion block, which contains the error message if the method fails.

◆ fetchHistoryMessagesFromServer:conversationType:startMessageId:fetchDirection:pageSize:error:

- (EMCursorResult< EMChatMessage * > *_Nullable) fetchHistoryMessagesFromServer: (NSString *_Nonnull)  aConversationId
conversationType: (EMConversationType)  aConversationType
startMessageId: (NSString *_Nullable)  aStartMessageId
fetchDirection: (EMMessageFetchHistoryDirection)  direction
pageSize: (int)  aPageSize
error: (EMError **_Nullable)  pError 
required

Gets messages in a conversation from the server.

Parameters
aConversationIdThe conversation ID.
aConversationTypeThe conversation type.
aStartMessageIdThe starting message ID for query. If you set this parameter as nil or "", the SDK gets messages from the latest one.
directionThe message search direction. See EMMessageFetchHistoryDirection.
aPageSizeThe number of messages that you expect to get on each page.
pErrorThe error information if the method fails: Error.
Returns
The list of retrieved messages.

◆ fetchHistoryMessagesFromServer:conversationType:startMessageId:pageSize:error:

- (EMCursorResult< EMChatMessage * > *_Nullable) fetchHistoryMessagesFromServer: (NSString *_Nonnull)  aConversationId
conversationType: (EMConversationType)  aConversationType
startMessageId: (NSString *_Nullable)  aStartMessageId
pageSize: (int)  aPageSize
error: (EMError **_Nullable)  pError 
required

Gets messages in a conversation from the server.

Parameters
aConversationIdThe conversation ID.
aConversationTypeThe conversation type.
aStartMessageIdThe starting message ID for query. If you set this parameter as nil or "", the SDK gets messages from the latest one.
aPageSizeThe number of messages that you expect to get on each page.
pErrorThe error information if the method fails: Error.
Returns
The list of retrieved messages.

◆ fetchSupportedLanguages:

- (void) fetchSupportedLanguages: (void(^)(NSArray< EMTranslateLanguage * > *_Nullable languages, EMError *_Nullable error))  aCompletionBlock
required

Gets all languages supported by the translation service.

Parameters
aCompletionBlockThe completion block, which contains the error message if the method fails.

◆ getAllConversations

- (NSArray< EMConversation * > *_Nullable) getAllConversations
required

Gets all conversations in the local database. The SDK loads the conversations from the memory first. If no conversation is in the memory, the SDK loads from the local database.

Returns
The conversation NSArray.

◆ getConversation:type:createIfNotExist:

- (EMConversation *_Nullable) getConversation: (NSString *_Nonnull)  aConversationId
type: (EMConversationType)  aType
createIfNotExist: (BOOL)  aIfCreate 
required

Gets a conversation from the local database.

Parameters
aConversationIdThe conversation ID.
aTypeThe conversation type.
aIfCreateWhether to create the conversation if it does not exist.
Returns
The conversation object.

◆ getConversation:type:createIfNotExist:isThread:

- (EMConversation *_Nullable) getConversation: (NSString *_Nonnull)  aConversationId
type: (EMConversationType)  aType
createIfNotExist: (BOOL)  aIfCreate
isThread: (BOOL)  isThread 
required

Gets a conversation from the local database.

Parameters
aConversationIdThe conversation ID.
aTypeThe conversation type.
aIfCreateWhether to create the conversation if it does not exist.
isThreadWhether it is thread conversation. That is, whether the conversation is of the threadChat type.
  • YES: Yes;
  • NO: No.
Returns
The conversation object.

◆ getConversationsFromServer:

- (void) getConversationsFromServer: (void(^)(NSArray< EMConversation * > *_Nullable aConversations, EMError *_Nullable aError))  aCompletionBlock
required

Gets all conversations from the server.

Parameters
aCompletionBlockThe completion block, which contains the error message if the method fails.

◆ getConversationsFromServerByPage:pageSize:completion:

- (void) getConversationsFromServerByPage: (NSUInteger)  pageNumber
pageSize: (NSUInteger)  pageSize
completion: (void(^)(NSArray< EMConversation * > *_Nullable aConversations, EMError *_Nullable aError))  aCompletionBlock 
required

Gets all conversations from the server by page.

Parameters
pageNumberThe current page number, starting from 1.
pageSizeThe number of conversations on each page
aCompletionBlockThe completion block, which contains the error message if the method fails.

◆ getConversationWithConvId:

- (EMConversation *_Nullable) getConversationWithConvId: (NSString *_Nullable)  aConversationId
required

Gets a conversation from the local database.

Parameters
aConversationIdThe conversation ID.
Returns
The conversation object.

◆ getMessageAttachmentPath:

- (NSString *_Nullable) getMessageAttachmentPath: (NSString *_Nonnull)  aConversationId
required

Gets the local path of message attachments in a conversation.

When a conversation is deleted, the message attachments in the conversation will also be deleted.

Parameters
aConversationIdThe conversation ID.
Returns
The attachment path.

◆ getMessageWithMessageId:

- (EMChatMessage *_Nullable) getMessageWithMessageId: (NSString *_Nonnull)  aMessageId
required

Gets the specified message.

Parameters
aMessageIdThe message ID.
Returns
EMChatMessage The message content.

◆ getReactionDetail:reaction:cursor:pageSize:completion:

- (void) getReactionDetail: (NSString *)  messageId
reaction: (NSString *)  reaction
cursor: (nullable NSString *)  cursor
pageSize: (uint64_t)  pageSize
completion: (void(^)(EMMessageReaction *, NSString *_Nullable cursor, EMError *_Nullable))  completion 
required

Uses the pagination to get the Reaction detail list of a chat group message.

Parameters
messageIdThe message ID.
reactionThe Reaction content.
cursorThe cursor that specifies where to start to get data. If it is set to nil or @"" at the first call, the SDK retrieves Reactions in the chronological order of their creation time.
pageSizeThe number of Reactions that you expect to get on each page. The value range is [1,100].
completionThe completion block, which contains the Reaction list and the cursor for the next query. When the cursor is nil, all data is already fetched.

◆ getReactionList:groupId:chatType:completion:

- (void) getReactionList: (NSArray< NSString * > *)  messageIds
groupId: (nullable NSString *)  groupId
chatType: (EMChatType)  chatType
completion: (void(^)(NSDictionary< NSString *, NSArray< EMMessageReaction * > * > *, EMError *_Nullable))  completion 
required

Gets the Reaction list.

Parameters
messageIdThe message ID.
groupIdThe group ID. This parameter is invalid only for group chat.
chatTypeThe chat type. Only one-to-one chat (EMChatTypeChat and group chat (EMChatTypeGroupChat) are allowed.
completionThe completion block which contains the error code and error information if the method fails.

◆ importConversations:completion:

- (void) importConversations: (NSArray< EMConversation * > *_Nullable)  aConversations
completion: (void(^)(EMError *_Nullable aError))  aCompletionBlock 
required

Imports multiple conversations to the local database.

Parameters
aConversationsThe conversation list.
aCompletionBlockThe completion block, which contains the error message if the method fails.

◆ importMessages:completion:

- (void) importMessages: (NSArray< EMChatMessage * > *_Nonnull)  aMessages
completion: (void(^)(EMError *_Nullable aError))  aCompletionBlock 
required

Imports multiple messages to the local database.

Parameters
aMessagesThe message list.
aCompletionBlockThe completion block, which contains the error message if the method fails.

◆ loadMessagesWithKeyword:timestamp:count:fromUser:searchDirection:

- (NSArray< EMChatMessage * > *) loadMessagesWithKeyword: (NSString *)  aKeywords
timestamp: (long long)  aTimestamp
count: (int)  aCount
fromUser: (NSString *)  aSender
searchDirection: (EMMessageSearchDirection)  aDirection 
required

Loads messages with the specified keyword from the local database.

This method returns messages in chronological order.

This is a synchronous method and blocks the current thread.

Parameters
aKeywordThe keyword for message search. If you set this parameter as nil, the SDK ignores this parameter when retrieving messages.
aTimestampThe message timestamp threshold for loading. If you set this parameter as a negative value, the SDK loads messages from the latest.
aCountThe number of messages to load. If you set this parameter less than 1, the SDK gets one message from the local database.
aSenderThe message sender. If you set this parameter as nil, the SDK ignores this parameter when retrieving messages.
aDirectionThe message search direction. See EMMessageSearchDirection.
  • UP: The SDK retrieves messages in the descending order of the timestamp included in them.
  • DOWN:The SDK retrieves messages in the ascending order of the timestamp included in them.
Returns
The list of retrieved messages. The message list is of the array type. For elements in the array, see EMChatMessage.

◆ loadMessagesWithKeyword:timestamp:count:fromUser:searchDirection:completion:

- (void) loadMessagesWithKeyword: (NSString *)  aKeywords
timestamp: (long long)  aTimestamp
count: (int)  aCount
fromUser: (NSString *)  aSender
searchDirection: (EMMessageSearchDirection)  aDirection
completion: (void(^)(NSArray< EMChatMessage * > *aMessages, EMError *aError))  aCompletionBlock 
required

Loads messages with the specified keyword from the local database.

This method returns messages in chronological order.

Parameters
aKeywordThe keyword for message search. If you set this parameter as nil, the SDK ignores this parameter when retrieving messages.
aTimestampThe message timestamp threshold for loading. If you set this parameter as a negative value, the SDK loads messages from the latest.
aCountThe number of messages to load. If you set this parameter less than 1, the SDK gets one message from the local database.
aSenderThe sender of the message. If you set this parameter as nil, the SDK ignores this parameter when retrieving messages.
aDirectionThe message search direction. See EMMessageSearchDirection.
  • UP: The SDK retrieves messages in the descending order of the timestamp included in them.
  • DOWN:The SDK retrieves messages in the ascending order of the timestamp included in them.
aCompletionBlockThe completion block which contains the error code and error information if the method fails.

◆ loadMessagesWithType:timestamp:count:fromUser:searchDirection:

- (NSArray< EMChatMessage * > *_Nullable) loadMessagesWithType: (EMMessageBodyType)  aType
timestamp: (long long)  aTimestamp
count: (int)  aCount
fromUser: (NSString *_Nullable)  aUsername
searchDirection: (EMMessageSearchDirection)  aDirection 
required

Loads messages with the specified keyword from the local database.

This method returns messages in chronological order.

This is a synchronous method and blocks the current thread.

Parameters
aTypeThe message type to load.
aTimestampThe message timestamp threshold for loading. If you set this parameter as a negative value, the SDK loads messages from the latest one.
aCountThe number of messages to load. If you set this parameter to a value less than 1, the SDK gets one message from the local database.
aUsernameThe message sender. It is optional. If you set this parameter as nil, the SDK gets messages while ignoring this parameter.
aDirectionThe message search direction. See EMMessageSearchDirection.
  • UP: The SDK retrieves messages in the descending order of the timestamp included in them.
  • DOWN:The SDK retrieves messages in the ascending order of the timestamp included in them.
Returns
The list of retrieved messages. The message list is of the array type. For elements in the array, see EMChatMessage.

◆ loadMessagesWithType:timestamp:count:fromUser:searchDirection:completion:

- (void) loadMessagesWithType: (EMMessageBodyType)  aType
timestamp: (long long)  aTimestamp
count: (int)  aCount
fromUser: (NSString *)  aUsername
searchDirection: (EMMessageSearchDirection)  aDirection
completion: (void(^)(NSArray< EMChatMessage * > *aMessages, EMError *aError))  aCompletionBlock 
required

Loads messages with the specified keyword from the local database.

This method returns messages in chronological order.

Parameters
aTypeThe message type to load.
aTimestampThe message timestamp threshold for loading. If you set this parameter as a negative value, the SDK loads messages from the latest one.
aCountThe number of messages to load. If you set this parameter to a value less than 1, the SDK gets one message from the local database.
aUsernameThe message sender. It is optional. If you set this parameter as nil, the SDK ignores this parameter when retrieving messages.
aDirectionThe message search direction. See EMMessageSearchDirection.
  • UP: The SDK retrieves messages in the descending order of the timestamp included in them.
  • DOWN:The SDK retrieves messages in the ascending order of the timestamp included in them.
aCompletionBlockThe completion block, which contains the error message if the method fails.

◆ recallMessageWithMessageId:completion:

- (void) recallMessageWithMessageId: (NSString *_Nonnull)  aMessageId
completion: (void(^)(EMError *_Nullable aError))  aCompletionBlock 
required

Recalls a message.

This is an asynchronous method.

Parameters
aMessageIdThe message ID
aCompletionBlockThe completion block, which contains the error message if the method fails.

◆ removeDelegate:

- (void) removeDelegate: (id< EMChatManagerDelegate > _Nonnull)  aDelegate
required

Removes a delegate.

Parameters
aDelegateThe delegate to be removed.

◆ removeMessagesFromServerWithConversation:messageIds:completion:

- (void) removeMessagesFromServerWithConversation: (EMConversation *_Nonnull)  conversation
messageIds: (NSArray< __kindof NSString * > *_Nonnull)  messageIds
completion: (void(^)(EMError *_Nullable aError))  aCompletionBlock 
required

Removes messages in a conversation (from both local storage and the server).

Parameters
conversationThe EMConversation object.
messageIdsA string array of message IDs to delete.
completionThe completion block, which contains the error message if the method fails.

◆ removeMessagesFromServerWithConversation:timeStamp:completion:

- (void) removeMessagesFromServerWithConversation: (EMConversation *_Nonnull)  conversation
timeStamp: (NSTimeInterval)  beforeTimeStamp
completion: (void(^)(EMError *_Nullable aError))  aCompletionBlock 
required

Removes messages in a conversation (from both local storage and the server).

Parameters
conversationThe EMConversation object.
messageIdsThe specified Unix timestamp in miliseconds. Messages with a timestamp before the specified one will be removed from the conversation.
completionThe completion block, which contains the error message if the method fails.

◆ removeReaction:fromMessage:completion:

- (void) removeReaction: (NSString *)  reaction
fromMessage: (NSString *)  messageId
completion: (nullable void(^)(EMError *_Nullable))  completion 
required

Removes a Reaction.

Parameters
reactionThe Reaction content.
messageIdThe message ID.
completionThe completion block which contains the error code and error information if the method fails.

◆ reportMessageWithId:tag:reason:completion:

- (void) reportMessageWithId: (NSString *_Nonnull)  aMessageId
tag: (NSString *_Nonnull)  aTag
reason: (NSString *_Nonnull)  aReason
completion: (void(^)(EMError *_Nullable error))  aCompletion 
required

Reports an inappropriate message.

This is an asynchronous method.

Parameters
aMessageIdThe ID of the inappropriate message.
aTagThe message content tag. For example, the message is related to pornography or terrorism.
aReasonThe reason for reporting the message.
aCompletionThe completion block, which contains the error message if the method fails.

◆ resendMessage:progress:completion:

- (void) resendMessage: (EMChatMessage *_Nonnull)  aMessage
progress: (void(^)(int progress))  aProgressBlock
completion: (void(^)(EMChatMessage *_Nullable message, EMError *_Nullable error))  aCompletionBlock 
required

Resends a message.

Parameters
aMessageThe message object.
aProgressBlockThe callback block of attachment upload progress. The progress value range is [0,100].
aCompletionBlockThe completion block, which contains the error message if the method fails.

◆ sendGroupMessageReadAck:toGroup:content:completion:

- (void) sendGroupMessageReadAck: (NSString *_Nonnull)  aMessageId
toGroup: (NSString *_Nonnull)  aGroupId
content: (NSString *_Nullable)  aContent
completion: (void(^)(EMError *_Nullable aError))  aCompletionBlock 
required

Sends the read receipt for a group message.

This is an asynchronous method.

Parameters
aMessageIdThe message ID.
aGroupIdThe group ID.
aContentThe message content.
aCompletionBlockThe completion block, which contains the error message if the method fails.

◆ sendMessage:progress:completion:

- (void) sendMessage: (EMChatMessage *_Nonnull)  aMessage
progress: (void(^)(int progress))  aProgressBlock
completion: (void(^)(EMChatMessage *_Nullable message, EMError *_Nullable error))  aCompletionBlock 
required

Sends a message.

This is an asynchronous method.

Parameters
aMessageThe message instance.
aProgressBlockThe callback block of attachment upload progress. The progress value range is [0,100].
aCompletionBlockThe completion block, which contains the error message if the method fails.

◆ sendMessageReadAck:toUser:completion:

- (void) sendMessageReadAck: (NSString *_Nonnull)  aMessageId
toUser: (NSString *_Nonnull)  aUsername
completion: (void(^)(EMError *_Nullable aError))  aCompletionBlock 
required

Sends the read receipt for a message.

This is an asynchronous method.

Parameters
aMessageIdThe message ID.
aUsernameThe user ID of the recipient of the read receipt.
aCompletionBlockThe completion block, which contains the error message if the method fails.

◆ translateMessage:targetLanguages:completion:

- (void) translateMessage: (EMChatMessage *_Nonnull)  aMessage
targetLanguages: (NSArray< NSString * > *_Nonnull)  aLanguages
completion: (void(^)(EMChatMessage *_Nullable message, EMError *_Nullable error))  aCompletionBlock 
required

Translates a message.

Parameters
aMessageThe message object.
aLanguagesThe list of target language codes.
aCompletionBlockThe completion block, which contains the error message if the method fails.

◆ updateMessage:completion:

- (void) updateMessage: (EMChatMessage *_Nonnull)  aMessage
completion: (void(^)(EMChatMessage *_Nullable aMessage, EMError *_Nullable aError))  aCompletionBlock 
required

Updates a message in the local database.

This method updates the message in both the memory and the local database at the same time.

The message ID cannot be updated.

Parameters
aMessageThe message instance.
aCompletionBlockThe completion block, which contains the error message if the method fails.

The documentation for this protocol was generated from the following file: