15#import <Foundation/Foundation.h>
17#import "EMCommonDefs.h"
18#import "EMChatManagerDelegate.h"
19#import "EMConversation.h"
21#import "EMChatMessage.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 "EMCustomMessageBody.h"
30#import "EMCursorResult.h"
32#import "EMGroupMessageAck.h"
33#import "EMTranslateLanguage.h"
42typedef NS_ENUM(NSUInteger, EMMessageFetchHistoryDirection) {
43 EMMessageFetchHistoryDirectionUp = 0,
44 EMMessageFetchHistoryDirectionDown
63#pragma mark - Delegate
79 delegateQueue:(dispatch_queue_t _Nullable)aQueue;
94#pragma mark - Conversation
120- (void)getConversationsFromServer:(
void (^_Nullable)(NSArray<
EMConversation *> * _Nullable aConversations,
EMError * _Nullable aError))aCompletionBlock;
137- (
EMConversation *_Nullable)getConversationWithConvId:(NSString * _Nullable)aConversationId;
158- (
EMConversation *_Nullable)getConversation:(NSString *_Nonnull)aConversationId
159 type:(EMConversationType)aType
160 createIfNotExist:(BOOL)aIfCreate;
181- (
EMConversation *_Nullable)getConversation:(NSString *_Nonnull)aConversationId
182 type:(EMConversationType)aType
183 createIfNotExist:(BOOL)aIfCreate isThread:(BOOL)isThread;
206- (
EMConversation *_Nullable)getConversation:(NSString *_Nonnull)aConversationId
207 type:(EMConversationType)iType
208 createIfNotExist:(BOOL)bIfCreate
209 isThread:(BOOL)isThread
210 isChannel:(BOOL)isChannel;
231- (void)deleteConversation:(NSString * _Nonnull)aConversationId
232 isDeleteMessages:(BOOL)aIsDeleteMessages
233 completion:(
void (^_Nullable)(NSString * _Nullable aConversationId,
EMError *_Nullable aError))aCompletionBlock;
257 - (void)deleteServerConversation:(NSString * _Nonnull)aConversationId
258 conversationType:(EMConversationType)aConversationType
259 isDeleteServerMessages:(BOOL)aIsDeleteServerMessages
260 completion:(
void (^_Nullable)(NSString * _Nullable aConversationId,
EMError * _Nullable aError))aCompletionBlock;
282- (void)deleteConversations:(NSArray<
EMConversation *> * _Nullable)aConversations
283 isDeleteMessages:(BOOL)aIsDeleteMessages
284 completion:(
void (^_Nullable)(
EMError * _Nullable aError))aCompletionBlock;
301- (void)importConversations:(NSArray<
EMConversation *> * _Nullable)aConversations
302 completion:(
void (^ _Nullable)(
EMError * _Nullable aError))aCompletionBlock;
304#pragma mark - Message
320- (
EMChatMessage * _Nullable)getMessageWithMessageId:(NSString * _Nonnull)aMessageId;
339- (NSString * _Nullable)getMessageAttachmentPath:(NSString * _Nonnull)aConversationId;
355- (void)importMessages:(NSArray<
EMChatMessage *> * _Nonnull)aMessages
356 completion:(
void (^_Nullable)(
EMError *_Nullable aError))aCompletionBlock;
373 completion:(
void (^_Nullable)(
EMChatMessage * _Nullable aMessage,
EMError * _Nullable aError))aCompletionBlock;
395- (void)sendMessageReadAck:(NSString * _Nonnull)aMessageId
396 toUser:(NSString * _Nonnull)aUsername
397 completion:(
void (^_Nullable)(
EMError *_Nullable aError))aCompletionBlock;
422- (void)sendGroupMessageReadAck:(NSString * _Nonnull)aMessageId
423 toGroup:(NSString * _Nonnull)aGroupId
424 content:(NSString * _Nullable)aContent
425 completion:(
void (^_Nullable)(
EMError *_Nullable aError))aCompletionBlock;
459- (void)ackConversationRead:(NSString * _Nonnull)conversationId
460 completion:(
void (^_Nullable)(
EMError *_Nullable aError))aCompletionBlock;
480- (void)recallMessageWithMessageId:(NSString *_Nonnull)aMessageId
481 completion:(
void (^_Nullable)(
EMError *_Nullable aError))aCompletionBlock;
504 progress:(
void (^_Nullable)(
int progress))aProgressBlock
505 completion:(
void (^_Nullable)(
EMChatMessage *_Nullable message,
EMError *_Nullable error))aCompletionBlock;
523 progress:(
void (^_Nullable)(
int progress))aProgressBlock
524 completion:(
void (^_Nullable)(
EMChatMessage *_Nullable message,
EMError *_Nullable error))aCompletionBlock;
545- (void)downloadMessageThumbnail:(
EMChatMessage *_Nonnull)aMessage
546 progress:(
void (^_Nullable)(
int progress))aProgressBlock
547 completion:(
void (^_Nullable)(
EMChatMessage *_Nullable message,
EMError *_Nullable error))aCompletionBlock;
572- (void)downloadMessageAttachment:(
EMChatMessage *_Nonnull)aMessage
573 progress:(
void (^_Nullable)(
int progress))aProgressBlock
574 completion:(
void (^_Nullable)(
EMChatMessage *_Nullable message,
EMError *_Nullable error))aCompletionBlock;
605 conversationType:(EMConversationType)aConversationType
606 startMessageId:(NSString *_Nullable)aStartMessageId
607 fetchDirection:(EMMessageFetchHistoryDirection)direction
608 pageSize:(
int)aPageSize
609 error:(
EMError **_Nullable)pError;
635 conversationType:(EMConversationType)aConversationType
636 startMessageId:(NSString *_Nullable)aStartMessageId
637 pageSize:(
int)aPageSize
638 error:(
EMError **_Nullable)pError;
665- (void)asyncFetchHistoryMessagesFromServer:(NSString *_Nonnull)aConversationId
666 conversationType:(EMConversationType)aConversationType
667 startMessageId:(NSString *_Nullable)aStartMessageId
668 pageSize:(
int)aPageSize
696- (void)asyncFetchHistoryMessagesFromServer:(NSString *_Nonnull)aConversationId
697 conversationType:(EMConversationType)aConversationType
698 startMessageId:(NSString *_Nullable)aStartMessageId
699 fetchDirection:(EMMessageFetchHistoryDirection)direction
700 pageSize:(
int)aPageSize
730- (void)asyncFetchGroupMessageAcksFromServer:(NSString *_Nonnull)aMessageId
731 groupId:(NSString *_Nonnull)aGroupId
732 startGroupAckId:(NSString *_Nonnull)aGroupAckId
733 pageSize:(
int)aPageSize
756- (void)reportMessageWithId:(NSString *_Nonnull )aMessageId
757 tag:(NSString *_Nonnull)aTag
758 reason:(NSString *_Nonnull)aReason
759 completion:(
void(^_Nullable)(
EMError* _Nullable error))aCompletion;
777- (void)deleteMessagesBefore:(NSUInteger)aTimestamp
778 completion:(
void(^)(
EMError*error))aCompletion;
796- (void)removeMessagesFromServerWithConversation:(
EMConversation *_Nonnull)conversation messageIds:(NSArray <__kindof NSString*>*_Nonnull)messageIds completion:(
void (^ _Nullable)(
EMError * _Nullable aError))aCompletionBlock;
812- (void)removeMessagesFromServerWithConversation:(
EMConversation *_Nonnull)conversation timeStamp:(NSTimeInterval)beforeTimeStamp completion:(
void (^ _Nullable)(
EMError * _Nullable aError))aCompletionBlock;
831 targetLanguages:(NSArray<NSString*>* _Nonnull)aLanguages
832 completion:(
void (^_Nullable)(
EMChatMessage * _Nullable message,
EMError * _Nullable error))aCompletionBlock;
845- (void)fetchSupportedLanguages:(
void(^_Nullable)(NSArray<
EMTranslateLanguage*>* _Nullable languages,
EMError* _Nullable error))aCompletionBlock;
883- (NSArray<
EMChatMessage *> * _Nullable)loadMessagesWithType:(EMMessageBodyType)aType
884 timestamp:(
long long)aTimestamp
886 fromUser:(NSString* _Nullable)aUsername
887 searchDirection:(EMMessageSearchDirection)aDirection;
919- (void)loadMessagesWithType:(EMMessageBodyType)aType
920 timestamp:(
long long)aTimestamp
922 fromUser:(NSString*)aUsername
923 searchDirection:(EMMessageSearchDirection)aDirection
962- (NSArray<
EMChatMessage *> *)loadMessagesWithKeyword:(NSString*)aKeywords
963 timestamp:(
long long)aTimestamp
965 fromUser:(NSString*)aSender
966 searchDirection:(EMMessageSearchDirection)aDirection;
998- (void)loadMessagesWithKeyword:(NSString*)aKeywords
999 timestamp:(
long long)aTimestamp
1001 fromUser:(NSString*)aSender
1002 searchDirection:(EMMessageSearchDirection)aDirection
1005NS_ASSUME_NONNULL_BEGIN
1021- (void)addReaction:(NSString *)reaction toMessage:(NSString *)messageId completion:(nullable
void(^)(
EMError * _Nullable))completion;
1038- (void)removeReaction:(NSString *)reaction fromMessage:(NSString *)messageId completion:(nullable
void(^)(
EMError * _Nullable))completion;
1057- (void)getReactionList:(NSArray <NSString *>*)messageIds
1058 groupId:(nullable NSString *)groupId
1059 chatType:(EMChatType)chatType
1081- (void)getReactionDetail:(NSString *)messageId
1082 reaction:(NSString *)reaction
1083 cursor:(nullable NSString *)cursor
1084 pageSize:(uint64_t)pageSize
1087NS_ASSUME_NONNULL_END
Definition: EMChatMessage.h:82
Definition: EMConversation.h:55
Definition: EMCursorResult.h:27
Definition: EMGroupMessageAck.h:21
Definition: EMMessageReaction.h:21
Definition: EMTranslateLanguage.h:20
Definition: EMChatManagerDelegate.h:31
Definition: IEMChatManager.h:59
NSArray< EMConversation * > *_Nullable getAllConversations()