initNativeSdk static method

int initNativeSdk(
  1. String appid,
  2. String secret,
  3. String codes, {
  4. DynamicLibrary? nativeLib,
})

Implementation

static int initNativeSdk(String appid, String secret, String codes,{DynamicLibrary? nativeLib}) {
  nativeLib ??= dynLibrary;

  initDynamicLib(nativeLib!);

  regResponseIf (nativeLib);

  if (kDebugMode) {
    clingNative.cwsEnableLog(1);
  }

  Pointer<SdkRegistration> regParams = malloc<SdkRegistration>();
  regParams.ref.codes = codes.toNativeUtf8();
  final code = clingNative.cwsRegister(appid.toNativeUtf8(), secret.toNativeUtf8(), regParams);
  if (code == 1) {
    clingNative.cwsInit();
  }

  malloc.free(regParams);

  slog('initNativeSdk: exit.');
  return code;
}