isConnected method

Future<bool> isConnected()

Checks whether the SDK is connected to the chat server.

Return Whether the SDK is connected to the chat server. true: The SDK is connected to the chat server. false: The SDK is not connected to the chat server.

Implementation

Future<bool> isConnected() async {
  Map result = await ClientChannel.invokeMethod(ChatMethodKeys.isConnected);
  try {
    ChatError.hasErrorFromResult(result);
    return result.boolValue(ChatMethodKeys.isConnected);
  } on ChatError catch (e) {
    throw e;
  }
}