8#import <Foundation/Foundation.h>
10#import "EMClientDelegate.h"
12#import "EMMultiDevicesDelegate.h"
14#import "EMPushOptions.h"
16#import "IEMChatManager.h"
17#import "IEMChatroomManager.h"
18#import "IEMContactManager.h"
19#import "IEMGroupManager.h"
20#import "IEMThreadManager.h"
21#import "IEMPushManager.h"
22#import "IEMUserInfoManager.h"
23#import "IEMPresenceManager.h"
24#import "IEMStatisticsManager.h"
26#import "EMDeviceConfig.h"
27#import "EMLocalNotificationManager.h"
28#import "EMLogDelegate.h"
43typedef NS_ENUM(NSInteger, EMServerCheckType) {
44 EMServerCheckAccountValidation = 0,
45 EMServerCheckGetDNSListFromServer,
46 EMServerCheckGetTokenFromServer,
48 EMServerCheckDoLogout,
73@property(nonatomic, strong, readonly) NSString * _Nonnull version;
82@property(nonatomic, strong, readonly) NSString * _Nullable currentUsername;
91@property(nonatomic, strong, readonly)
EMOptions * _Nonnull options;
100@property(nonatomic, strong, readonly) id<IEMChatManager> _Nullable chatManager;
109@property(nonatomic, strong, readonly) id<IEMContactManager> _Nullable contactManager;
118@property(nonatomic, strong, readonly) id<IEMGroupManager> _Nullable groupManager;
127@property (nonatomic, strong, readonly) id<IEMThreadManager> _Nullable threadManager;
136@property(nonatomic, strong, readonly) id<IEMChatroomManager> _Nullable roomManager;
145@property (nonatomic, strong, readonly) id<IEMPushManager> _Nullable pushManager;
165@property(nonatomic, readonly) BOOL isAutoLogin;
178@property(nonatomic, readonly) BOOL isLoggedIn;
190@property(nonatomic, readonly) BOOL isConnected;
203@property(nonatomic, readonly) NSString * _Nullable accessUserToken;
212@property(nonatomic, strong, readonly) id<IEMUserInfoManager> _Nullable userInfoManager;
221@property (nonatomic, strong, readonly) id<IEMPresenceManager> _Nullable presenceManager;
230@property (nonatomic, strong, readonly) id<IEMStatisticsManager> _Nullable statisticsManager;
232-(instancetype _Nonnull ) init __attribute__((unavailable("call sharedClient instead")));
233-(instancetype _Nonnull ) copy __attribute__((unavailable("call sharedClient instead")));
234-(instancetype _Nonnull ) mutableCopy __attribute__((unavailable("call sharedClient instead")));
242+ (instancetype _Nonnull )sharedClient;
252- (NSString *)version;
254#pragma mark - Delegate
269 delegateQueue:(dispatch_queue_t _Nullable )aQueue;
282- (void)removeDelegate:(
id _Nonnull )aDelegate;
298 delegateQueue:(dispatch_queue_t _Nullable )aQueue NS_SWIFT_NAME(addMultiDevices(delegate:queue:));
313#pragma mark - Initialize SDK
330- (
EMError *_Nullable)initializeSDKWithOptions:(
EMOptions * _Nonnull )aOptions;
332#pragma mark - Change AppKey
355- (
EMError *_Nullable)changeAppkey:(NSString * _Nonnull)aAppkey;
378- (
EMError *_Nullable)changeAppId:(NSString * _Nonnull)aAppId;
380#pragma mark - User Registration
409- (
EMError *_Nullable)registerWithUsername:(NSString * _Nonnull)aUsername
410 password:(NSString * _Nonnull)aPassword;
436- (void)registerWithUsername:(NSString *_Nonnull)aUsername
437 password:(NSString *_Nonnull)aPassword
438 completion:(
void (^_Nullable)(NSString * _Nonnull aUsername,
EMError * _Nullable aError))aCompletionBlock;
462- (void)fetchTokenWithUsername:(NSString *_Nonnull)aUsername
463 password:(NSString *_Nonnull)aPassword
464 completion:(
void (^_Nullable)(NSString * _Nullable aToken,
EMError * _Nullable aError))aCompletionBlock;
491- (
EMError *_Nullable)loginWithUsername:(NSString *_Nonnull)aUsername
492 password:(NSString *_Nonnull)aPassword EM_DEPRECATED_IOS(3_0_0, 4_5_0,"Use -
EMClient loginWithUsername:token:completion instead");
518- (void)loginWithUsername:(NSString *_Nonnull)aUsername
519 password:(NSString *_Nonnull)aPassword
520 completion:(
void (^_Nullable)(NSString * _Nonnull aUsername,
EMError *_Nullable aError))aCompletionBlock EM_DEPRECATED_IOS(3_0_0, 4_5_0,"Use -
EMClient loginWithUsername:token:completion instead");
547- (
EMError *_Nullable)loginWithUsername:(NSString *_Nonnull)aUsername
548 token:(NSString *_Nonnull)aToken;
570- (void)loginWithUsername:(NSString *_Nonnull)aUsername
571 token:(NSString *_Nonnull)aToken
572 completion:(
void (^_Nullable)(NSString * _Nonnull aUsername,
EMError *_Nullable aError))aCompletionBlock;
596- (
EMError *_Nullable)loginWithUsername:(NSString *_Nonnull)aUsername
597 agoraToken:(NSString *_Nonnull)aAgoraToken EM_DEPRECATED_IOS(3_8_9, 4_2_0,"Use -
EMClient loginWithUsername:token instead");
620- (void)loginWithUsername:(NSString *_Nonnull)aUsername
621 agoraToken:(NSString *_Nonnull)aAgoraToken
622 completion:(
void (^_Nullable)(NSString * _Nonnull aUsername,
EMError *_Nullable aError))aCompletionBlock EM_DEPRECATED_IOS(3_8_9, 4_2_0,"Use -
EMClient loginWithUsername:token:completion instead");
647- (
EMError *_Nullable)renewToken:(NSString *_Nonnull)newToken;
672- (void)renewToken:(NSString *_Nonnull)newToken completion:(
void (^_Nullable)(
EMError* _Nullable aError))aCompletionBlock;
700- (
EMError *_Nullable)logout:(BOOL)aIsUnbindDeviceToken;
725- (void)logout:(BOOL)aIsUnbindDeviceToken
726 completion:(
void (^_Nullable)(
EMError * _Nullable aError))aCompletionBlock;
728#pragma mark - PushKit
753- (
EMError *_Nullable)bindPushKitToken:(NSData *_Nullable)aPushToken;
776- (void)registerPushKitToken:(NSData *_Nullable)aPushToken
777 completion:(
void (^_Nullable)(
EMError * _Nullable aError))aCompletionBlock;
802- (
EMError *_Nullable)unBindPushKitToken;
825- (void)unRegisterPushKitTokenWithCompletion:(
void (^_Nullable)(
EMError * _Nullable aError))aCompletionBlock;
853- (
EMError *_Nullable)bindDeviceToken:(NSData *_Nonnull)aDeviceToken;
876- (void)registerForRemoteNotificationsWithDeviceToken:(NSData *_Nonnull)aDeviceToken
877 completion:(
void (^_Nullable)(
EMError *_Nullable aError))aCompletionBlock;
904- (void)getRTCTokenWithChannel:(NSString* _Nullable)aChannelName
905 completion:(
void (^_Nonnull)(NSUInteger rtcUId,NSString * _Nullable aToken,NSInteger expiredTs,
EMError *_Nullable aError))aCompletionBlock;
924- (void)getUserIdByRTCUIds:(NSArray<NSNumber*>* _Nonnull)uIds completion:(
void (^_Nullable)(NSDictionary<NSNumber*,NSString*> * _Nullable accountInfos,
EMError *_Nullable aError))aCompletionBlock;
949- (void)registerForRemoteNotificationsWithCertName:(NSString *_Nonnull)aCertName
950 deviceToken:(NSData *_Nonnull)aDeviceToken
951 completion:(
void (^_Nullable)(
EMError *_Nullable aError))aCompletionBlock;
975- (void)bindFCMToken:(NSString* _Nonnull)aFCMToken
976 completion:(
void (^_Nullable)(
EMError *_Nullable aError))aCompletionBlock;
997- (
EMError *_Nullable)uploadLogToServer;
1010- (void)uploadDebugLogToServerWithCompletion:(
void (^_Nullable)(
EMError *_Nullable aError))aCompletionBlock;
1035- (NSString *_Nullable)getLogFilesPath:(
EMError **_Nullable)pError;
1056- (void)getLogFilesPathWithCompletion:(
void (^_Nullable)(NSString *_Nullable aPath,
EMError * _Nullable aError))aCompletionBlock;
1077- (void)log:(NSString *_Nonnull)aLog;
1093 delegateQueue:(dispatch_queue_t _Nullable )aQueue NS_SWIFT_NAME(addLog(delegate:queue:));
1106- (void)removeLogDelegate:(
id<
EMLogDelegate>_Nonnull)aDelegate NS_SWIFT_NAME(removeLog(delegate:));
1108#pragma mark - Multi Devices
1133- (NSArray<
EMDeviceConfig*> *_Nullable)getLoggedInDevicesFromServerWithUsername:(NSString * _Nonnull)aUsername
1134 password:(NSString * _Nonnull)aPassword
1135 error:(
EMError ** _Nullable)pError;
1157- (void)getLoggedInDevicesFromServerWithUsername:(NSString *_Nonnull)aUsername
1158 password:(NSString *_Nonnull)aPassword
1159 completion:(
void (^_Nullable)(NSArray<
EMDeviceConfig*> * _Nullable aList,
EMError *_Nullable aError))aCompletionBlock;
1181- (void)getLoggedInDevicesFromServerWithUserId:(NSString *_Nonnull)aUserID
1182 token:(NSString *_Nonnull)aToken
1183 completion:(
void (^_Nullable)(NSArray<
EMDeviceConfig*> * _Nullable aList,
EMError *_Nullable aError))aCompletionBlock;
1212- (
EMError *_Nullable)kickDeviceWithUsername:(NSString *_Nonnull)aUsername
1213 password:(NSString *_Nonnull)aPassword
1214 resource:(NSString *_Nonnull)aResource;
1242- (void)kickDeviceWithUsername:(NSString *_Nonnull)aUsername
1243 password:(NSString *_Nonnull)aPassword
1244 resource:(NSString *_Nonnull)aResource
1245 completion:(
void (^_Nullable)(
EMError *_Nullable aError))aCompletionBlock;
1272- (void)kickDeviceWithUserId:(NSString *_Nonnull)aUserID
1273 token:(NSString *_Nonnull)aToken
1274 resource:(NSString *_Nonnull)aResource
1275 completion:(
void (^_Nullable)(
EMError *_Nullable aError))aCompletionBlock;
1296- (void)kickAllDevicesWithUserId:(NSString *_Nonnull)aUserID
1297 token:(NSString *_Nonnull)aToken
1298 completion:(
void (^_Nullable)(
EMError *_Nullable aError))aCompletionBlock;
1321- (
EMError *_Nullable)kickAllDevicesWithUsername:(NSString *_Nonnull)aUsername
1322 password:(NSString *_Nonnull)aPassword;
1344- (void)kickAllDevicesWithUsername:(NSString *_Nonnull)aUsername
1345 password:(NSString *_Nonnull)aPassword
1346 completion:(
void (^_Nullable)(
EMError *_Nullable aError))aCompletionBlock;
1377- (void)applicationDidEnterBackground:(
id _Nonnull )aApplication;
1392- (void)applicationWillEnterForeground:(
id _Nonnull )aApplication;
1409- (void)application:(
id _Nonnull)application didReceiveRemoteNotification:(NSDictionary * _Nullable)userInfo;
1411#pragma mark - Service Check
1440- (void)serviceCheckWithUsername:(NSString *_Nonnull)aUsername
1441 password:(NSString *_Nonnull)aPassword
1442 completion:(
void (^_Nullable)(EMServerCheckType aType,
EMError *_Nullable aError))aCompletionBlock __deprecated_msg("This method is deprecated");
Definition: EMClient.h:62
Definition: EMDeviceConfig.h:25
Definition: EMOptions.h:70
Definition: EMPushOptions.h:58
Definition: EMClientDelegate.h:47
Definition: EMLogDelegate.h:18
Definition: EMMultiDevicesDelegate.h:78