connect static method

Future<bool?> connect(
  1. String host,
  2. String userId,
  3. String token
)

连接IM服务。调用连接之后才可以调用获取数据接口。连接状态会通过连接状态回调返回。 host为IM服务域名或IP,必须im.example.com或114.144.114.144,不带http头和端口。

Implementation

static Future<bool?> connect(String host, String userId, String token) async {
  Map<String, dynamic> args = <String, dynamic>{};
  args.putIfAbsent('host', () => host);
  args.putIfAbsent('userId', () => userId);
  args.putIfAbsent('token', () => token);
  final bool? newDb = await _channel.invokeMethod('connect', args);
  return newDb;
}