AgoraChatSDK 1.0.7
Instance Methods | List of all members
<IAgoraChatManager> Protocol Reference

#import <IAgoraChatManager.h>

Inheritance diagram for <IAgoraChatManager>:

Instance Methods

(void) - addDelegate:delegateQueue:
 
(void) - removeDelegate:
 
(NSArray< AgoraChatConversation * > *_Nullable) - getAllConversations
 
(void) - getConversationsFromServer:
 
(AgoraChatConversation *_Nullable) - getConversationWithConvId:
 
(AgoraChatConversation *_Nullable) - getConversation:type:createIfNotExist:
 
(AgoraChatConversation *_Nullable) - getConversation:type:createIfNotExist:isThread:
 
(void) - deleteConversation:isDeleteMessages:completion:
 
(void) - deleteServerConversation:conversationType:isDeleteServerMessages:completion:
 
(void) - deleteConversations:isDeleteMessages:completion:
 
(void) - importConversations:completion:
 
(AgoraChatMessage *_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:
 
(AgoraChatCursorResult< AgoraChatMessage * > *_Nullable) - fetchHistoryMessagesFromServer:conversationType:startMessageId:fetchDirection:pageSize:error:
 
(AgoraChatCursorResult< AgoraChatMessage * > *_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) - translateMessage:targetLanguages:completion:
 
(void) - fetchSupportedLanguages:
 
(NSArray< AgoraChatMessage * > *) - loadMessagesWithType:timestamp:count:fromUser:searchDirection:
 
(void) - loadMessagesWithType:timestamp:count:fromUser:searchDirection:completion:
 
(NSArray< AgoraChatMessage * > *) - 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 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(^)(AgoraChatError *_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 receiver'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< AgoraChatManagerDelegate > _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(^)(AgoraChatError *_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(^)(AgoraChatCursorResult< AgoraChatGroupMessageAck * > *_Nullable aResult, AgoraChatError *_Nullable error, int totalCount))  aCompletionBlock 
required

Fetches the read back receipt of specified group messages from the server.

This is an asynchronous method.

Parameters
aMessageIdThe message ID which select to fetch.
aGroupIdThe group ID which select to fetch.
aGroupAckIdThe group ack ID which select to fetch.
aPageSizeThe page size.
aCompletionBlockThe callback block of fetch complete, which contains the error message if the method fails.

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

- (void) asyncFetchHistoryMessagesFromServer: (NSString *_Nonnull)  aConversationId
conversationType: (AgoraChatConversationType)  aConversationType
startMessageId: (NSString *_Nullable)  aStartMessageId
fetchDirection: (AgoraChatMessageFetchHistoryDirection)  direction
pageSize: (int)  aPageSize
completion: (void(^)(AgoraChatCursorResult< AgoraChatMessage * > *_Nullable aResult, AgoraChatError *_Nullable aError))  aCompletionBlock 
required

Fetches conversation messages from server.

This is an asynchronous method.

Parameters
aConversationIdThe conversation id which select to fetch message.
aConversationTypeThe conversation type which select to fetch message.
aStartMessageIdThe start message id, if empty, start from the server last message.
directionAgoraChatMessageFetchHistoryDirection up or down
aPageSizeThe page size. limit 50
aCompletionBlockThe callback block of fetch complete, which contains the error message if the method fails.

◆ asyncFetchHistoryMessagesFromServer:conversationType:startMessageId:pageSize:completion:

- (void) asyncFetchHistoryMessagesFromServer: (NSString *_Nonnull)  aConversationId
conversationType: (AgoraChatConversationType)  aConversationType
startMessageId: (NSString *_Nullable)  aStartMessageId
pageSize: (int)  aPageSize
completion: (void(^)(AgoraChatCursorResult< AgoraChatMessage * > *_Nullable aResult, AgoraChatError *_Nullable aError))  aCompletionBlock 
required

Fetches conversation messages from server.

This is an asynchronous method.

Parameters
aConversationIdThe conversation id which select to fetch message.
aConversationTypeThe conversation type which select to fetch message.
aStartMessageIdThe start message id, if empty, start from the server last message.
aPageSizeThe page size.
aCompletionBlockThe callback block of fetch complete, 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, AgoraChatError *_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< AgoraChatConversation * > *_Nullable)  aConversations
isDeleteMessages: (BOOL)  aIsDeleteMessages
completion: (void(^)(AgoraChatError *_Nullable aError))  aCompletionBlock 
required

Deletes multiple conversations.

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

◆ deleteMessagesBefore:completion:

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

Deletes messages with timestamp that is before the specified one.

Parameters
aTimestampThe specified Unix timestamp(miliseconds).
aCompletionThe completion block, which contains the error message if the method fails.

◆ deleteServerConversation:conversationType:isDeleteServerMessages:completion:

- (void) deleteServerConversation: (NSString *_Nonnull)  aConversationId
conversationType: (AgoraChatConversationType)  aConversationType
isDeleteServerMessages: (BOOL)  aIsDeleteServerMessages
completion: (void(^)(NSString *_Nullable aConversationId, AgoraChatError *_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: (AgoraChatMessage *_Nonnull)  aMessage
progress: (void(^)(int progress))  aProgressBlock
completion: (void(^)(AgoraChatMessage *_Nullable message, AgoraChatError *_Nullable error))  aCompletionBlock 
required

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

SDK handles attachment downloading automatically. If automatic download failed, you can download attachment manually.

This is an asynchronous method.

Parameters
aMessageThe message object.
aProgressBlockThe callback block of attachment download progress.
aCompletionBlockThe completion block, which contains the error message if the method fails.

◆ downloadMessageThumbnail:progress:completion:

- (void) downloadMessageThumbnail: (AgoraChatMessage *_Nonnull)  aMessage
progress: (void(^)(int progress))  aProgressBlock
completion: (void(^)(AgoraChatMessage *_Nullable message, AgoraChatError *_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.
aCompletionBlockThe completion block, which contains the error message if the method fails.

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

- (AgoraChatCursorResult< AgoraChatMessage * > *_Nullable) fetchHistoryMessagesFromServer: (NSString *_Nonnull)  aConversationId
conversationType: (AgoraChatConversationType)  aConversationType
startMessageId: (NSString *_Nullable)  aStartMessageId
fetchDirection: (AgoraChatMessageFetchHistoryDirection)  direction
pageSize: (int)  aPageSize
error: (AgoraChatError **_Nullable)  pError 
required

Fetches conversation messages from server.

Parameters
aConversationIdThe conversation id which select to fetch message.
aConversationTypeThe conversation type which select to fetch message.
aStartMessageIdThe start message id, if empty, start from the server‘s last message.
directionAgoraChatMessageFetchHistoryDirection up or down
aPageSizeThe page size.
pErrorThe error information if the method fails: Error.
Returns
The messages list.

◆ fetchHistoryMessagesFromServer:conversationType:startMessageId:pageSize:error:

- (AgoraChatCursorResult< AgoraChatMessage * > *_Nullable) fetchHistoryMessagesFromServer: (NSString *_Nonnull)  aConversationId
conversationType: (AgoraChatConversationType)  aConversationType
startMessageId: (NSString *_Nullable)  aStartMessageId
pageSize: (int)  aPageSize
error: (AgoraChatError **_Nullable)  pError 
required

Fetches conversation messages from server.

Parameters
aConversationIdThe conversation id which select to fetch message.
aConversationTypeThe conversation type which select to fetch message.
aStartMessageIdThe start message id, if empty, start from the server‘s last message.
aPageSizeThe page size.
pErrorThe error information if the method fails: Error.
Returns
The messages list.

◆ fetchSupportedLanguages:

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

Gets the list of supported languages for translation.

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

◆ getAllConversations

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

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

Returns
The conversation NSArray.

◆ getConversation:type:createIfNotExist:

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

Gets a conversation from the local database.

Parameters
aConversationIdThe conversation ID.
aTypeThe conversation type (Must be specified).
aIfCreateWhether to create the conversation if it does not exist.
Returns
The conversation.

◆ getConversation:type:createIfNotExist:isThread:

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

Gets a conversation from the local database.

Parameters
aConversationIdThe conversation ID.
aTypeThe conversation type (Must be specified).
aIfCreateWhether to create the conversation if it does not exist.
isThreadWhether it is a threadChat type of session
Returns
The conversation.

◆ getConversationsFromServer:

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

Gets all conversations from the server.

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

◆ getConversationWithConvId:

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

Gets a conversation from the local database.

Parameters
aConversationId␈The conversation ID.
Returns
The conversation object.

◆ getMessageAttachmentPath:

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

Gets the local path of message attachments in a conversation. Delete the conversation will also delete the files under the file path.

Parameters
aConversationIdThe conversation ID.
Returns
The attachment path.

◆ getMessageWithMessageId:

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

Gets the specified message.

Parameters
aMessageIdThe message ID.
Returns
AgoraChatMessage 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(^)(AgoraChatMessageReaction *, NSString *_Nullable cursor, AgoraChatError *_Nullable))  completion 
required

Gets the Reaction detail list of a chat group message with pagination.

Parameters
messageIdThe message ID.
reactionThe Reaction content.
cursorThe cursor that specifies where to start to get data. If it is nil or @"", 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 cannot exceed 100.
completionThe completion block, which contains the Reaction list and the cursor for the next query. When the cursor is nil, all data is fetched.

◆ getReactionList:groupId:chatType:completion:

- (void) getReactionList: (NSArray< NSString * > *)  messageIds
groupId: (nullable NSString *)  groupId
chatType: (AgoraChatType)  chatType
completion: (void(^)(NSDictionary< NSString *, NSArray< AgoraChatMessageReaction * > * > *, AgoraChatError *_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 (AgoraChatTypeChat and group chat (AgoraChatTypeGroupChat) are allowed.
completionThe completion block which contains the error code and error information if the method fails.

◆ importConversations:completion:

- (void) importConversations: (NSArray< AgoraChatConversation * > *_Nullable)  aConversations
completion: (void(^)(AgoraChatError *_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< AgoraChatMessage * > *_Nonnull)  aMessages
completion: (void(^)(AgoraChatError *_Nullable aError))  aCompletionBlock 
required

Imports multiple messages to the local database.

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

◆ loadMessagesWithKeyword:timestamp:count:fromUser:searchDirection:

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

Loads messages with the specified keyword from the local database.

This method returns messages in the sequence of the timestamp when they are received.

This is a synchronous method and blocks the current thread.

Parameters
aKeywordThe keyword for searching the messages. Setting it as nil means that the SDK ignores this parameter.
aTimestampThe reference timestamp for the messages to be loaded. 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, it will be handled as count=1.
aSenderThe user that sends the message.
aDirectionThe message search directions: MessageSearchDirection.
  • UP: In the reverse chronological order.
  • DOWN:In the chronological order.
Returns
AgoraChatMessage NSArray. <AgoraChatMessage>

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

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

Loads messages with the specified keyword from the local database.

This method returns messages in the sequence of the timestamp when they are received.

Parameters
aKeywordThe keyword for searching the messages. Setting it as nil means that the SDK ignores this parameter.
aTimestampThe reference timestamp for the messages to be loaded. 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, it will be handled as count=1. AgoraChatMessageSearchDirectionDown: get aCount of messages after aMessageId * -—
aSenderThe sender of the message. Setting it as nil means that the SDK ignores this parameter.
aDirectionThe message search directions: MessageSearchDirection.
  • UP: In the reverse chronological order.
  • DOWN:In the chronological order.
aCompletionBlockThe completion block which contains the error code and error information if the method fails.

◆ loadMessagesWithType:timestamp:count:fromUser:searchDirection:

- (NSArray< AgoraChatMessage * > *) loadMessagesWithType: (AgoraChatMessageBodyType)  aType
timestamp: (long long)  aTimestamp
count: (int)  aCount
fromUser: (NSString *)  aUsername
searchDirection: (AgoraChatMessageSearchDirection)  aDirection 
required

Loads messages with the specified keyword from the local database.

This method returns messages in the sequence of the timestamp when they are received.

This is a synchronous method and blocks the current thread.

Parameters
aTypeThe message type to load.
aTimestampThe reference timestamp for the messages to be loaded. 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, it will be handled as count=1.
aUsernameMessage sender (optional). Use aUsername=nil to ignore.
aDirectionThe message search directions: MessageSearchDirection.
  • UP: In the reverse chronological order.
  • DOWN:In the chronological order.
Returns
AgoraChatMessage NSArray.

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

- (void) loadMessagesWithType: (AgoraChatMessageBodyType)  aType
timestamp: (long long)  aTimestamp
count: (int)  aCount
fromUser: (NSString *)  aUsername
searchDirection: (AgoraChatMessageSearchDirection)  aDirection
completion: (void(^)(NSArray< AgoraChatMessage * > *aMessages, AgoraChatError *aError))  aCompletionBlock 
required

Loads messages with the specified keyword from the local database.

This method returns messages in the sequence of the timestamp when they are received.

Parameters
aTypeThe message type to load.
aTimestampThe reference timestamp for the messages to be loaded. 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, it will be handled as count=1
aUsernameThe user that sends the message. Setting it as nil means that the SDK ignores this parameter.
aDirectionThe message search directions: MessageSearchDirection.
  • UP: In the reverse chronological order.
  • DOWN:In the chronological order.
aCompletionBlockThe completion block, which contains the error message if the method fails.

◆ recallMessageWithMessageId:completion:

- (void) recallMessageWithMessageId: (NSString *_Nonnull)  aMessageId
completion: (void(^)(AgoraChatError *_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< AgoraChatManagerDelegate > _Nonnull)  aDelegate
required

Removes a delegate.

Parameters
aDelegateThe delegate to be removed.

◆ removeReaction:fromMessage:completion:

- (void) removeReaction: (NSString *)  reaction
fromMessage: (NSString *)  messageId
completion: (nullable void(^)(AgoraChatError *_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(^)(AgoraChatError *_Nullable error))  aCompletion 
required

Report violation message

Parameters
aMessageIdViolation Message ID
aTagReport tag
aReasonReport reasons
aCompletionThe callback block of fetch complete

◆ resendMessage:progress:completion:

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

Resends a message.

Parameters
aMessageThe message object.
aProgressBlockThe callback block of attachment upload progress.
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(^)(AgoraChatError *_Nullable aError))  aCompletionBlock 
required

Sends the read receipt for a group message.

This is an asynchronous method.

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

◆ sendMessage:progress:completion:

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

Sends a message.

This is an asynchronous method.

Parameters
aMessageThe message instance.
aProgressBlockThe block of attachment upload progress in percentage, 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(^)(AgoraChatError *_Nullable aError))  aCompletionBlock 
required

Sends the read receipt for a message.

This is an asynchronous method.

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

◆ translateMessage:targetLanguages:completion:

- (void) translateMessage: (AgoraChatMessage *)  aMessage
targetLanguages: (NSArray< NSString * > *)  aLanguages
completion: (void(^)(AgoraChatMessage *message, AgoraChatError *error))  aCompletionBlock 
required

Translate a message.

Parameters
aMessageThe message object.
aLanguagesThe target languages.
aCompletionBlockThe completion block, which contains the error message if the method fails.

◆ updateMessage:completion:

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

Updates a message in the local database. Latest Message of the conversation and other properties will be updated accordingly. MessageId of the message 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: