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;
171-(instancetype _Nonnull ) init __attribute__((unavailable("call sharedClient instead")));
172-(instancetype _Nonnull ) copy __attribute__((unavailable("call sharedClient instead")));
173-(instancetype _Nonnull ) mutableCopy __attribute__((unavailable("call sharedClient instead")));
178+ (instancetype _Nonnull )sharedClient;
185- (NSString *)version;
187#pragma mark - Delegate
196 delegateQueue:(dispatch_queue_t _Nullable )aQueue;
204- (void)removeDelegate:(
id _Nonnull )aDelegate;
214 delegateQueue:(dispatch_queue_t _Nullable )aQueue NS_SWIFT_NAME(addMultiDevices(delegate:queue:));
224#pragma mark - Initialize SDK
236#pragma mark - Change AppKey
248- (
AgoraChatError *_Nullable)changeAppkey:(NSString * _Nonnull)aAppkey;
250#pragma mark - User Registration
267- (
AgoraChatError *_Nullable)registerWithUsername:(NSString * _Nonnull)aUsername
268 password:(NSString * _Nonnull)aPassword;
283- (void)registerWithUsername:(NSString *_Nonnull)aUsername
284 password:(NSString *_Nonnull)aPassword
285 completion:(
void (^_Nullable)(NSString * _Nonnull aUsername,
AgoraChatError * _Nullable aError))aCompletionBlock;
300- (void)fetchTokenWithUsername:(NSString *_Nonnull)aUsername
301 password:(NSString *_Nonnull)aPassword
302 completion:(
void (^_Nullable)(NSString * _Nullable aToken,
AgoraChatError * _Nullable aError))aCompletionBlock;
317- (
AgoraChatError *_Nullable)loginWithUsername:(NSString *_Nonnull)aUsername
318 password:(NSString *_Nonnull)aPassword EM_DEPRECATED_IOS(3_0_0, 4_5_0,"Use -
AgoraChatClient loginWithUsername:token:completion instead");
333- (void)loginWithUsername:(NSString *_Nonnull)aUsername
334 password:(NSString *_Nonnull)aPassword
335 completion:(
void (^_Nullable)(NSString * _Nonnull aUsername,
AgoraChatError *_Nullable aError))aCompletionBlock EM_DEPRECATED_IOS(3_0_0, 4_5_0,"Use -
AgoraChatClient loginWithUsername:token:completion instead");
350- (
AgoraChatError *_Nullable)loginWithUsername:(NSString *_Nonnull)aUsername
351 token:(NSString *_Nonnull)aToken;
364- (void)loginWithUsername:(NSString *_Nonnull)aUsername
365 token:(NSString *_Nonnull)aToken
366 completion:(
void (^_Nullable)(NSString * _Nonnull aUsername,
AgoraChatError *_Nullable aError))aCompletionBlock;
379- (
AgoraChatError *_Nullable)loginWithUsername:(NSString *_Nonnull)aUsername
380 agoraToken:(NSString *_Nonnull)aAgoraToken EM_DEPRECATED_IOS(3_8_9, 4_2_0,"Use -
AgoraChatClient loginWithUsername:token instead");
394- (void)loginWithUsername:(NSString *_Nonnull)aUsername
395 agoraToken:(NSString *_Nonnull)aAgoraToken
396 completion:(
void (^_Nullable)(NSString * _Nonnull aUsername,
AgoraChatError *_Nullable aError))aCompletionBlock EM_DEPRECATED_IOS(3_8_9, 4_2_0,"Use -
AgoraChatClient loginWithUsername:token:completion instead");
410- (
AgoraChatError *_Nullable)renewToken:(NSString *_Nonnull)newToken;
424- (void)renewToken:(NSString *_Nonnull)newToken completion:(
void (^_Nullable)(
AgoraChatError* _Nullable aError))aCompletionBlock;
456- (void)logout:(BOOL)aIsUnbindDeviceToken
457 completion:(
void (^_Nullable)(
AgoraChatError * _Nullable aError))aCompletionBlock;
459#pragma mark - PushKit
473- (
AgoraChatError *_Nullable)bindPushKitToken:(NSData *_Nullable)aPushToken;
486- (void)registerPushKitToken:(NSData *_Nullable)aPushToken
487 completion:(
void (^_Nullable)(
AgoraChatError * _Nullable aError))aCompletionBlock;
515- (void)unRegisterPushKitTokenWithCompletion:(
void (^_Nullable)(
AgoraChatError * _Nullable aError))aCompletionBlock;
531- (
AgoraChatError *_Nullable)bindDeviceToken:(NSData *_Nonnull)aDeviceToken;
544- (void)registerForRemoteNotificationsWithDeviceToken:(NSData *_Nonnull)aDeviceToken
545 completion:(
void (^_Nullable)(
AgoraChatError *_Nullable aError))aCompletionBlock;
559- (void)registerForRemoteNotificationsWithCertName:(NSString *_Nonnull)aCertName
560 deviceToken:(NSData *_Nonnull)aDeviceToken
561 completion:(
void (^_Nullable)(
AgoraChatError *_Nullable aError))aCompletionBlock;
574- (void)bindFCMToken:(NSString* _Nonnull)aFCMToken
575 completion:(
void (^_Nullable)(
AgoraChatError *_Nullable aError))aCompletionBlock;
597- (void)uploadDebugLogToServerWithCompletion:(
void (^_Nullable)(
AgoraChatError *_Nullable aError))aCompletionBlock;
611- (NSString *_Nullable)getLogFilesPath:(
AgoraChatError **_Nullable)pError;
623- (void)getLogFilesPathWithCompletion:(
void (^_Nullable)(NSString *_Nullable aPath,
AgoraChatError * _Nullable aError))aCompletionBlock;
635- (void)log:(NSString *_Nonnull)aLog;
645 delegateQueue:(dispatch_queue_t _Nullable )aQueue NS_SWIFT_NAME(addLog(delegate:queue:));
653- (void)removeLogDelegate:(
id<
AgoraChatLogDelegate>_Nonnull)aDelegate NS_SWIFT_NAME(removeLog(delegate:));
655#pragma mark - Multi Devices
669- (NSArray<
AgoraChatDeviceConfig*> *_Nullable)getLoggedInDevicesFromServerWithUsername:(NSString * _Nonnull)aUsername
670 password:(NSString * _Nonnull)aPassword
684- (void)getLoggedInDevicesFromServerWithUsername:(NSString *_Nonnull)aUsername
685 password:(NSString *_Nonnull)aPassword
699- (void)getLoggedInDevicesFromServerWithUserId:(NSString *_Nonnull)aUserID
700 token:(NSString *_Nonnull)aToken
717- (
AgoraChatError *_Nullable)kickDeviceWithUsername:(NSString *_Nonnull)aUsername
718 password:(NSString *_Nonnull)aPassword
719 resource:(NSString *_Nonnull)aResource;
735- (void)kickDeviceWithUsername:(NSString *_Nonnull)aUsername
736 password:(NSString *_Nonnull)aPassword
737 resource:(NSString *_Nonnull)aResource
738 completion:(
void (^_Nullable)(
AgoraChatError *_Nullable aError))aCompletionBlock;
753- (void)kickDeviceWithUserId:(NSString *_Nonnull)aUserID
754 token:(NSString *_Nonnull)aToken
755 resource:(NSString *_Nonnull)aResource
756 completion:(
void (^_Nullable)(
AgoraChatError *_Nullable aError))aCompletionBlock;
768- (void)kickAllDevicesWithUserId:(NSString *_Nonnull)aUserID
769 token:(NSString *_Nonnull)aToken
770 completion:(
void (^_Nullable)(
AgoraChatError *_Nullable aError))aCompletionBlock;
783- (
AgoraChatError *_Nullable)kickAllDevicesWithUsername:(NSString *_Nonnull)aUsername
784 password:(NSString *_Nonnull)aPassword;
796- (void)kickAllDevicesWithUsername:(NSString *_Nonnull)aUsername
797 password:(NSString *_Nonnull)aPassword
798 completion:(
void (^_Nullable)(
AgoraChatError *_Nullable aError))aCompletionBlock;
819- (void)applicationDidEnterBackground:(
id _Nonnull )aApplication;
829- (void)applicationWillEnterForeground:(
id _Nonnull )aApplication;
840- (void)application:(
id _Nonnull)application didReceiveRemoteNotification:(NSDictionary * _Nullable)userInfo;
842#pragma mark - Service Check
858- (void)serviceCheckWithUsername:(NSString *_Nonnull)aUsername
859 password:(NSString *_Nonnull)aPassword
860 completion:(
void (^_Nullable)(AgoraChatServerCheckType aType,
AgoraChatError *_Nullable aError))aCompletionBlock __deprecated_msg("This method is deprecated");
862@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:33
Definition: AgoraChatLogDelegate.h:15
Definition: AgoraChatMultiDevicesDelegate.h:69