#import <EMClient.h>
EMClient.h SDK Client
- Author
- Hyphenate
- Version
- 3.00
SDK Client
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
-
aDelegate | Delegate |
aQueue | The queue of calling delegate methods |
- (void) application: |
|
(id) |
application |
didReceiveRemoteNotification: |
|
(NSDictionary *) |
userInfo |
|
|
| |
Need to call this method when APP receive APNs in foreground
- Parameters
-
application | UIApplication |
userInfo | Push content |
- (void) applicationDidEnterBackground: |
|
(id) |
aApplication |
|
Disconnect from server when app enters background
- Parameters
-
aApplication | UIApplication |
- (void) applicationWillEnterForeground: |
|
(id) |
aApplication |
|
Re-connect to server when app enters foreground
- Parameters
-
aApplication | UIApplication |
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: |
|
("Use -getPushOptionsFromServerWithCompletion:") |
__deprecated_msg |
|
|
| |
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: |
|
("Use -loginWithUsername:password:completion") |
__deprecated_msg |
|
|
| |
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: |
|
("Use -logout:completion:") |
__deprecated_msg |
|
|
| |
Logout
- Parameters
-
aIsUnbindDeviceToken | Unbind device token to disable the Apple Push Notification Service |
- Returns
- Error
Register a new user
To enhance the reliability, registering new IM user through REST API from backend is highly recommended
- 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: |
|
("Use -updatePushNotifiationDisplayName:copletion") |
__deprecated_msg |
|
|
| |
Set display name for push notification
- Parameters
-
aDisplayName | Push Notification display name |
aSuccessBlock | The callback block of success |
aFailureBlock | The callback block of failure |
Update APNS options to the server
- Parameters
-
aSuccessBlock | The callback block of success |
aFailureBlock | The callback block of failure |
Upload log to server
- Parameters
-
aSuccessBlock | The callback block of success |
aFailureBlock | The 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
-
aDeviceToken | Device 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
-
- 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
-
aCompletionBlock | The callback block of completion |
- (void) getPushNotificationOptionsFromServerWithCompletion: |
|
(void(^)(EMPushOptions *aOptions, EMError *aError)) |
aCompletionBlock |
|
Get Apple Push Notification Service options from the server
- Parameters
-
aCompletionBlock | The callback block of completion |
Get Apple Push Notification Service options from the server
Synchronization method will block the current thread
- Parameters
-
- Returns
- Apple Push Notification Service options
Initialize the 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
- (void) loginWithUsername: |
|
(NSString *) |
aUsername |
password: |
|
(NSString *) |
aPassword |
completion: |
|
(void(^)(NSString *aUsername, EMError *aError)) |
aCompletionBlock |
|
|
| |
Login
- Parameters
-
aUsername | Username |
aPassword | Password |
aCompletionBlock | The callback block of completion |
- (EMError *) logout: |
|
(BOOL) |
aIsUnbindDeviceToken |
|
Logout
Synchronization method will block the current thread
- Parameters
-
aIsUnbindDeviceToken | Unbind device token to disable Apple Push Notification Service |
- Returns
- Error
- (void) logout: |
|
(BOOL) |
aIsUnbindDeviceToken |
completion: |
|
(void(^)(EMError *aError)) |
aCompletionBlock |
|
|
| |
Logout
- Parameters
-
aIsUnbindDeviceToken | Unbind device token to disable the Apple Push Notification Service |
aCompletionBlock | The 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
-
aDeviceToken | Device token to bind |
aCompletionBlock | The 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
-
aUsername | Username |
aPassword | Password |
- 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
-
aUsername | Username |
aPassword | Password |
aCompletionBlock | The callback block of completion |
- (void) removeDelegate: |
|
(id) |
aDelegate |
|
Remove delegate
- Parameters
-
- (EMError *) setApnsNickname: |
|
(NSString *) |
aNickname |
|
Set display name for Apple Push Notification message
Synchronization method will block the current thread
- Parameters
-
- 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
-
aDisplayName | Display name of push |
aCompletionBlock | The callback block of completion |
- (void) updatePushNotificationOptionsToServerWithCompletion: |
|
(void(^)(EMError *aError)) |
aCompletionBlock |
|
Update Apple Push Notification Service options to the server
- Parameters
-
aCompletionBlock | The 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
-
aCompletionBlock | The callback block of completion |
Upload debugging log to server
Synchronization method will block the current thread
- Returns
- Error
- (NSString*) currentUsername |
|
readnonatomicstrong |
Current logged in user's username
If SDK will automatically log into with previously logged in session
Connection status to Hyphenate IM server
Apple Push Notification Service setting
The documentation for this class was generated from the following file: