disconnect method

Future<void> disconnect()

Disconect the web socket, important to call this to preserve battery power when app goes to background. Usefull when going to background inside the chat screeen. The user will start receiving push notifications for new messages.

Implementation

Future<void> disconnect() async {
  try {
    await _channel.invokeMethod('chat_disconnect');
  } catch (e) {
    print(e);
  }
}