init static method

  1. @Deprecated("使用 initWithoutStart() 和 start() 方法替代")
void init(
  1. String appId, {
  2. bool isDebug = true,
  3. int age = 0,
  4. ZJCustomController? customController,
  5. dynamic initListener(
    1. ZJEvent ret
    )?,
})

初始化SDK

Implementation

@Deprecated("使用 initWithoutStart() 和 start() 方法替代")
static void init(

    /// 应用ID
    String appId,
    {
    /// 控制日志打印
    bool isDebug = true,

    /// 用户年龄,默认为0
    int age = 0,

    /// 隐私权限控制
    ZJCustomController? customController,

    /// 初始化回调
    /// [ret.event] {ZJEventAction.initSuccess | ZJEventAction.initFailed},初始化失败时,需要解析ret.code等信息排查
    /// [ret.code] 错误码
    /// [ret.msg] 错误描述
    Function(ZJEvent ret)? initListener}) {
  ZJSdkMessageChannel.init(initListener);
  _sdkMethodChannel.invokeMethod("init", {
    "appId": appId,
    "isDebug": isDebug,
    "age": age,
    "customController": customController?.toMap(),
  });
}