HyphenateSDK  3.1.4
Instance Methods | List of all members
<IEMChatManager> Protocol Reference

#import <IEMChatManager.h>

Inheritance diagram for <IEMChatManager>:

Instance Methods

(void) - addDelegate:delegateQueue:
 
(void) - removeDelegate:
 
(NSArray *) - getAllConversations
 
(NSArray *) - loadAllConversationsFromDB
 
(EMConversation *) - getConversation:type:createIfNotExist:
 
(BOOL) - deleteConversation:deleteMessages:
 
(BOOL) - deleteConversations:deleteMessages:
 
(BOOL) - importConversations:
 
(NSString *) - getMessageAttachmentPath:
 
(BOOL) - importMessages:
 
(BOOL) - updateMessage:
 
(void) - asyncSendReadAckForMessage:
 
(void) - asyncSendMessage:progress:completion:
 
(void) - asyncResendMessage:progress:completion:
 
(void) - asyncDownloadMessageThumbnail:progress:completion:
 
(void) - asyncDownloadMessageAttachments:progress:completion:
 

Detailed Description

Operations of chat

Method Documentation

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

Add delegate

Parameters
aDelegateDelegate
aQueueThe queue of call delegate method
- (void) asyncDownloadMessageAttachments: (EMMessage *)  aMessage
progress: (void(^)(int progress))  aProgressCompletion
completion: (void(^)(EMMessage *message, EMError *error))  aCompletion 
required

Download message attachment(voice, video, image or file), SDK can download voice automatically, so user should NOT download voice manually except automatic download failed

Asynchronous methods

Parameters
aMessageMessage instance
aProgressCompletionThe callback block of attachment download progress
aCompletionThe callback block of download complete
- (void) asyncDownloadMessageThumbnail: (EMMessage *)  aMessage
progress: (void(^)(int progress))  aProgressCompletion
completion: (void(^)(EMMessage *message, EMError *error))  aCompletion 
required

Download message thumbnail attachments (thumbnails of image message or first frame of video image), SDK can download thumbail automatically, so user should NOT download thumbail manually except automatic download failed

Asynchronous methods

Parameters
aMessageMessage instance
aProgressCompletionThe callback block of attachment download progress
aCompletionThe callback block of download complete
- (void) asyncResendMessage: (EMMessage *)  aMessage
progress: (void(^)(int progress))  aProgressCompletion
completion: (void(^)(EMMessage *message, EMError *error))  aCompletion 
required

Resend Message

Asynchronous methods

Parameters
aMessageMessage instance
aProgressCompletionThe callback block of attachment upload progress
aCompletionThe callback block of send complete
- (void) asyncSendMessage: (EMMessage *)  aMessage
progress: (void(^)(int progress))  aProgressCompletion
completion: (void(^)(EMMessage *message, EMError *error))  aCompletion 
required

Send a message

Asynchronous methods

Parameters
aMessageMessage instance
aProgressCompletionThe block of attachment upload progress
aCompletionThe block of send complete
- (void) asyncSendReadAckForMessage: (EMMessage *)  aMessage
required

Send read ack for message

Asynchronous methods

Parameters
aMessageMessage instance
- (BOOL) deleteConversation: (NSString *)  aConversationId
deleteMessages: (BOOL)  aDeleteMessage 
required

Delete a conversation

Parameters
aConversationIdConversation id
aDeleteMessageWhether delete messages
Returns
Whether deleted successfully
- (BOOL) deleteConversations: (NSArray *)  aConversations
deleteMessages: (BOOL)  aDeleteMessage 
required

Delete multiple conversations

Parameters
aConversationsConversation list<EMConversation>
aDeleteMessageWhether delete messages
Returns
Whether deleted successfully
- (NSArray *) getAllConversations
required

Get all conversations, will load conversations from DB if not exist in memory

Returns
Conversation list<EMConversation>
- (EMConversation *) getConversation: (NSString *)  aConversationId
type: (EMConversationType)  aType
createIfNotExist: (BOOL)  aIfCreate 
required

Get a conversation

Parameters
aConversationIdConversation id
aTypeConversation type
aIfCreateWhether create conversation if not exist
Returns
Conversation
- (NSString *) getMessageAttachmentPath: (NSString *)  aConversationId
required

Get message attachment path for the conversation, files in this path will also be deleted when delete the conversation

Parameters
aConversationIdConversation id
Returns
Attachment path
- (BOOL) importConversations: (NSArray *)  aConversations
required

Import multiple conversations to DB

Parameters
aConversationsConversation list<EMConversation>
Returns
Whether imported successfully
- (BOOL) importMessages: (NSArray *)  aMessages
required

Import multiple messages

Parameters
aMessagesMessage list<EMMessage>
Returns
Whether imported successfully
- (NSArray *) loadAllConversationsFromDB
required

Load all conversations from DB, will update conversation list in memory after this method is called

Synchronization method will block the current thread

Returns
Conversation list<EMConversation>
- (void) removeDelegate: (id< EMChatManagerDelegate >)  aDelegate
required

Remove delegate

Parameters
aDelegateDelegate
- (BOOL) updateMessage: (EMMessage *)  aMessage
required

Update message to DB

Parameters
aMessageMessage
Returns
Whether updated successfully

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