initSDK method

Future<bool> initSDK({
  1. required int sdkAppID,
  2. LogLevelEnum? logLevel,
  3. V2TimSDKListener? sdkListener,
})

Implementation

Future<bool> initSDK({
  required int sdkAppID,
  LogLevelEnum? logLevel,
  V2TimSDKListener? sdkListener,
}) async {
  logLevel ??= LogLevelEnum.V2TIM_LOG_DEBUG;

  V2TimValueCallback<bool> initRes = await _manager.initSDK(
    sdkAppID: sdkAppID,
    loglevel: logLevel,
    listener: getInitSDKListener(sdkListener),
  );

  bool res = initRes.data ?? false;

  if (res) {
    TencentCloudChat.instance.dataInstance.basic.updateInitializedStatus(
      status: true,
    );
    TencentCloudChat.instance.dataInstance.basic.updateSDKAppID(
      sdkappid: sdkAppID,
    );
  }

  TencentCloudChat.instance.logInstance.console(
    componentName: _tag,
    logs: "initSDK Is Called. Res Is $res",
  );

  return res;
}