9#import <Foundation/Foundation.h>
11#import "AgoraChatCommonDefs.h"
12#import "AgoraChatManagerDelegate.h"
13#import "AgoraChatConversation.h"
15#import "AgoraChatMessage.h"
16#import "AgoraChatTextMessageBody.h"
17#import "AgoraChatLocationMessageBody.h"
18#import "AgoraChatCmdMessageBody.h"
19#import "AgoraChatFileMessageBody.h"
20#import "AgoraChatImageMessageBody.h"
21#import "AgoraChatVoiceMessageBody.h"
22#import "AgoraChatVideoMessageBody.h"
23#import "AgoraChatCustomMessageBody.h"
24#import "AgoraChatCombineMessageBody.h"
25#import "AgoraChatCursorResult.h"
27#import "AgoraChatGroupMessageAck.h"
28#import "AgoraChatTranslateLanguage.h"
29#import "AgoraChatFetchServerMessagesOption.h"
35typedef NS_ENUM(NSUInteger, AgoraChatMessageFetchHistoryDirection) {
36 AgoraChatMessageFetchHistoryDirectionUp = 0,
37 AgoraChatMessageFetchHistoryDirectionDown
54#pragma mark - Delegate
64 delegateQueue:(dispatch_queue_t _Nullable)aQueue;
74#pragma mark - Conversation
105- (void)getConversationsFromServer:(
void (^_Nullable)(NSArray<
AgoraChatConversation *> * _Nullable aConversations,
AgoraChatError * _Nullable aError))aCompletionBlock EM_DEPRECATED_IOS(4_0_0, "Use -
IAgoraChatManager getConversationsFromServerWithCursor:pageSize:completion");
115- (void)getConversationsFromServerByPage:(NSUInteger)pageNumber
116 pageSize:(NSUInteger)pageSize
154- (void)pinConversation:(nonnull NSString *)conversationId isPinned:(BOOL)isPinned completionBlock:(nullable
void(^)(
AgoraChatError * _Nullable error))completionBlock;
179 type:(AgoraChatConversationType)aType
180 createIfNotExist:(BOOL)aIfCreate;
197 type:(AgoraChatConversationType)aType
198 createIfNotExist:(BOOL)aIfCreate isThread:(BOOL)isThread;
211- (void)deleteConversation:(NSString * _Nonnull)aConversationId
212 isDeleteMessages:(BOOL)aIsDeleteMessages
213 completion:(
void (^_Nullable)(NSString * _Nullable aConversationId,
AgoraChatError *_Nullable aError))aCompletionBlock;
227 - (void)deleteServerConversation:(NSString * _Nonnull)aConversationId
228 conversationType:(AgoraChatConversationType)aConversationType
229 isDeleteServerMessages:(BOOL)aIsDeleteServerMessages
230 completion:(
void (^_Nullable)(NSString * _Nullable aConversationId,
AgoraChatError * _Nullable aError))aCompletionBlock;
244 isDeleteMessages:(BOOL)aIsDeleteMessages
245 completion:(
void (^_Nullable)(
AgoraChatError * _Nullable aError))aCompletionBlock;
256 completion:(
void (^ _Nullable)(
AgoraChatError * _Nullable aError))aCompletionBlock;
258#pragma mark - Message
267- (
AgoraChatMessage * _Nullable)getMessageWithMessageId:(NSString * _Nonnull)aMessageId;
279- (NSString * _Nullable)getMessageAttachmentPath:(NSString * _Nonnull)aConversationId;
290 completion:(
void (^_Nullable)(
AgoraChatError *_Nullable aError))aCompletionBlock;
330- (void)sendMessageReadAck:(NSString * _Nonnull)aMessageId
331 toUser:(NSString * _Nonnull)aUsername
332 completion:(
void (^_Nullable)(
AgoraChatError *_Nullable aError))aCompletionBlock;
347- (void)sendGroupMessageReadAck:(NSString * _Nonnull)aMessageId
348 toGroup:(NSString * _Nonnull)aGroupId
349 content:(NSString * _Nullable)aContent
350 completion:(
void (^_Nullable)(
AgoraChatError *_Nullable aError))aCompletionBlock;
368- (void)ackConversationRead:(NSString * _Nonnull)conversationId
369 completion:(
void (^_Nullable)(
AgoraChatError *_Nullable aError))aCompletionBlock;
381- (void)recallMessageWithMessageId:(NSString *_Nonnull)aMessageId
382 completion:(
void (^_Nullable)(
AgoraChatError *_Nullable aError))aCompletionBlock;
396 progress:(
void (^_Nullable)(
int progress))aProgressBlock
408 progress:(
void (^_Nullable)(
int progress))aProgressBlock
422 progress:(
void (^_Nullable)(
int progress))aProgressBlock
438 progress:(
void (^_Nullable)(
int progress))aProgressBlock
467 conversationType:(AgoraChatConversationType)aConversationType
468 startMessageId:(NSString *_Nullable)aStartMessageId
469 fetchDirection:(AgoraChatMessageFetchHistoryDirection)direction
470 pageSize:(
int)aPageSize
485 conversationType:(AgoraChatConversationType)aConversationType
486 startMessageId:(NSString *_Nullable)aStartMessageId
487 pageSize:(
int)aPageSize
503- (void)asyncFetchHistoryMessagesFromServer:(NSString *_Nonnull)aConversationId
504 conversationType:(AgoraChatConversationType)aConversationType
505 startMessageId:(NSString *_Nullable)aStartMessageId
506 pageSize:(
int)aPageSize
521- (void)asyncFetchHistoryMessagesFromServer:(NSString *_Nonnull)aConversationId
522 conversationType:(AgoraChatConversationType)aConversationType
523 startMessageId:(NSString *_Nullable)aStartMessageId
524 fetchDirection:(AgoraChatMessageFetchHistoryDirection)direction
525 pageSize:(
int)aPageSize
545- (void)asyncFetchGroupMessageAcksFromServer:(NSString *_Nonnull)aMessageId
546 groupId:(NSString *_Nonnull)aGroupId
547 startGroupAckId:(NSString *_Nonnull)aGroupAckId
548 pageSize:(
int)aPageSize
562- (void)reportMessageWithId:(NSString *_Nonnull )aMessageId
563 tag:(NSString *_Nonnull)aTag
564 reason:(NSString *_Nonnull)aReason
565 completion:(
void(^_Nullable)(
AgoraChatError* _Nullable error))aCompletion;
575- (void)deleteMessagesBefore:(NSUInteger)aTimestamp
589- (void)removeMessagesFromServerWithConversation:(
AgoraChatConversation *_Nonnull)conversation messageIds:(NSArray <__kindof NSString*>*_Nonnull)messageIds completion:(
void (^ _Nullable)(
AgoraChatError * _Nullable aError))aCompletionBlock;
599- (void)removeMessagesFromServerWithConversation:(
AgoraChatConversation *_Nonnull)conversation timeStamp:(NSTimeInterval)beforeTimeStamp completion:(
void (^ _Nullable)(
AgoraChatError * _Nullable aError))aCompletionBlock;
611 targetLanguages:(NSArray<NSString*>* _Nonnull)aLanguages
642- (NSArray<
AgoraChatMessage *> * _Nullable)loadMessagesWithType:(AgoraChatMessageBodyType)aType
643 timestamp:(
long long)aTimestamp
645 fromUser:(NSString* _Nullable)aUsername
646 searchDirection:(AgoraChatMessageSearchDirection)aDirection;
664- (void)loadMessagesWithType:(AgoraChatMessageBodyType)aType
665 timestamp:(
long long)aTimestamp
667 fromUser:(NSString*)aUsername
668 searchDirection:(AgoraChatMessageSearchDirection)aDirection
690- (NSArray<
AgoraChatMessage *> *)loadMessagesWithKeyword:(NSString*)aKeywords
691 timestamp:(
long long)aTimestamp
693 fromUser:(NSString*)aSender
694 searchDirection:(AgoraChatMessageSearchDirection)aDirection;
711- (void)loadMessagesWithKeyword:(NSString*)aKeywords
712 timestamp:(
long long)aTimestamp
714 fromUser:(NSString*)aSender
715 searchDirection:(AgoraChatMessageSearchDirection)aDirection
718NS_ASSUME_NONNULL_BEGIN
727- (void)addReaction:(NSString *)reaction toMessage:(NSString *)messageId completion:(nullable
void(^)(
AgoraChatError * _Nullable))completion;
737- (void)removeReaction:(NSString *)reaction fromMessage:(NSString *)messageId completion:(nullable
void(^)(
AgoraChatError * _Nullable))completion;
748- (void)getReactionList:(NSArray <NSString *>*)messageIds
749 groupId:(nullable NSString *)groupId
750 chatType:(AgoraChatType)chatType
763- (void)getReactionDetail:(NSString *)messageId
764 reaction:(NSString *)reaction
765 cursor:(nullable NSString *)cursor
766 pageSize:(uint64_t)pageSize
780- (void)fetchMessagesFromServerBy:(NSString* )conversationId
781 conversationType:(AgoraChatConversationType)type
782 cursor:(NSString* _Nullable)cursor
783 pageSize:(NSUInteger)pageSize
Definition: AgoraChatConversation.h:47
Definition: AgoraChatCursorResult.h:16
Definition: AgoraChatError.h:18
Definition: AgoraChatFetchServerMessagesOption.h:20
Definition: AgoraChatGroupMessageAck.h:18
Definition: AgoraChatMessageBody.h:33
Definition: AgoraChatMessage.h:61
Definition: AgoraChatMessageReaction.h:18
Definition: AgoraChatTranslateLanguage.h:17
Definition: AgoraChatManagerDelegate.h:22
Definition: IAgoraChatManager.h:50
NSArray< AgoraChatConversation * > *_Nullable getAllConversations()