logout method Null safety
- [bool unbindDeviceToken = true]
An app user logs out.
Param unbindDeviceToken
Whether to unbind the token when logout.
true
(default) Yes.
false
No.
Throws A description of the exception. See {@link EMError}.
Implementation
Future<void> logout([
bool unbindDeviceToken = true,
]) async {
EMLog.v('logout unbindDeviceToken: $unbindDeviceToken');
Map req = {'unbindToken': unbindDeviceToken};
Map result = await _channel.invokeMethod(ChatMethodKeys.logout, req);
try {
EMError.hasErrorFromResult(result);
_clearAllInfo();
} on EMError catch (e) {
throw e;
}
}