8#import <Foundation/Foundation.h>
10#import "AgoraChatClientDelegate.h"
11#import "AgoraChatError.h"
12#import "AgoraChatMultiDevicesDelegate.h"
13#import "AgoraChatOptions.h"
14#import "AgoraChatPushOptions.h"
16#import "IAgoraChatManager.h"
17#import "IAgoraChatroomManager.h"
18#import "IAgoraChatContactManager.h"
19#import "IAgoraChatGroupManager.h"
20#import "IAgoraChatThreadManager.h"
21#import "IAgoraChatPushManager.h"
22#import "IAgoraChatUserInfoManager.h"
23#import "IAgoraChatTranslateManager.h"
24#import "IAgoraChatPresenceManager.h"
25#import "IAgoraChatStatisticsManager.h"
27#import "AgoraChatDeviceConfig.h"
28#import "AgoraChatLocalNotificationManager.h"
29#import "AgoraChatTranslationResult.h"
30#import "AgoraChatLogDelegate.h"
40typedef NS_ENUM(NSInteger, AgoraChatServerCheckType) {
41 AgoraChatServerCheckAccountValidation = 0,
42 AgoraChatServerCheckGetDNSListFromServer,
43 AgoraChatServerCheckGetTokenFromServer,
44 AgoraChatServerCheckDoLogin,
45 AgoraChatServerCheckDoLogout,
64@property(nonatomic, strong, readonly) NSString * _Nonnull version;
70@property(nonatomic, strong, readonly) NSString * _Nullable currentUsername;
82@property(nonatomic, strong, readonly) id<IAgoraChatManager> _Nullable chatManager;
88@property(nonatomic, strong, readonly) id<IAgoraChatContactManager> _Nullable contactManager;
94@property(nonatomic, strong, readonly) id<IAgoraChatGroupManager> _Nullable groupManager;
100@property (nonatomic, strong, readonly) id<IAgoraChatThreadManager> _Nullable threadManager;
106@property(nonatomic, strong, readonly) id<IAgoraChatroomManager> _Nullable roomManager;
112@property (nonatomic, strong, readonly) id<IAgoraChatPushManager> _Nullable pushManager;
124@property(nonatomic, readonly) BOOL isAutoLogin;
134@property(nonatomic, readonly) BOOL isLoggedIn;
143@property(nonatomic, readonly) BOOL isConnected;
151@property(nonatomic, readonly) NSString * _Nullable accessUserToken;
157@property(nonatomic, strong, readonly) id<IAgoraChatUserInfoManager> _Nullable userInfoManager;
163@property (nonatomic, strong, readonly) id<IAgoraChatPresenceManager> _Nullable presenceManager;
169@property (nonatomic, strong, readonly) id<IAgoraChatStatisticsManager> _Nullable statisticsManager;
175+ (instancetype _Nonnull )sharedClient;
182- (NSString *)version;
184#pragma mark - Delegate
193 delegateQueue:(dispatch_queue_t _Nullable )aQueue;
201- (void)removeDelegate:(
id _Nonnull )aDelegate;
211 delegateQueue:(dispatch_queue_t _Nullable )aQueue NS_SWIFT_NAME(addMultiDevices(delegate:queue:));
221#pragma mark - Initialize SDK
233#pragma mark - Change AppKey
245- (
AgoraChatError *_Nullable)changeAppkey:(NSString * _Nonnull)aAppkey;
247#pragma mark - User Registration
264- (
AgoraChatError *_Nullable)registerWithUsername:(NSString * _Nonnull)aUsername
265 password:(NSString * _Nonnull)aPassword;
280- (void)registerWithUsername:(NSString *_Nonnull)aUsername
281 password:(NSString *_Nonnull)aPassword
282 completion:(
void (^_Nullable)(NSString * _Nonnull aUsername,
AgoraChatError * _Nullable aError))aCompletionBlock;
297- (void)fetchTokenWithUsername:(NSString *_Nonnull)aUsername
298 password:(NSString *_Nonnull)aPassword
299 completion:(
void (^_Nullable)(NSString * _Nullable aToken,
AgoraChatError * _Nullable aError))aCompletionBlock;
314- (
AgoraChatError *_Nullable)loginWithUsername:(NSString *_Nonnull)aUsername
315 password:(NSString *_Nonnull)aPassword;
330- (void)loginWithUsername:(NSString *_Nonnull)aUsername
331 password:(NSString *_Nonnull)aPassword
332 completion:(
void (^_Nullable)(NSString * _Nonnull aUsername,
AgoraChatError *_Nullable aError))aCompletionBlock;
347- (
AgoraChatError *_Nullable)loginWithUsername:(NSString *_Nonnull)aUsername
348 token:(NSString *_Nonnull)aToken;
361- (void)loginWithUsername:(NSString *_Nonnull)aUsername
362 token:(NSString *_Nonnull)aToken
363 completion:(
void (^_Nullable)(NSString * _Nonnull aUsername,
AgoraChatError *_Nullable aError))aCompletionBlock;
376- (
AgoraChatError *_Nullable)loginWithUsername:(NSString *_Nonnull)aUsername
377 agoraToken:(NSString *_Nonnull)aAgoraToken;
391- (void)loginWithUsername:(NSString *_Nonnull)aUsername
392 agoraToken:(NSString *_Nonnull)aAgoraToken
393 completion:(
void (^_Nullable)(NSString * _Nonnull aUsername,
AgoraChatError *_Nullable aError))aCompletionBlock;
407- (
AgoraChatError *_Nullable)renewToken:(NSString *_Nonnull)newAgoraToken;
439- (void)logout:(BOOL)aIsUnbindDeviceToken
440 completion:(
void (^_Nullable)(
AgoraChatError * _Nullable aError))aCompletionBlock;
442#pragma mark - PushKit
456- (
AgoraChatError *_Nullable)bindPushKitToken:(NSData *_Nullable)aPushToken;
469- (void)registerPushKitToken:(NSData *_Nullable)aPushToken
470 completion:(
void (^_Nullable)(
AgoraChatError * _Nullable aError))aCompletionBlock;
498- (void)unRegisterPushKitTokenWithCompletion:(
void (^_Nullable)(
AgoraChatError * _Nullable aError))aCompletionBlock;
514- (
AgoraChatError *_Nullable)bindDeviceToken:(NSData *_Nonnull)aDeviceToken;
527- (void)registerForRemoteNotificationsWithDeviceToken:(NSData *_Nonnull)aDeviceToken
528 completion:(
void (^_Nullable)(
AgoraChatError *_Nullable aError))aCompletionBlock;
541- (void)bindFCMToken:(NSString* _Nonnull)aFCMToken
542 completion:(
void (^_Nullable)(
AgoraChatError *_Nullable aError))aCompletionBlock;
564- (void)uploadDebugLogToServerWithCompletion:(
void (^_Nullable)(
AgoraChatError *_Nullable aError))aCompletionBlock;
578- (NSString *_Nullable)getLogFilesPath:(
AgoraChatError **_Nullable)pError;
590- (void)getLogFilesPathWithCompletion:(
void (^_Nullable)(NSString *_Nullable aPath,
AgoraChatError * _Nullable aError))aCompletionBlock;
602- (void)log:(NSString *_Nonnull)aLog;
612 delegateQueue:(dispatch_queue_t _Nullable )aQueue NS_SWIFT_NAME(addLog(delegate:queue:));
620- (void)removeLogDelegate:(
id<
AgoraChatLogDelegate>_Nonnull)aDelegate NS_SWIFT_NAME(removeLog(delegate:));
622#pragma mark - Multi Devices
636- (NSArray<
AgoraChatDeviceConfig*> *_Nullable)getLoggedInDevicesFromServerWithUsername:(NSString * _Nonnull)aUsername
637 password:(NSString * _Nonnull)aPassword
651- (void)getLoggedInDevicesFromServerWithUsername:(NSString *_Nonnull)aUsername
652 password:(NSString *_Nonnull)aPassword
666- (void)getLoggedInDevicesFromServerWithUserId:(NSString *_Nonnull)aUserID
667 token:(NSString *_Nonnull)aToken
684- (
AgoraChatError *_Nullable)kickDeviceWithUsername:(NSString *_Nonnull)aUsername
685 password:(NSString *_Nonnull)aPassword
686 resource:(NSString *_Nonnull)aResource;
702- (void)kickDeviceWithUsername:(NSString *_Nonnull)aUsername
703 password:(NSString *_Nonnull)aPassword
704 resource:(NSString *_Nonnull)aResource
705 completion:(
void (^_Nullable)(
AgoraChatError *_Nullable aError))aCompletionBlock;
720- (void)kickDeviceWithUserId:(NSString *_Nonnull)aUserID
721 token:(NSString *_Nonnull)aToken
722 resource:(NSString *_Nonnull)aResource
723 completion:(
void (^_Nullable)(
AgoraChatError *_Nullable aError))aCompletionBlock;
735- (void)kickAllDevicesWithUserId:(NSString *_Nonnull)aUserID
736 token:(NSString *_Nonnull)aToken
737 completion:(
void (^_Nullable)(
AgoraChatError *_Nullable aError))aCompletionBlock;
750- (
AgoraChatError *_Nullable)kickAllDevicesWithUsername:(NSString *_Nonnull)aUsername
751 password:(NSString *_Nonnull)aPassword;
763- (void)kickAllDevicesWithUsername:(NSString *_Nonnull)aUsername
764 password:(NSString *_Nonnull)aPassword
765 completion:(
void (^_Nullable)(
AgoraChatError *_Nullable aError))aCompletionBlock;
786- (void)applicationDidEnterBackground:(
id _Nonnull )aApplication;
796- (void)applicationWillEnterForeground:(
id _Nonnull )aApplication;
807- (void)application:(
id _Nonnull)application didReceiveRemoteNotification:(NSDictionary * _Nullable)userInfo;
809#pragma mark - Service Check
825- (void)serviceCheckWithUsername:(NSString *_Nonnull)aUsername
826 password:(NSString *_Nonnull)aPassword
827 completion:(
void (^_Nullable)(AgoraChatServerCheckType aType,
AgoraChatError *_Nullable aError))aCompletionBlock;
829@property (nonatomic, strong, readonly) id<IAgoraChatTranslateManager> _Nonnull translateManager EM_DEPRECATED_IOS(3_8_9, 3_9_5,
"Use -IAgoraChatManager translateMessage: instead");
Definition: AgoraChatClient.h:56
Definition: AgoraChatDeviceConfig.h:16
Definition: AgoraChatError.h:18
Definition: AgoraChatOptions.h:40
Definition: AgoraChatPushOptions.h:40
Definition: AgoraChatClientDelegate.h:32
Definition: AgoraChatLogDelegate.h:15
Definition: AgoraChatMultiDevicesDelegate.h:67