isConnected method
~english 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.
~end
~chinese 检查 SDK 是否连接到 Chat 服务器。 Return SDK 是否连接到 Chat 服务器。
true:是;false:否。 ~end
Implementation
Future<bool> isConnected() async {
try {
Map result = await Client.instance.callNativeMethod(
ChatMethodKeys.isConnected,
);
EMError.hasErrorFromResult(result);
return result.boolValue(ChatMethodKeys.isConnected);
} catch (e) {
rethrow;
}
}