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;
595- (
EMError *_Nullable)loginWithUsername:(NSString *_Nonnull)aUsername
596 agoraToken:(NSString *_Nonnull)aAgoraToken EM_DEPRECATED_IOS(3_8_9, 4_2_0,"Use -
EMClient loginWithUsername:token instead");
619- (void)loginWithUsername:(NSString *_Nonnull)aUsername
620 agoraToken:(NSString *_Nonnull)aAgoraToken
621 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");
646- (
EMError *_Nullable)renewToken:(NSString *_Nonnull)newToken;
671- (void)renewToken:(NSString *_Nonnull)newToken completion:(
void (^_Nullable)(
EMError* _Nullable aError))aCompletionBlock;
699- (
EMError *_Nullable)logout:(BOOL)aIsUnbindDeviceToken;
724- (void)logout:(BOOL)aIsUnbindDeviceToken
725 completion:(
void (^_Nullable)(
EMError * _Nullable aError))aCompletionBlock;
727#pragma mark - PushKit
752- (
EMError *_Nullable)bindPushKitToken:(NSData *_Nullable)aPushToken;
775- (void)registerPushKitToken:(NSData *_Nullable)aPushToken
776 completion:(
void (^_Nullable)(
EMError * _Nullable aError))aCompletionBlock;
801- (
EMError *_Nullable)unBindPushKitToken;
824- (void)unRegisterPushKitTokenWithCompletion:(
void (^_Nullable)(
EMError * _Nullable aError))aCompletionBlock;
852- (
EMError *_Nullable)bindDeviceToken:(NSData *_Nonnull)aDeviceToken;
875- (void)registerForRemoteNotificationsWithDeviceToken:(NSData *_Nonnull)aDeviceToken
876 completion:(
void (^_Nullable)(
EMError *_Nullable aError))aCompletionBlock;
901- (void)registerForRemoteNotificationsWithCertName:(NSString *_Nonnull)aCertName
902 deviceToken:(NSData *_Nonnull)aDeviceToken
903 completion:(
void (^_Nullable)(
EMError *_Nullable aError))aCompletionBlock;
927- (void)bindFCMToken:(NSString* _Nonnull)aFCMToken
928 completion:(
void (^_Nullable)(
EMError *_Nullable aError))aCompletionBlock;
949- (
EMError *_Nullable)uploadLogToServer;
962- (void)uploadDebugLogToServerWithCompletion:(
void (^_Nullable)(
EMError *_Nullable aError))aCompletionBlock;
987- (NSString *_Nullable)getLogFilesPath:(
EMError **_Nullable)pError;
1008- (void)getLogFilesPathWithCompletion:(
void (^_Nullable)(NSString *_Nullable aPath,
EMError * _Nullable aError))aCompletionBlock;
1029- (void)log:(NSString *_Nonnull)aLog;
1045 delegateQueue:(dispatch_queue_t _Nullable )aQueue NS_SWIFT_NAME(addLog(delegate:queue:));
1058- (void)removeLogDelegate:(
id<
EMLogDelegate>_Nonnull)aDelegate NS_SWIFT_NAME(removeLog(delegate:));
1060#pragma mark - Multi Devices
1085- (NSArray<
EMDeviceConfig*> *_Nullable)getLoggedInDevicesFromServerWithUsername:(NSString * _Nonnull)aUsername
1086 password:(NSString * _Nonnull)aPassword
1087 error:(
EMError ** _Nullable)pError;
1109- (void)getLoggedInDevicesFromServerWithUsername:(NSString *_Nonnull)aUsername
1110 password:(NSString *_Nonnull)aPassword
1111 completion:(
void (^_Nullable)(NSArray<
EMDeviceConfig*> * _Nullable aList,
EMError *_Nullable aError))aCompletionBlock;
1133- (void)getLoggedInDevicesFromServerWithUserId:(NSString *_Nonnull)aUserID
1134 token:(NSString *_Nonnull)aToken
1135 completion:(
void (^_Nullable)(NSArray<
EMDeviceConfig*> * _Nullable aList,
EMError *_Nullable aError))aCompletionBlock;
1164- (
EMError *_Nullable)kickDeviceWithUsername:(NSString *_Nonnull)aUsername
1165 password:(NSString *_Nonnull)aPassword
1166 resource:(NSString *_Nonnull)aResource;
1194- (void)kickDeviceWithUsername:(NSString *_Nonnull)aUsername
1195 password:(NSString *_Nonnull)aPassword
1196 resource:(NSString *_Nonnull)aResource
1197 completion:(
void (^_Nullable)(
EMError *_Nullable aError))aCompletionBlock;
1224- (void)kickDeviceWithUserId:(NSString *_Nonnull)aUserID
1225 token:(NSString *_Nonnull)aToken
1226 resource:(NSString *_Nonnull)aResource
1227 completion:(
void (^_Nullable)(
EMError *_Nullable aError))aCompletionBlock;
1248- (void)kickAllDevicesWithUserId:(NSString *_Nonnull)aUserID
1249 token:(NSString *_Nonnull)aToken
1250 completion:(
void (^_Nullable)(
EMError *_Nullable aError))aCompletionBlock;
1273- (
EMError *_Nullable)kickAllDevicesWithUsername:(NSString *_Nonnull)aUsername
1274 password:(NSString *_Nonnull)aPassword;
1296- (void)kickAllDevicesWithUsername:(NSString *_Nonnull)aUsername
1297 password:(NSString *_Nonnull)aPassword
1298 completion:(
void (^_Nullable)(
EMError *_Nullable aError))aCompletionBlock;
1329- (void)applicationDidEnterBackground:(
id _Nonnull )aApplication;
1344- (void)applicationWillEnterForeground:(
id _Nonnull )aApplication;
1361- (void)application:(
id _Nonnull)application didReceiveRemoteNotification:(NSDictionary * _Nullable)userInfo;
1363#pragma mark - Service Check
1392- (void)serviceCheckWithUsername:(NSString *_Nonnull)aUsername
1393 password:(NSString *_Nonnull)aPassword
1394 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:52
Definition: EMPushOptions.h:58
Definition: EMClientDelegate.h:47
Definition: EMLogDelegate.h:18
Definition: EMMultiDevicesDelegate.h:80