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 EMError. ~end
~chinese 退出登录。
Param unbindDeviceToken 退出时是否解绑设备 token。
- (默认)
true:是。 false:否。
Throws 如果有异常会在这里抛出,包含错误码和错误描述,详见 EMError。 ~end
Implementation
Future<void> logout([
bool unbindDeviceToken = true,
]) async {
try {
EMLog.v('logout unbindDeviceToken: $unbindDeviceToken');
Map req = {'unbindToken': unbindDeviceToken};
Map result =
await Client.instance.callNativeMethod(ChatMethodKeys.logout, req);
EMError.hasErrorFromResult(result);
_clearAllInfo();
} catch (e) {
rethrow;
}
}