#import <EMClient.h>
EMClient.h SDK Client
- Author
- Hyphenate
- Version
- 3.00
SDK Client
- (void) addDelegate: |
|
(id< EMClientDelegate >) |
aDelegate |
delegateQueue: |
|
(dispatch_queue_t) |
aQueue |
|
|
| |
Add delegate
- Parameters
-
aDelegate | Delegate |
aQueue | The queue of call delegate method |
- (void) applicationDidEnterBackground: |
|
(id) |
aApplication |
|
iOS only, should call this method to disconnect from server when app enter backgroup
- Parameters
-
aApplication | UIApplication |
- (void) applicationWillEnterForeground: |
|
(id) |
aApplication |
|
iOS only, should call this method to re-connect to server when app restore to foreground
- Parameters
-
aApplication | UIApplication |
- (void) asyncBindDeviceToken: |
|
(NSData *) |
aDeviceToken |
success: |
|
(void(^)()) |
aSuccessBlock |
failure: |
|
(void(^)(EMError *aError)) |
aFailureBlock |
|
|
| |
Bind device token
- Parameters
-
aDeviceToken | Device token to bind |
aSuccessBlock | The callback block of success |
aFailureBlock | The callback block of failure |
- (void) asyncGetPushOptionsFromServer: |
|
(void(^)(EMPushOptions *aOptions)) |
aSuccessBlock |
failure: |
|
(void(^)(EMError *aError)) |
aFailureBlock |
|
|
| |
Get apns options from the server
- Parameters
-
aSuccessBlock | The callback block of success |
aFailureBlock | The callback block of failure |
- (void) asyncLoginWithUsername: |
|
(NSString *) |
aUsername |
password: |
|
(NSString *) |
aPassword |
success: |
|
(void(^)()) |
aSuccessBlock |
failure: |
|
(void(^)(EMError *aError)) |
aFailureBlock |
|
|
| |
Login
- Parameters
-
aUsername | Username |
aPassword | Password |
aSuccessBlock | The callback block of success |
aFailureBlock | The callback block of failure |
- (void) asyncLogout: |
|
(BOOL) |
aIsUnbindDeviceToken |
success: |
|
(void(^)()) |
aSuccessBlock |
failure: |
|
(void(^)(EMError *aError)) |
aFailureBlock |
|
|
| |
Logout
- Parameters
-
aIsUnbindDeviceToken | Whether 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
-
aUsername | Username |
aPassword | Password |
aSuccessBlock | The callback block of success |
aFailureBlock | The 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
-
aNickname | Nickname |
aSuccessBlock | The callback block of success |
aFailureBlock | The callback block of failure |
- (void) asyncUpdatePushOptionsToServer: |
|
(void(^)()) |
aSuccessBlock |
failure: |
|
(void(^)(EMError *aError)) |
aFailureBlock |
|
|
| |
Update APNS options to the server
- Parameters
-
aSuccessBlock | The callback block of success |
aFailureBlock | The callback block of failure |
- (void) asyncUploadLogToServer: |
|
(void(^)()) |
aSuccessBlock |
failure: |
|
(void(^)(EMError *aError)) |
aFailureBlock |
|
|
| |
Upload log to server
- Parameters
-
aSuccessBlock | The callback block of success |
aFailureBlock | The callback block of failure |
- (EMError *) bindDeviceToken: |
|
(NSData *) |
aDeviceToken |
|
Bind device token
Synchronization method will block the current thread
- Parameters
-
aDeviceToken | Device 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
Get apns options from the server
Synchronization method will block the current thread
- Parameters
-
- Returns
- Apns options
Initialization sdk
- Parameters
-
aOptions | SDK setting options |
- Returns
- Error
- (EMError *) loginWithUsername: |
|
(NSString *) |
aUsername |
password: |
|
(NSString *) |
aPassword |
|
|
| |
Login
Synchronization method will block the current thread
- Parameters
-
aUsername | Username |
aPassword | Password |
- Returns
- Error
- (EMError *) logout: |
|
(BOOL) |
aIsUnbindDeviceToken |
|
Logout
Synchronization method will block the current thread
- Parameters
-
aIsUnbindDeviceToken | Whether 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
-
aUsername | Username |
aPassword | Password |
- Returns
- Error
- (void) removeDelegate: |
|
(id) |
aDelegate |
|
Remove delegate
- Parameters
-
- (EMError *) setApnsNickname: |
|
(NSString *) |
aNickname |
|
Set nick name to show in push message
Synchronization method will block the current thread
- Parameters
-
- Returns
- Error
+ (instancetype) sharedClient |
|
|
|
- (EMError *) updatePushOptionsToServer |
|
|
|
Update APNS options to the server
Synchronization method will block the current thread
- Returns
- Error
Upload log to server
Synchronization method will block the current thread
- Returns
- Error
- (NSString*) currentUsername |
|
readnonatomicstrong |
Whether SDK will automatically login last logined account
Whether has connected to chat server
Whether user has logged in
The documentation for this class was generated from the following file: