connect static method
连接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;
}