HyphenateSDK  3.6.1
IEMChatManager.h
1 
15 #import <Foundation/Foundation.h>
16 
17 #import "EMCommonDefs.h"
18 #import "EMChatManagerDelegate.h"
19 #import "EMConversation.h"
20 
21 #import "EMMessage.h"
22 #import "EMTextMessageBody.h"
23 #import "EMLocationMessageBody.h"
24 #import "EMCmdMessageBody.h"
25 #import "EMFileMessageBody.h"
26 #import "EMImageMessageBody.h"
27 #import "EMVoiceMessageBody.h"
28 #import "EMVideoMessageBody.h"
29 #import "EMCursorResult.h"
30 
31 
32 @class EMError;
33 
43 @protocol IEMChatManager <NSObject>
44 
45 @required
46 
47 #pragma mark - Delegate
48 
62 - (void)addDelegate:(id<EMChatManagerDelegate>)aDelegate
63  delegateQueue:(dispatch_queue_t)aQueue;
64 
76 - (void)removeDelegate:(id<EMChatManagerDelegate>)aDelegate;
77 
78 #pragma mark - Conversation
79 
91 - (NSArray *)getAllConversations;
92 
112 - (EMConversation *)getConversation:(NSString *)aConversationId
113  type:(EMConversationType)aType
114  createIfNotExist:(BOOL)aIfCreate;
115 
132 - (void)deleteConversation:(NSString *)aConversationId
133  isDeleteMessages:(BOOL)aIsDeleteMessages
134  completion:(void (^)(NSString *aConversationId, EMError *aError))aCompletionBlock;
135 
152 - (void)deleteConversations:(NSArray *)aConversations
153  isDeleteMessages:(BOOL)aIsDeleteMessages
154  completion:(void (^)(EMError *aError))aCompletionBlock;
155 
171 - (void)importConversations:(NSArray *)aConversations
172  completion:(void (^)(EMError *aError))aCompletionBlock;
173 
174 #pragma mark - Message
175 
191 - (NSString *)getMessageAttachmentPath:(NSString *)aConversationId;
192 
207 - (void)importMessages:(NSArray *)aMessages
208  completion:(void (^)(EMError *aError))aCompletionBlock;
209 
224 - (void)updateMessage:(EMMessage *)aMessage
225  completion:(void (^)(EMMessage *aMessage, EMError *aError))aCompletionBlock;
226 
243 - (void)sendMessageReadAck:(EMMessage *)aMessage
244  completion:(void (^)(EMMessage *aMessage, EMError *aError))aCompletionBlock;
245 
263 - (void)recallMessage:(EMMessage *)aMessage
264  completion:(void (^)(EMMessage *aMessage, EMError *aError))aCompletionBlock;
265 
281 - (void)sendMessage:(EMMessage *)aMessage
282  progress:(void (^)(int progress))aProgressBlock
283  completion:(void (^)(EMMessage *message, EMError *error))aCompletionBlock;
284 
300 - (void)resendMessage:(EMMessage *)aMessage
301  progress:(void (^)(int progress))aProgressBlock
302  completion:(void (^)(EMMessage *message, EMError *error))aCompletionBlock;
303 
320 - (void)downloadMessageThumbnail:(EMMessage *)aMessage
321  progress:(void (^)(int progress))aProgressBlock
322  completion:(void (^)(EMMessage *message, EMError *error))aCompletionBlock;
323 
341 - (void)downloadMessageAttachment:(EMMessage *)aMessage
342  progress:(void (^)(int progress))aProgressBlock
343  completion:(void (^)(EMMessage *message, EMError *error))aCompletionBlock;
344 
345 
346 
371 - (EMCursorResult *)fetchHistoryMessagesFromServer:(NSString *)aConversationId
372  conversationType:(EMConversationType)aConversationType
373  startMessageId:(NSString *)aStartMessageId
374  pageSize:(int)aPageSize
375  error:(EMError **)pError;
376 
377 
400 - (void)asyncFetchHistoryMessagesFromServer:(NSString *)aConversationId
401  conversationType:(EMConversationType)aConversationType
402  startMessageId:(NSString *)aStartMessageId
403  pageSize:(int)aPageSize
404  completion:(void (^)(EMCursorResult *aResult, EMError *aError))aCompletionBlock;
405 
406 #pragma mark - EM_DEPRECATED_IOS 3.2.3
407 
419 - (void)addDelegate:(id<EMChatManagerDelegate>)aDelegate EM_DEPRECATED_IOS(3_1_0, 3_2_2, "Use -[IEMChatManager addDelegate:delegateQueue:]");
420 
421 #pragma mark - EM_DEPRECATED_IOS < 3.2.3
422 
438 - (NSArray *)loadAllConversationsFromDB __deprecated_msg("Use -getAllConversations");
439 
457 - (BOOL)deleteConversation:(NSString *)aConversationId
458  deleteMessages:(BOOL)aDeleteMessage __deprecated_msg("Use -deleteConversation:isDeleteMessages:completion:");
459 
477 - (BOOL)deleteConversations:(NSArray *)aConversations
478  deleteMessages:(BOOL)aDeleteMessage __deprecated_msg("Use -deleteConversations:isDeleteMessages:completion:");
479 
495 - (BOOL)importConversations:(NSArray *)aConversations __deprecated_msg("Use -importConversations:completion:");
496 
512 - (BOOL)importMessages:(NSArray *)aMessages __deprecated_msg("Use -importMessages:completion:");
513 
529 - (BOOL)updateMessage:(EMMessage *)aMessage __deprecated_msg("Use -updateMessage:completion:");
530 
546 - (void)asyncSendReadAckForMessage:(EMMessage *)aMessage __deprecated_msg("Use -sendMessageReadAck:completion:");
547 
568 - (void)asyncSendMessage:(EMMessage *)aMessage
569  progress:(void (^)(int progress))aProgressCompletion
570  completion:(void (^)(EMMessage *message, EMError *error))aCompletion __deprecated_msg("Use -sendMessage:progress:completion:");
571 
591 - (void)asyncResendMessage:(EMMessage *)aMessage
592  progress:(void (^)(int progress))aProgressCompletion
593  completion:(void (^)(EMMessage *message, EMError *error))aCompletion __deprecated_msg("Use -resendMessage:progress:completion:");
594 
614 - (void)asyncDownloadMessageThumbnail:(EMMessage *)aMessage
615  progress:(void (^)(int progress))aProgressCompletion
616  completion:(void (^)(EMMessage * message, EMError *error))aCompletion __deprecated_msg("Use -downloadMessageThumbnail:progress:completion:");
617 
637 - (void)asyncDownloadMessageAttachments:(EMMessage *)aMessage
638  progress:(void (^)(int progress))aProgressCompletion
639  completion:(void (^)(EMMessage *message, EMError *error))aCompletion __deprecated_msg("Use -downloadMessageAttachment:progress:completion");
664 - (void)loadMessagesWithType:(EMMessageBodyType)aType
665  timestamp:(long long)aTimestamp
666  count:(int)aCount
667  fromUser:(NSString*)aUsername
668  searchDirection:(EMMessageSearchDirection)aDirection
669  completion:(void (^)(NSArray *aMessages, EMError *aError))aCompletionBlock;
670 
695 - (void)loadMessagesWithKeyword:(NSString*)aKeywords
696  timestamp:(long long)aTimestamp
697  count:(int)aCount
698  fromUser:(NSString*)aSender
699  searchDirection:(EMMessageSearchDirection)aDirection
700  completion:(void (^)(NSArray *aMessages, EMError *aError))aCompletionBlock;
701 
702 @end
Definition: EMChatManagerDelegate.h:27
Definition: EMConversation.h:54
Definition: EMError.h:26
"Use -getAllConversations" __deprecated_msg()
NSArray * getAllConversations()
Definition: EMMessage.h:65
Definition: EMCursorResult.h:24
Definition: IEMChatManager.h:43