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 "IEMCircleManager.h"
26#import "IEMStatisticsManager.h"
28#import "EMDeviceConfig.h"
29#import "EMLocalNotificationManager.h"
30#import "EMTranslationResult.h"
31#import "EMLogDelegate.h"
41typedef NS_ENUM(NSInteger, EMServerCheckType) {
42 EMServerCheckAccountValidation = 0,
43 EMServerCheckGetDNSListFromServer,
44 EMServerCheckGetTokenFromServer,
46 EMServerCheckDoLogout,
70@property(nonatomic, strong, readonly) NSString * _Nonnull version;
79@property(nonatomic, strong, readonly) NSString * _Nullable currentUsername;
88@property(nonatomic, strong, readonly)
EMOptions * _Nonnull options;
97@property(nonatomic, strong, readonly) id<IEMChatManager> _Nullable chatManager;
106@property(nonatomic, strong, readonly) id<IEMContactManager> _Nullable contactManager;
115@property(nonatomic, strong, readonly) id<IEMGroupManager> _Nullable groupManager;
125@property (nonatomic, strong, readonly) id<IEMThreadManager> _Nullable threadManager;
134@property(nonatomic, strong, readonly) id<IEMChatroomManager> _Nullable roomManager;
143@property (nonatomic, strong, readonly) id<IEMPushManager> _Nullable pushManager;
152@property (nonatomic, strong, readonly) id<IEMCircleManager> _Nullable circleManager;
162@property(nonatomic, readonly) BOOL isAutoLogin;
171@property(nonatomic, readonly) BOOL isLoggedIn;
180@property(nonatomic, readonly) BOOL isConnected;
189@property(nonatomic, readonly) NSString * _Nullable accessUserToken;
198@property(nonatomic, strong, readonly) id<IEMUserInfoManager> _Nullable userInfoManager;
207@property (nonatomic, strong, readonly) id<IEMPresenceManager> _Nullable presenceManager;
216@property (nonatomic, strong, readonly) id<IEMStatisticsManager> _Nullable statisticsManager;
225+ (instancetype _Nonnull )sharedClient;
235- (NSString *)version;
237#pragma mark - Delegate
252 delegateQueue:(dispatch_queue_t _Nullable )aQueue;
265- (void)removeDelegate:(
id _Nonnull )aDelegate;
281 delegateQueue:(dispatch_queue_t _Nullable )aQueue NS_SWIFT_NAME(addMultiDevices(delegate:queue:));
296#pragma mark - Initialize SDK
313- (
EMError *_Nullable)initializeSDKWithOptions:(
EMOptions * _Nonnull )aOptions;
315#pragma mark - Change AppKey
334- (
EMError *_Nullable)changeAppkey:(NSString * _Nonnull)aAppkey;
336#pragma mark - User Registeration
363- (
EMError *_Nullable)registerWithUsername:(NSString * _Nonnull)aUsername
364 password:(NSString * _Nonnull)aPassword;
394- (void)registerWithUsername:(NSString *_Nonnull)aUsername
395 password:(NSString *_Nonnull)aPassword
396 completion:(
void (^_Nullable)(NSString * _Nonnull aUsername,
EMError * _Nullable aError))aCompletionBlock;
420- (void)fetchTokenWithUsername:(NSString *_Nonnull)aUsername
421 password:(NSString *_Nonnull)aPassword
422 completion:(
void (^_Nullable)(NSString * _Nullable aToken,
EMError * _Nullable aError))aCompletionBlock;
449- (
EMError *_Nullable)loginWithUsername:(NSString *_Nonnull)aUsername
450 password:(NSString *_Nonnull)aPassword;
476- (void)loginWithUsername:(NSString *_Nonnull)aUsername
477 password:(NSString *_Nonnull)aPassword
478 completion:(
void (^_Nullable)(NSString * _Nonnull aUsername,
EMError *_Nullable aError))aCompletionBlock;
501- (
EMError *_Nullable)loginWithUsername:(NSString *_Nonnull)aUsername
502 token:(NSString *_Nonnull)aToken;
524- (void)loginWithUsername:(NSString *_Nonnull)aUsername
525 token:(NSString *_Nonnull)aToken
526 completion:(
void (^_Nullable)(NSString * _Nonnull aUsername,
EMError *_Nullable aError))aCompletionBlock;
549- (
EMError *_Nullable)loginWithUsername:(NSString *_Nonnull)aUsername
550 agoraToken:(NSString *_Nonnull)aAgoraToken;
569- (void)loginWithUsername:(NSString *_Nonnull)aUsername
570 agoraToken:(NSString *_Nonnull)aAgoraToken
571 completion:(
void (^_Nullable)(NSString * _Nonnull aUsername,
EMError *_Nullable aError))aCompletionBlock;
598- (
EMError *_Nullable)renewToken:(NSString *_Nonnull)newAgoraToken;
621- (
EMError *_Nullable)logout:(BOOL)aIsUnbindDeviceToken;
641- (void)logout:(BOOL)aIsUnbindDeviceToken
642 completion:(
void (^_Nullable)(
EMError * _Nullable aError))aCompletionBlock;
644#pragma mark - PushKit
667- (
EMError *_Nullable)bindPushKitToken:(NSData *_Nullable)aPushToken;
688- (void)registerPushKitToken:(NSData *_Nullable)aPushToken
689 completion:(
void (^_Nullable)(
EMError * _Nullable aError))aCompletionBlock;
708- (
EMError *_Nullable)unBindPushKitToken;
723- (void)unRegisterPushKitTokenWithCompletion:(
void (^_Nullable)(
EMError * _Nullable aError))aCompletionBlock;
748- (
EMError *_Nullable)bindDeviceToken:(NSData *_Nonnull)aDeviceToken;
767- (void)registerForRemoteNotificationsWithDeviceToken:(NSData *_Nonnull)aDeviceToken
768 completion:(
void (^_Nullable)(
EMError *_Nullable aError))aCompletionBlock;
789- (
EMError *_Nullable)uploadLogToServer;
802- (void)uploadDebugLogToServerWithCompletion:(
void (^_Nullable)(
EMError *_Nullable aError))aCompletionBlock;
824- (NSString *_Nullable)getLogFilesPath:(
EMError **_Nullable)pError;
841- (void)getLogFilesPathWithCompletion:(
void (^_Nullable)(NSString *_Nullable aPath,
EMError * _Nullable aError))aCompletionBlock;
858- (void)log:(NSString *_Nonnull)aLog;
874 delegateQueue:(dispatch_queue_t _Nullable )aQueue NS_SWIFT_NAME(addLog(delegate:queue:));
887- (void)removeLogDelegate:(
id<
EMLogDelegate>_Nonnull)aDelegate NS_SWIFT_NAME(removeLog(delegate:));
889#pragma mark - Multi Devices
914- (NSArray<
EMDeviceConfig*> *_Nullable)getLoggedInDevicesFromServerWithUsername:(NSString * _Nonnull)aUsername
915 password:(NSString * _Nonnull)aPassword
916 error:(
EMError ** _Nullable)pError;
938- (void)getLoggedInDevicesFromServerWithUsername:(NSString *_Nonnull)aUsername
939 password:(NSString *_Nonnull)aPassword
940 completion:(
void (^_Nullable)(NSArray<
EMDeviceConfig*> * _Nullable aList,
EMError *_Nullable aError))aCompletionBlock;
965- (
EMError *_Nullable)kickDeviceWithUsername:(NSString *_Nonnull)aUsername
966 password:(NSString *_Nonnull)aPassword
967 resource:(NSString *_Nonnull)aResource;
992- (void)kickDeviceWithUsername:(NSString *_Nonnull)aUsername
993 password:(NSString *_Nonnull)aPassword
994 resource:(NSString *_Nonnull)aResource
995 completion:(
void (^_Nullable)(
EMError *_Nullable aError))aCompletionBlock;
1018- (
EMError *_Nullable)kickAllDevicesWithUsername:(NSString *_Nonnull)aUsername
1019 password:(NSString *_Nonnull)aPassword;
1040- (void)kickAllDevicesWithUsername:(NSString *_Nonnull)aUsername
1041 password:(NSString *_Nonnull)aPassword
1042 completion:(
void (^_Nullable)(
EMError *_Nullable aError))aCompletionBlock;
1076- (BOOL)migrateDatabaseToLatestSDK;
1089- (void)applicationDidEnterBackground:(
id _Nonnull )aApplication;
1102- (void)applicationWillEnterForeground:(
id _Nonnull )aApplication;
1117- (void)application:(
id _Nonnull)application didReceiveRemoteNotification:(NSDictionary * _Nullable)userInfo;
1119#pragma mark - Service Check
1143- (void)serviceCheckWithUsername:(NSString *_Nonnull)aUsername
1144 password:(NSString *_Nonnull)aPassword
1145 completion:(
void (^_Nullable)(EMServerCheckType aType,
EMError *_Nullable aError))aCompletionBlock;
1147@property (nonatomic, strong, readonly) id<IEMTranslateManager> _Nonnull translateManager EM_DEPRECATED_IOS(3_8_9, 3_9_5,
"Use -IEMChatManager translateMessage: instead");
Definition: EMClient.h:59
Definition: EMDeviceConfig.h:25
Definition: EMOptions.h:52
Definition: EMPushOptions.h:58
Definition: EMClientDelegate.h:45
Definition: EMLogDelegate.h:18
Definition: EMMultiDevicesDelegate.h:84