#import <EMClientDelegate.h>
@abstract EMClientDelegate 提供与账号登录状态相关的回调。
◆ connectionStateDidChange:
| - (void) connectionStateDidChange: |
|
(EMConnectionState) |
aConnectionState |
|
|
optional |
SDK 连接服务器的状态变化时会接收到该回调。
SDK 会在以下情况下触发该回调: 1.登录成功后,设备无法上网时。 2.登录成功后,连接状态发生变化时。
- 参数
-
◆ onDatabaseOpened:username:
| - (void) onDatabaseOpened: |
|
(EMError *_Nullable) |
error |
| username: |
|
(NSString *_Nonnull) |
username |
|
|
| |
|
optional |
登录后的数据库打开结束时触发。同步成功、失败、超时或断连结束时都会触发。
- 参数
-
| error | 错误信息。同步成功时为 nil。 |
| username | 环信用户id |
◆ onOfflineMessageSyncFinish
| - (void) onOfflineMessageSyncFinish |
|
|
|
|
optional |
◆ onOfflineMessageSyncStart
| - (void) onOfflineMessageSyncStart |
|
|
|
|
optional |
◆ syncDataFinished:type:
| - (void) syncDataFinished: |
|
(EMError *_Nullable) |
error |
| type: |
|
(EMDataSyncType) |
type |
|
|
| |
|
optional |
登录后的数据同步结束时触发。同步成功、失败、超时或断连结束时都会触发。
- 参数
-
| error | 错误信息。同步成功时为 nil。 |
| type | 完成同步的数据类型。 |
◆ syncDataStartWithType:
| - (void) syncDataStartWithType: |
|
(EMDataSyncType) |
type |
|
|
optional |
◆ tokenDidExpire:
| - (void) tokenDidExpire: |
|
(EMErrorCode) |
aErrorCode |
|
|
optional |
◆ tokenWillExpire:
| - (void) tokenWillExpire: |
|
(EMErrorCode) |
aErrorCode |
|
|
optional |
◆ userAccountDidForcedToLogout:
| - (void) userAccountDidForcedToLogout: |
|
(EMError *_Nullable) |
aError |
|
|
optional |
当前登录账号被强制退出时会收到该回调,有以下原因:
- 密码被修改;
- 登录设备数过多;
- 服务被封禁;
- 被强制下线;
◆ userAccountDidLoginFromOtherDeviceWithInfo:
当前登录账号在其它设备登录时会接收到此回调。
- 参数
-
| info | 登录设备的设备名称及其扩展信息EMLoginInfo。 |
◆ userAccountDidRemoveFromServer
| - (void) userAccountDidRemoveFromServer |
|
|
|
|
optional |
◆ userDidForbidByServer
| - (void) userDidForbidByServer |
|
|
|
|
optional |
该协议的文档由以下文件生成: