AgoraChatSDK 1.0.7
|
#import <IAgoraChatManager.h>
This protocol defines the operations of chat. The current messages are loaded from the local database, not from the server.
|
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.
conversationId | The conversation ID. |
aCompletionBlock | The completion block, which contains the error message if the method fails. |
|
required |
Adds a delegate.
aDelegate | The 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. |
|
required |
Adds a Reaction.
reaction | The Reaction content. |
messageId | The message ID. |
completion | The completion block which contains the error code and error information if the method fails. |
|
required |
Fetches the read back receipt of specified group messages from the server.
This is an asynchronous method.
aMessageId | The message ID which select to fetch. |
aGroupId | The group ID which select to fetch. |
aGroupAckId | The group ack ID which select to fetch. |
aPageSize | The page size. |
aCompletionBlock | The callback block of fetch complete, which contains the error message if the method fails. |
|
required |
Fetches conversation messages from server.
This is an asynchronous method.
aConversationId | The conversation id which select to fetch message. |
aConversationType | The conversation type which select to fetch message. |
aStartMessageId | The start message id, if empty, start from the server last message. |
direction | AgoraChatMessageFetchHistoryDirection up or down |
aPageSize | The page size. limit 50 |
aCompletionBlock | The callback block of fetch complete, which contains the error message if the method fails. |
|
required |
Fetches conversation messages from server.
This is an asynchronous method.
aConversationId | The conversation id which select to fetch message. |
aConversationType | The conversation type which select to fetch message. |
aStartMessageId | The start message id, if empty, start from the server last message. |
aPageSize | The page size. |
aCompletionBlock | The callback block of fetch complete, which contains the error message if the method fails. |
|
required |
Deletes a conversation from the local database.
aConversationId | The conversation ID. |
aIsDeleteMessages | Whether to delete the messages in the conversation.
|
aCompletionBlock | The completion block, which contains the error message if the method call fails. |
|
required |
Deletes multiple conversations.
aConversations | The conversation list. |
aIsDeleteMessages | Whether to delete the messages.
|
aCompletionBlock | The completion block, which contains the error message if the method fails. |
|
required |
Deletes messages with timestamp that is before the specified one.
aTimestamp | The specified Unix timestamp(miliseconds). |
aCompletion | The completion block, which contains the error message if the method fails. |
|
required |
Deletes a conversation from the server.
aConversationId | The conversation ID. |
aConversationType | The conversation type. |
aIsDeleteMessages | Whether to delete the related messages with the conversation.
|
aCompletionBlock | The completion block, which contains the error message if the method call fails. |
|
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.
aMessage | The message object. |
aProgressBlock | The callback block of attachment download progress. |
aCompletionBlock | The completion block, which contains the error message if the method fails. |
|
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.
aMessage | The message object. |
aProgressBlock | The callback block of attachment download progress. |
aCompletionBlock | The completion block, which contains the error message if the method fails. |
|
required |
Fetches conversation messages from server.
aConversationId | The conversation id which select to fetch message. |
aConversationType | The conversation type which select to fetch message. |
aStartMessageId | The start message id, if empty, start from the server‘s last message. |
direction | AgoraChatMessageFetchHistoryDirection up or down |
aPageSize | The page size. |
pError | The error information if the method fails: Error. |
|
required |
Fetches conversation messages from server.
aConversationId | The conversation id which select to fetch message. |
aConversationType | The conversation type which select to fetch message. |
aStartMessageId | The start message id, if empty, start from the server‘s last message. |
aPageSize | The page size. |
pError | The error information if the method fails: Error. |
|
required |
Gets the list of supported languages for translation.
aCompletionBlock | The completion block, which contains the error message if the method fails. |
|
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.
|
required |
Gets a conversation from the local database.
aConversationId | The conversation ID. |
aType | The conversation type (Must be specified). |
aIfCreate | Whether to create the conversation if it does not exist. |
|
required |
Gets a conversation from the local database.
aConversationId | The conversation ID. |
aType | The conversation type (Must be specified). |
aIfCreate | Whether to create the conversation if it does not exist. |
isThread | Whether it is a threadChat type of session |
|
required |
Gets all conversations from the server.
aCompletionBlock | The completion block, which contains the error message if the method fails. |
|
required |
Gets a conversation from the local database.
aConversationId | ␈The conversation ID. |
|
required |
Gets the local path of message attachments in a conversation. Delete the conversation will also delete the files under the file path.
aConversationId | The conversation ID. |
|
required |
Gets the specified message.
aMessageId | The message ID. |
|
required |
Gets the Reaction detail list of a chat group message with pagination.
messageId | The message ID. |
reaction | The Reaction content. |
cursor | The 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. |
pageSize | The number of Reactions that you expect to get on each page. The value cannot exceed 100. |
completion | The completion block, which contains the Reaction list and the cursor for the next query. When the cursor is nil , all data is fetched. |
|
required |
Gets the Reaction list.
messageId | The message ID. |
groupId | The group ID. This parameter is invalid only for group chat. |
chatType | The chat type. Only one-to-one chat (AgoraChatTypeChat and group chat (AgoraChatTypeGroupChat ) are allowed. |
completion | The completion block which contains the error code and error information if the method fails. |
|
required |
Imports multiple conversations to the local database.
aConversations | The conversation list. |
aCompletionBlock | The completion block, which contains the error message if the method fails. |
|
required |
Imports multiple messages to the local database.
aMessages | The message NSArray. |
aCompletionBlock | The completion block, which contains the error message if the method fails. |
|
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.
aKeyword | The keyword for searching the messages. Setting it as nil means that the SDK ignores this parameter. |
aTimestamp | The reference timestamp for the messages to be loaded. If you set this parameter as a negative value, the SDK loads messages from the latest. |
aCount | The number of messages to load. If you set this parameter less than 1, it will be handled as count=1. |
aSender | The user that sends the message. |
aDirection | The message search directions: MessageSearchDirection .
|
|
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.
aKeyword | The keyword for searching the messages. Setting it as nil means that the SDK ignores this parameter. |
aTimestamp | The reference timestamp for the messages to be loaded. If you set this parameter as a negative value, the SDK loads messages from the latest. |
aCount | The 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 * -— |
aSender | The sender of the message. Setting it as nil means that the SDK ignores this parameter. |
aDirection | The message search directions: MessageSearchDirection .
|
aCompletionBlock | The completion block which contains the error code and error information if the method fails. |
|
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.
aType | The message type to load. |
aTimestamp | The reference timestamp for the messages to be loaded. If you set this parameter as a negative value, the SDK loads messages from the latest. |
aCount | The number of messages to load. If you set this parameter less than 1, it will be handled as count=1. |
aUsername | Message sender (optional). Use aUsername=nil to ignore. |
aDirection | The message search directions: MessageSearchDirection .
|
|
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.
aType | The message type to load. |
aTimestamp | The reference timestamp for the messages to be loaded. If you set this parameter as a negative value, the SDK loads messages from the latest. |
aCount | The number of messages to load. If you set this parameter less than 1, it will be handled as count=1 |
aUsername | The user that sends the message. Setting it as nil means that the SDK ignores this parameter. |
aDirection | The message search directions: MessageSearchDirection .
|
aCompletionBlock | The completion block, which contains the error message if the method fails. |
|
required |
Recalls a message.
This is an asynchronous method.
aMessageId | The message ID |
aCompletionBlock | The completion block, which contains the error message if the method fails. |
|
required |
Removes a delegate.
aDelegate | The delegate to be removed. |
|
required |
Removes a Reaction.
reaction | The Reaction content. |
messageId | The message ID. |
completion | The completion block which contains the error code and error information if the method fails. |
|
required |
Report violation message
aMessageId | Violation Message ID |
aTag | Report tag |
aReason | Report reasons |
aCompletion | The callback block of fetch complete |
|
required |
Resends a message.
aMessage | The message object. |
aProgressBlock | The callback block of attachment upload progress. |
aCompletionBlock | The completion block, which contains the error message if the method fails. |
|
required |
Sends the read receipt for a group message.
This is an asynchronous method.
aMessageId | The message ID. |
aGroupId | The group receiver ID. |
aContent | The message content. |
aCompletionBlock | The completion block, which contains the error message if the method fails. |
|
required |
Sends a message.
This is an asynchronous method.
aMessage | The message instance. |
aProgressBlock | The block of attachment upload progress in percentage, 0~100. |
aCompletionBlock | The completion block, which contains the error message if the method fails. |
|
required |
Sends the read receipt for a message.
This is an asynchronous method.
aMessageId | The message ID. |
aUsername | The receiver of the read receipt. |
aCompletionBlock | The completion block, which contains the error message if the method fails. |
|
required |
Translate a message.
aMessage | The message object. |
aLanguages | The target languages. |
aCompletionBlock | The completion block, which contains the error message if the method fails. |
|
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.
aMessage | The message instance. |
aCompletionBlock | The completion block, which contains the error message if the method fails. |