logout method
- bool unbindDeviceToken = true
~english Logs out.
Param unbindDeviceToken Whether to unbind the token upon logout.
true (default) Yes.
false No.
Throws A description of the exception. See ChatError. ~end
~chinese 退出登录。
Param unbindDeviceToken 退出时是否解绑设备 token。
- (默认)
true:是。 false:否。
Throws 如果有异常会在这里抛出,包含错误码和错误描述,详见 ChatError。 ~end
Implementation
Future<void> logout([
bool unbindDeviceToken = true,
]) async {
EMLog.v('logout unbindDeviceToken: $unbindDeviceToken');
Map req = {'unbindToken': unbindDeviceToken};
Map result = await ClientChannel.invokeMethod(ChatMethodKeys.logout, req);
try {
ChatError.hasErrorFromResult(result);
_clearAllInfo();
} on ChatError catch (e) {
throw e;
}
}