HyphenateSDK  3.3.0
Instance Methods | Class Methods | Protected Attributes | Properties | List of all members
EMClient Class Reference

#import <EMClient.h>

Inheritance diagram for EMClient:

Instance Methods

(void) - addDelegate:delegateQueue:
 
(void) - removeDelegate:
 
(EMError *) - initializeSDKWithOptions:
 
(EMError *) - registerWithUsername:password:
 
(void) - registerWithUsername:password:completion:
 
(EMError *) - loginWithUsername:password:
 
(void) - loginWithUsername:password:completion:
 
(EMError *) - logout:
 
(void) - logout:completion:
 
(EMError *) - bindDeviceToken:
 
(void) - registerForRemoteNotificationsWithDeviceToken:completion:
 
(EMError *) - setApnsNickname:
 
(void) - updatePushNotifiationDisplayName:completion:
 
(EMPushOptions *) - getPushOptionsFromServerWithError:
 
(void) - getPushNotificationOptionsFromServerWithCompletion:
 
(EMError *) - updatePushOptionsToServer
 
(void) - updatePushNotificationOptionsToServerWithCompletion:
 
(EMError *) - uploadLogToServer
 
(void) - uploadDebugLogToServerWithCompletion:
 
(NSString *) - getLogFilesPath:
 
(void) - getLogFilesPathWithCompletion:
 
(BOOL) - migrateDatabaseToLatestSDK
 
(void) - applicationDidEnterBackground:
 
(void) - applicationWillEnterForeground:
 
(void) - application:didReceiveRemoteNotification:
 
(void) - addDelegate:
 
(void) - asyncRegisterWithUsername:password:success:failure:
 
(void) - asyncLoginWithUsername:password:success:failure:
 
(void) - asyncLogout:success:failure:
 
(void) - asyncBindDeviceToken:success:failure:
 
(void) - asyncSetApnsNickname:success:failure:
 
(void) - asyncGetPushOptionsFromServer:failure:
 
(void) - asyncUpdatePushOptionsToServer:failure:
 
(void) - asyncUploadLogToServer:failure:
 
("Use -migrateDatabaseToLatestSDK") - __deprecated_msg
 

Class Methods

(instancetype) + sharedClient
 

Protected Attributes

EMPushOptions_pushOptions
 

Properties

NSString * version
 
NSString * currentUsername
 
EMOptionsoptions
 
EMPushOptionspushOptions
 
id< IEMChatManagerchatManager
 
id< IEMContactManagercontactManager
 
id< IEMGroupManagergroupManager
 
id< IEMChatroomManagerroomManager
 
BOOL isAutoLogin
 
BOOL isLoggedIn
 
BOOL isConnected
 
id< IEMCallManagercallManager
 

Detailed Description

EMClient.h SDK Client

Author
Hyphenate
Version
3.00

SDK Client

Method Documentation

- ("Use -migrateDatabaseToLatestSDK") __deprecated_msg

iOS-specific, data migration to SDK3.0

Synchronization method will block the current thread

It's needed to call this method when update to SDK3.0, developers need to wait this method complete before DB related operations

Returns
Whether migration successful
- (void) addDelegate: (3_1_0) 
(3_2_2) 
("Use -")  EM_DEPRECATED_IOS[IEMCallManager addDelegate:delegateQueue:] 

Add delegate

Parameters
aDelegateDelegate
- (void) addDelegate: (id< EMClientDelegate >)  aDelegate
delegateQueue: (dispatch_queue_t)  aQueue 

Add delegate

Parameters
aDelegateDelegate
aQueueThe queue of calling delegate methods
- (void) application: (id)  application
didReceiveRemoteNotification: (NSDictionary *)  userInfo 

Need to call this method when APP receive APNs in foreground

Parameters
applicationUIApplication
userInfoPush content
- (void) applicationDidEnterBackground: (id)  aApplication

Disconnect from server when app enters background

Parameters
aApplicationUIApplication
- (void) applicationWillEnterForeground: (id)  aApplication

Re-connect to server when app enters foreground

Parameters
aApplicationUIApplication
- (void) asyncBindDeviceToken: (NSData *)  aDeviceToken
success: (void(^)())  aSuccessBlock
failure: ("Use -registerForRemoteNotificationsWithDeviceToken:completion:")  __deprecated_msg 

Bind device token

Parameters
aDeviceTokenDevice token to bind
aSuccessBlockThe callback block of success
aFailureBlockThe callback block of failure
- (void) asyncGetPushOptionsFromServer: (void(^)(EMPushOptions *aOptions))  aSuccessBlock
failure: ("Use -getPushOptionsFromServerWithCompletion:")  __deprecated_msg 

Get apns options from the server

Parameters
aSuccessBlockThe callback block of success
aFailureBlockThe callback block of failure
- (void) asyncLoginWithUsername: (NSString *)  aUsername
password: (NSString *)  aPassword
success: (void(^)())  aSuccessBlock
failure: ("Use -loginWithUsername:password:completion")  __deprecated_msg 

Login

Parameters
aUsernameUsername
aPasswordPassword
aSuccessBlockThe callback block of success
aFailureBlockThe callback block of failure
- (void) asyncLogout: (BOOL)  aIsUnbindDeviceToken
success: (void(^)())  aSuccessBlock
failure: ("Use -logout:completion:")  __deprecated_msg 

Logout

Parameters
aIsUnbindDeviceTokenUnbind device token to disable the Apple Push Notification Service
Returns
Error
- (void) asyncRegisterWithUsername: (NSString *)  aUsername
password: (NSString *)  aPassword
success: (void(^)())  aSuccessBlock
failure: ("Use -registerWithUsername:password:completion:")  __deprecated_msg 

Register a new user

To enhance the reliability, registering new IM user through REST API from backend is highly recommended

Parameters
aUsernameUsername
aPasswordPassword
aSuccessBlockThe callback block of success
aFailureBlockThe callback block of failure
- (void) asyncSetApnsNickname: (NSString *)  aNickname
success: (void(^)())  aSuccessBlock
failure: ("Use -updatePushNotifiationDisplayName:copletion")  __deprecated_msg 

Set display name for push notification

Parameters
aDisplayNamePush Notification display name
aSuccessBlockThe callback block of success
aFailureBlockThe callback block of failure
- (void) asyncUpdatePushOptionsToServer: (void(^)())  aSuccessBlock
failure: ("Use -updatePushNotificationOptionsToServerWithCompletion:")  __deprecated_msg 

Update APNS options to the server

Parameters
aSuccessBlockThe callback block of success
aFailureBlockThe callback block of failure
- (void) asyncUploadLogToServer: (void(^)())  aSuccessBlock
failure: ("Use -uploadDebugLogToServerWithCompletion:")  __deprecated_msg 

Upload log to server

Parameters
aSuccessBlockThe callback block of success
aFailureBlockThe callback block of failure
- (EMError *) bindDeviceToken: (NSData *)  aDeviceToken

Device token binding is required for enabling Apple Push Notification Service

Synchronization method will block the current thread

Parameters
aDeviceTokenDevice token to bind
Returns
Error
- (NSString *) getLogFilesPath: (EMError **)  pError

Compress the log file into a .gz file, return to the gz file path. It is strongly recommended that you remove the gz file after the method completes.

Synchronization method will block the current thread

Parameters
pErrorError
Returns
File path
- (void) getLogFilesPathWithCompletion: (void(^)(NSString *aPath, EMError *aError))  aCompletionBlock

Compress the log file into a .gz file, return to the gz file path. It is strongly recommended that you remove the gz file after the method completes.

Parameters
aCompletionBlockThe callback block of completion
- (void) getPushNotificationOptionsFromServerWithCompletion: (void(^)(EMPushOptions *aOptions, EMError *aError))  aCompletionBlock

Get Apple Push Notification Service options from the server

Parameters
aCompletionBlockThe callback block of completion
- (EMPushOptions *) getPushOptionsFromServerWithError: (EMError **)  pError

Get Apple Push Notification Service options from the server

Synchronization method will block the current thread

Parameters
pErrorError
Returns
Apple Push Notification Service options
- (EMError *) initializeSDKWithOptions: (EMOptions *)  aOptions

Initialize the SDK

Parameters
aOptionsSDK setting options
Returns
Error
- (EMError *) loginWithUsername: (NSString *)  aUsername
password: (NSString *)  aPassword 

Login

Synchronization method will block the current thread

Parameters
aUsernameUsername
aPasswordPassword
Returns
Error
- (void) loginWithUsername: (NSString *)  aUsername
password: (NSString *)  aPassword
completion: (void(^)(NSString *aUsername, EMError *aError))  aCompletionBlock 

Login

Parameters
aUsernameUsername
aPasswordPassword
aCompletionBlockThe callback block of completion
- (EMError *) logout: (BOOL)  aIsUnbindDeviceToken

Logout

Synchronization method will block the current thread

Parameters
aIsUnbindDeviceTokenUnbind device token to disable Apple Push Notification Service
Returns
Error
- (void) logout: (BOOL)  aIsUnbindDeviceToken
completion: (void(^)(EMError *aError))  aCompletionBlock 

Logout

Parameters
aIsUnbindDeviceTokenUnbind device token to disable the Apple Push Notification Service
aCompletionBlockThe callback block of completion
- (BOOL) migrateDatabaseToLatestSDK

Migrate the IM database to the latest SDK version

Synchronization method will block the current thread

Returns
Return YES for success
- (void) registerForRemoteNotificationsWithDeviceToken: (NSData *)  aDeviceToken
completion: (void(^)(EMError *aError))  aCompletionBlock 

Device token binding is required to enable Apple push notification service

Parameters
aDeviceTokenDevice token to bind
aCompletionBlockThe callback block of completion
- (EMError *) registerWithUsername: (NSString *)  aUsername
password: (NSString *)  aPassword 

Register a new IM user

To enhance the reliability, registering new IM user through REST API from backend is highly recommended

Parameters
aUsernameUsername
aPasswordPassword
Returns
Error
- (void) registerWithUsername: (NSString *)  aUsername
password: (NSString *)  aPassword
completion: (void(^)(NSString *aUsername, EMError *aError))  aCompletionBlock 

Register a new IM user

To enhance the reliability, recommend register new IM user via backend using REST API

Parameters
aUsernameUsername
aPasswordPassword
aCompletionBlockThe callback block of completion
- (void) removeDelegate: (id)  aDelegate

Remove delegate

Parameters
aDelegateDelegate
- (EMError *) setApnsNickname: (NSString *)  aNickname

Set display name for Apple Push Notification message

Synchronization method will block the current thread

Parameters
aNicknameDisplay name
Returns
Error
+ (instancetype) sharedClient

Get SDK singleton instance

- (void) updatePushNotifiationDisplayName: (NSString *)  aDisplayName
completion: (void(^)(NSString *aDisplayName, EMError *aError))  aCompletionBlock 

Set display name for the push notification

Parameters
aDisplayNameDisplay name of push
aCompletionBlockThe callback block of completion
- (void) updatePushNotificationOptionsToServerWithCompletion: (void(^)(EMError *aError))  aCompletionBlock

Update Apple Push Notification Service options to the server

Parameters
aCompletionBlockThe callback block of completion
- (EMError *) updatePushOptionsToServer

Update Apple Push Notification Service options to the server

Synchronization method will block the current thread

Returns
Error
- (void) uploadDebugLogToServerWithCompletion: (void(^)(EMError *aError))  aCompletionBlock

Upload log to server

Parameters
aCompletionBlockThe callback block of completion
- (EMError *) uploadLogToServer

Upload debugging log to server

Synchronization method will block the current thread

Returns
Error

Property Documentation

- (id<IEMCallManager>) callManager
readnonatomicstrong

call module

Provided by category EMClient(Call).

- (id<IEMChatManager>) chatManager
readnonatomicstrong

Chat Management

- (id<IEMContactManager>) contactManager
readnonatomicstrong

Contact Management

- (NSString*) currentUsername
readnonatomicstrong

Current logged in user's username

- (id<IEMGroupManager>) groupManager
readnonatomicstrong

Group Management

- (BOOL) isAutoLogin
readnonatomicassign

If SDK will automatically log into with previously logged in session

- (BOOL) isConnected
readnonatomicassign

Connection status to Hyphenate IM server

- (BOOL) isLoggedIn
readnonatomicassign

If a user logged in

- (EMOptions*) options
readnonatomicstrong

SDK setting options

- (EMPushOptions*) pushOptions
readnonatomicstrong

Apple Push Notification Service setting

- (id<IEMChatroomManager>) roomManager
readnonatomicstrong

Chat room Management

- (NSString*) version
readnonatomicstrong

SDK version


The documentation for this class was generated from the following file: