HyphenateChatSDK 4.2.3
|
#import <IEMChatManager.h>
This protocol that defines the operations of chat.
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 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.
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 |
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 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).
The SDK automatically downloads voice messages. If the automatic download fails, you can call this method to download voice messages manually.
This is an asynchronous method.
aMessage | The message object. |
aProgressBlock | The callback block of attachment download progress. The progress value range is [0,100]. |
aCompletionBlock | The completion block, which contains the error message if the method fails. |
|
required |
Downloads the message thumbnail (the thumbnail of an image or the first frame of a video).
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. The progress value range is [0,100]. |
aCompletionBlock | The completion block, which contains the error message if the method fails. |
|
required |
conversationId | The conversation ID, which is the user ID of the peer user for one-to-one chat, but the group ID for group chat. |
type | The conversation type. You can set this parameter only to EMConversationTypeChat (one-to-one chat) or EMConversationTypeGroupChat (group chat). |
cursor | The cursor position from which to start querying data. |
pageSize | The number of messages that you expect to get on each page. The value range is [1,50]. |
option | The parameter configuration class for pulling historical messages from the server. See EMFetchServerMessagesOption . |
aCompletionBlock | The completion block, which contains the error message if the method fails. |
|
required |
Gets all local conversations.
The SDK loads the conversations from the memory first. If no conversation is found in the memory, the SDK loads from the local database.
|
required |
Gets a conversation from the local database.
aConversationId | The conversation ID. |
aType | The conversation type. |
aIfCreate | Whether to create the conversation if it does not exist:
|
|
required |
Get the list of conversations from the server with pagination.
The SDK retrieves the list of conversations in the reverse chronological order of their active time (the timestamp of the last message).
If there is no message in the conversation, the SDK retrieves the list of conversations in the reverse chronological order of their creation time.
cursor | The position from which to start getting data. If you pass in nil or @"" , the SDK retrieves conversations from the latest active one. |
pageSize | The number of conversations that you expect to get on each page. The value range is [1,50]. |
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 specified message.
aMessageId | The message ID. |
|
required |
Gets the list of pinned conversations from the server with pagination.
The SDK returns the pinned conversations in the reverse chronological order of their pinning.
cursor | The position from which to start getting data. If you pass in nil or @"" , the SDK retrieves conversations from the latest pinned one. |
pageSize | The number of conversations that you expect to get on each page. The value range is [1,50]. |
completionBlock | The completion block, which contains the error message if the method fails. |
|
required |
Sets whether to pin a conversation.
conversationId | The conversation ID. |
isPinned | Whether to pin a conversation:
|
completionBlock | 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 messages in a conversation (from both local storage and the server).
conversation | The EMConversation object. |
messageIds | The specified Unix timestamp in miliseconds. Messages with a timestamp before the specified one will be removed from the conversation. |
completion | 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 callback block of attachment upload progress. The progress value range is [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 user ID of the recipient of the read receipt. |
aCompletionBlock | The completion block, which contains the error message if the method fails. |