initSDK method

Future<V2TimValueCallback<bool>> initSDK({
  1. required int sdkAppID,
  2. required int loglevel,
  3. required Function listener,
})

初始化SDK

参数

@required int sdkAppID	应用 ID,必填项,可以在控制台中获取
@required int loglevel	配置信息
@required [InitListener] listener	SDK的回调

返回

true:成功;
false:失败

Implementation

Future<V2TimValueCallback<bool>> initSDK({
  required int sdkAppID,
  required int loglevel,
  required Function listener,
}) async {
  initSDKListener.add(listener);
  return V2TimValueCallback<bool>.fromJson(
    formatJson(
      await _channel.invokeMethod(
        'initSDK',
        buildParam(
          {
            "sdkAppID": sdkAppID,
            "logLevel": loglevel,
          },
        ),
      ),
    ),
  );
}