logout static method
Implementation
static Future<bool> logout(
{
Function(int? errorCode, String? errorMessage)? errorCallback
}) async
{
if (!_isInitialized(errorCallback: errorCallback)) { return false; }
if (!_checkAuthInfo(errorCallback: errorCallback)) { return false; }
try {
Map<String, dynamic> body = Map.from({});
String url = "/users/logout";
await HttpUtil.postJson(url, body);
stopNotificationWebSocket();
_mUser = null;
await HttpUtil.removeAllSessionData();
} on TPException catch(e) {
Logger.log("$e");
if(errorCallback != null) { errorCallback(e.getCode(), e.getMessage()); }
} catch(e){
Logger.log("$e");
if(errorCallback != null) { errorCallback(-1, e.toString()); }
}
return true;
}