HyphenateSDK  3.1.4
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:
 
(EMError *) - loginWithUsername:password:
 
(EMError *) - logout:
 
(EMError *) - bindDeviceToken:
 
(EMError *) - setApnsNickname:
 
(EMPushOptions *) - getPushOptionsFromServerWithError:
 
(EMError *) - updatePushOptionsToServer
 
(EMError *) - uploadLogToServer
 
(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:
 
(BOOL) - dataMigrationTo3
 
(void) - applicationDidEnterBackground:
 
(void) - applicationWillEnterForeground:
 

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

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

Add delegate

Parameters
aDelegateDelegate
aQueueThe queue of call delegate method
- (void) applicationDidEnterBackground: (id)  aApplication

iOS only, should call this method to disconnect from server when app enter backgroup

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

iOS only, should call this method to re-connect to server when app restore to foreground

Parameters
aApplicationUIApplication
- (void) asyncBindDeviceToken: (NSData *)  aDeviceToken
success: (void(^)())  aSuccessBlock
failure: (void(^)(EMError *aError))  aFailureBlock 

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: (void(^)(EMError *aError))  aFailureBlock 

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: (void(^)(EMError *aError))  aFailureBlock 

Login

Parameters
aUsernameUsername
aPasswordPassword
aSuccessBlockThe callback block of success
aFailureBlockThe callback block of failure
- (void) asyncLogout: (BOOL)  aIsUnbindDeviceToken
success: (void(^)())  aSuccessBlock
failure: (void(^)(EMError *aError))  aFailureBlock 

Logout

Parameters
aIsUnbindDeviceTokenWhether unbind device token, device will don't receive message push after unbind token, if input YES, unbind failed will return error
Returns
Error
- (void) asyncRegisterWithUsername: (NSString *)  aUsername
password: (NSString *)  aPassword
success: (void(^)())  aSuccessBlock
failure: (void(^)(EMError *aError))  aFailureBlock 

Register a new user

It is not recommended, advise to register new user through REST API

Parameters
aUsernameUsername
aPasswordPassword
aSuccessBlockThe callback block of success
aFailureBlockThe callback block of failure
- (void) asyncSetApnsNickname: (NSString *)  aNickname
success: (void(^)())  aSuccessBlock
failure: (void(^)(EMError *aError))  aFailureBlock 

Set nick name to show in push message

Parameters
aNicknameNickname
aSuccessBlockThe callback block of success
aFailureBlockThe callback block of failure
- (void) asyncUpdatePushOptionsToServer: (void(^)())  aSuccessBlock
failure: (void(^)(EMError *aError))  aFailureBlock 

Update APNS options to the server

Parameters
aSuccessBlockThe callback block of success
aFailureBlockThe callback block of failure
- (void) asyncUploadLogToServer: (void(^)())  aSuccessBlock
failure: (void(^)(EMError *aError))  aFailureBlock 

Upload log to server

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

Bind device token

Synchronization method will block the current thread

Parameters
aDeviceTokenDevice token to bind
Returns
Error
- (BOOL) dataMigrationTo3

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
- (EMPushOptions *) getPushOptionsFromServerWithError: (EMError **)  pError

Get apns options from the server

Synchronization method will block the current thread

Parameters
pErrorError
Returns
Apns options
- (EMError *) initializeSDKWithOptions: (EMOptions *)  aOptions

Initialization 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
- (EMError *) logout: (BOOL)  aIsUnbindDeviceToken

Logout

Synchronization method will block the current thread

Parameters
aIsUnbindDeviceTokenWhether unbind device token, device will don't receive message push after unbind token, if input YES, unbind failed will return error
Returns
Error
- (EMError *) registerWithUsername: (NSString *)  aUsername
password: (NSString *)  aPassword 

Register a new user

Synchronization method will block the current thread. It is not recommended, advise to register new user through REST API

Parameters
aUsernameUsername
aPasswordPassword
Returns
Error
- (void) removeDelegate: (id)  aDelegate

Remove delegate

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

Set nick name to show in push message

Synchronization method will block the current thread

Parameters
aNicknameNickname
Returns
Error
+ (instancetype) sharedClient

Get SDK single instance

- (EMError *) updatePushOptionsToServer

Update APNS options to the server

Synchronization method will block the current thread

Returns
Error
- (EMError *) uploadLogToServer

Upload 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 module

- (id<IEMContactManager>) contactManager
readnonatomicstrong

Contact module

- (NSString*) currentUsername
readnonatomicstrong

Current logined account

- (id<IEMGroupManager>) groupManager
readnonatomicstrong

Group module

- (BOOL) isAutoLogin
readnonatomicassign

Whether SDK will automatically login last logined account

- (BOOL) isConnected
readnonatomicassign

Whether has connected to chat server

- (BOOL) isLoggedIn
readnonatomicassign

Whether user has logged in

- (EMOptions*) options
readnonatomicstrong

SDK setting options

- (EMPushOptions*) pushOptions
readnonatomicstrong

Apple APNS setting

- (id<IEMChatroomManager>) roomManager
readnonatomicstrong

Chatroom module

- (NSString*) version
readnonatomicstrong

SDK version


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