disconnect method

Future<int> disconnect({
  1. bool disablePush = false,
})

Disconnects NCEngine and clears ChatUI session state.

Implementation

Future<int> disconnect({bool disablePush = false}) {
  _connectionGeneration++;
  _acceptingEngineEvents = false;
  _destroyEngineBeforeNextInitialize = true;
  _clearSessionState(clearCurrentUser: true, resetConnectionStatus: true);
  notifyListeners();
  return NCEngine.disconnect(disablePush: disablePush);
}