connect static method

Future<void> connect(
  1. String token,
  2. dynamic finished(
    1. int? code,
    2. String? userId
    )?
)

连接 SDK

token 融云 im token

finished 返回 RCErrorCode 以及 userId

Implementation

static Future<void> connect(String token, Function(int? code, String? userId)? finished) async {
  Map resultMap = await _channel.invokeMethod(RCMethodKey.Connect, token);
  int? code = resultMap["code"];
  String? userId = resultMap["userId"];
  if (finished != null) {
    finished(code, userId);
  }
}