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 "IEMTranslateManager.h"
24#import "IEMPresenceManager.h"
25#import "IEMStatisticsManager.h"
27#import "EMDeviceConfig.h"
28#import "EMLocalNotificationManager.h"
29#import "EMTranslationResult.h"
30#import "EMLogDelegate.h"
45typedef NS_ENUM(NSInteger, EMServerCheckType) {
46 EMServerCheckAccountValidation = 0,
47 EMServerCheckGetDNSListFromServer,
48 EMServerCheckGetTokenFromServer,
50 EMServerCheckDoLogout,
75@property(nonatomic, strong, readonly) NSString * _Nonnull version;
84@property(nonatomic, strong, readonly) NSString * _Nullable currentUsername;
93@property(nonatomic, strong, readonly)
EMOptions * _Nonnull options;
102@property(nonatomic, strong, readonly) id<IEMChatManager> _Nullable chatManager;
111@property(nonatomic, strong, readonly) id<IEMContactManager> _Nullable contactManager;
120@property(nonatomic, strong, readonly) id<IEMGroupManager> _Nullable groupManager;
129@property (nonatomic, strong, readonly) id<IEMThreadManager> _Nullable threadManager;
138@property(nonatomic, strong, readonly) id<IEMChatroomManager> _Nullable roomManager;
147@property (nonatomic, strong, readonly) id<IEMPushManager> _Nullable pushManager;
167@property(nonatomic, readonly) BOOL isAutoLogin;
180@property(nonatomic, readonly) BOOL isLoggedIn;
192@property(nonatomic, readonly) BOOL isConnected;
205@property(nonatomic, readonly) NSString * _Nullable accessUserToken;
214@property(nonatomic, strong, readonly) id<IEMUserInfoManager> _Nullable userInfoManager;
223@property (nonatomic, strong, readonly) id<IEMPresenceManager> _Nullable presenceManager;
232@property (nonatomic, strong, readonly) id<IEMStatisticsManager> _Nullable statisticsManager;
234-(instancetype _Nonnull ) init __attribute__((unavailable("call sharedClient instead")));
235-(instancetype _Nonnull ) copy __attribute__((unavailable("call sharedClient instead")));
236-(instancetype _Nonnull ) mutableCopy __attribute__((unavailable("call sharedClient instead")));
244+ (instancetype _Nonnull )sharedClient;
254- (NSString *)version;
256#pragma mark - Delegate
271 delegateQueue:(dispatch_queue_t _Nullable )aQueue;
284- (void)removeDelegate:(
id _Nonnull )aDelegate;
300 delegateQueue:(dispatch_queue_t _Nullable )aQueue NS_SWIFT_NAME(addMultiDevices(delegate:queue:));
315#pragma mark - Initialize SDK
332- (
EMError *_Nullable)initializeSDKWithOptions:(
EMOptions * _Nonnull )aOptions;
334#pragma mark - Change AppKey
357- (
EMError *_Nullable)changeAppkey:(NSString * _Nonnull)aAppkey;
359#pragma mark - User Registration
388- (
EMError *_Nullable)registerWithUsername:(NSString * _Nonnull)aUsername
389 password:(NSString * _Nonnull)aPassword;
415- (void)registerWithUsername:(NSString *_Nonnull)aUsername
416 password:(NSString *_Nonnull)aPassword
417 completion:(
void (^_Nullable)(NSString * _Nonnull aUsername,
EMError * _Nullable aError))aCompletionBlock;
441- (void)fetchTokenWithUsername:(NSString *_Nonnull)aUsername
442 password:(NSString *_Nonnull)aPassword
443 completion:(
void (^_Nullable)(NSString * _Nullable aToken,
EMError * _Nullable aError))aCompletionBlock;
470- (
EMError *_Nullable)loginWithUsername:(NSString *_Nonnull)aUsername
471 password:(NSString *_Nonnull)aPassword EM_DEPRECATED_IOS(3_0_0, 4_5_0,"Use -
EMClient loginWithUsername:token:completion instead");
497- (void)loginWithUsername:(NSString *_Nonnull)aUsername
498 password:(NSString *_Nonnull)aPassword
499 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");
526- (
EMError *_Nullable)loginWithUsername:(NSString *_Nonnull)aUsername
527 token:(NSString *_Nonnull)aToken;
549- (void)loginWithUsername:(NSString *_Nonnull)aUsername
550 token:(NSString *_Nonnull)aToken
551 completion:(
void (^_Nullable)(NSString * _Nonnull aUsername,
EMError *_Nullable aError))aCompletionBlock;
574- (
EMError *_Nullable)loginWithUsername:(NSString *_Nonnull)aUsername
575 agoraToken:(NSString *_Nonnull)aAgoraToken EM_DEPRECATED_IOS(3_8_9, 4_2_0,"Use -
EMClient loginWithUsername:token instead");
598- (void)loginWithUsername:(NSString *_Nonnull)aUsername
599 agoraToken:(NSString *_Nonnull)aAgoraToken
600 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");
625- (
EMError *_Nullable)renewToken:(NSString *_Nonnull)newToken;
650- (void)renewToken:(NSString *_Nonnull)newToken completion:(
void (^_Nullable)(
EMError* _Nullable aError))aCompletionBlock;
678- (
EMError *_Nullable)logout:(BOOL)aIsUnbindDeviceToken;
703- (void)logout:(BOOL)aIsUnbindDeviceToken
704 completion:(
void (^_Nullable)(
EMError * _Nullable aError))aCompletionBlock;
706#pragma mark - PushKit
731- (
EMError *_Nullable)bindPushKitToken:(NSData *_Nullable)aPushToken;
754- (void)registerPushKitToken:(NSData *_Nullable)aPushToken
755 completion:(
void (^_Nullable)(
EMError * _Nullable aError))aCompletionBlock;
780- (
EMError *_Nullable)unBindPushKitToken;
803- (void)unRegisterPushKitTokenWithCompletion:(
void (^_Nullable)(
EMError * _Nullable aError))aCompletionBlock;
831- (
EMError *_Nullable)bindDeviceToken:(NSData *_Nonnull)aDeviceToken;
854- (void)registerForRemoteNotificationsWithDeviceToken:(NSData *_Nonnull)aDeviceToken
855 completion:(
void (^_Nullable)(
EMError *_Nullable aError))aCompletionBlock;
880- (void)registerForRemoteNotificationsWithCertName:(NSString *_Nonnull)aCertName
881 deviceToken:(NSData *_Nonnull)aDeviceToken
882 completion:(
void (^_Nullable)(
EMError *_Nullable aError))aCompletionBlock;
906- (void)bindFCMToken:(NSString* _Nonnull)aFCMToken
907 completion:(
void (^_Nullable)(
EMError *_Nullable aError))aCompletionBlock;
928- (
EMError *_Nullable)uploadLogToServer;
941- (void)uploadDebugLogToServerWithCompletion:(
void (^_Nullable)(
EMError *_Nullable aError))aCompletionBlock;
966- (NSString *_Nullable)getLogFilesPath:(
EMError **_Nullable)pError;
987- (void)getLogFilesPathWithCompletion:(
void (^_Nullable)(NSString *_Nullable aPath,
EMError * _Nullable aError))aCompletionBlock;
1008- (void)log:(NSString *_Nonnull)aLog;
1024 delegateQueue:(dispatch_queue_t _Nullable )aQueue NS_SWIFT_NAME(addLog(delegate:queue:));
1037- (void)removeLogDelegate:(
id<
EMLogDelegate>_Nonnull)aDelegate NS_SWIFT_NAME(removeLog(delegate:));
1039#pragma mark - Multi Devices
1064- (NSArray<
EMDeviceConfig*> *_Nullable)getLoggedInDevicesFromServerWithUsername:(NSString * _Nonnull)aUsername
1065 password:(NSString * _Nonnull)aPassword
1066 error:(
EMError ** _Nullable)pError;
1088- (void)getLoggedInDevicesFromServerWithUsername:(NSString *_Nonnull)aUsername
1089 password:(NSString *_Nonnull)aPassword
1090 completion:(
void (^_Nullable)(NSArray<
EMDeviceConfig*> * _Nullable aList,
EMError *_Nullable aError))aCompletionBlock;
1112- (void)getLoggedInDevicesFromServerWithUserId:(NSString *_Nonnull)aUserID
1113 token:(NSString *_Nonnull)aToken
1114 completion:(
void (^_Nullable)(NSArray<
EMDeviceConfig*> * _Nullable aList,
EMError *_Nullable aError))aCompletionBlock;
1143- (
EMError *_Nullable)kickDeviceWithUsername:(NSString *_Nonnull)aUsername
1144 password:(NSString *_Nonnull)aPassword
1145 resource:(NSString *_Nonnull)aResource;
1173- (void)kickDeviceWithUsername:(NSString *_Nonnull)aUsername
1174 password:(NSString *_Nonnull)aPassword
1175 resource:(NSString *_Nonnull)aResource
1176 completion:(
void (^_Nullable)(
EMError *_Nullable aError))aCompletionBlock;
1203- (void)kickDeviceWithUserId:(NSString *_Nonnull)aUserID
1204 token:(NSString *_Nonnull)aToken
1205 resource:(NSString *_Nonnull)aResource
1206 completion:(
void (^_Nullable)(
EMError *_Nullable aError))aCompletionBlock;
1227- (void)kickAllDevicesWithUserId:(NSString *_Nonnull)aUserID
1228 token:(NSString *_Nonnull)aToken
1229 completion:(
void (^_Nullable)(
EMError *_Nullable aError))aCompletionBlock;
1252- (
EMError *_Nullable)kickAllDevicesWithUsername:(NSString *_Nonnull)aUsername
1253 password:(NSString *_Nonnull)aPassword;
1275- (void)kickAllDevicesWithUsername:(NSString *_Nonnull)aUsername
1276 password:(NSString *_Nonnull)aPassword
1277 completion:(
void (^_Nullable)(
EMError *_Nullable aError))aCompletionBlock;
1308- (void)applicationDidEnterBackground:(
id _Nonnull )aApplication;
1323- (void)applicationWillEnterForeground:(
id _Nonnull )aApplication;
1340- (void)application:(
id _Nonnull)application didReceiveRemoteNotification:(NSDictionary * _Nullable)userInfo;
1342#pragma mark - Service Check
1371- (void)serviceCheckWithUsername:(NSString *_Nonnull)aUsername
1372 password:(NSString *_Nonnull)aPassword
1373 completion:(
void (^_Nullable)(EMServerCheckType aType,
EMError *_Nullable aError))aCompletionBlock __deprecated_msg("This method is deprecated");
1375@property (nonatomic, strong, readonly) id<IEMTranslateManager> _Nonnull translateManager EM_DEPRECATED_IOS(3_8_9, 3_9_5,
"Use -IEMChatManager translateMessage: instead");
Definition: EMClient.h:64
Definition: EMDeviceConfig.h:25
Definition: EMOptions.h:52
Definition: EMPushOptions.h:58
Definition: EMClientDelegate.h:47
Definition: EMLogDelegate.h:18
Definition: EMMultiDevicesDelegate.h:80