init static method

Future<void> init({
  1. required String iOSKey,
  2. required String androidKey,
  3. String? channel,
  4. bool logEnable = false,
  5. bool encryptEnable = false,
  6. bool autoPageEnable = false,
})

初始化组件

channel 渠道标识,可设置为null表示'App Store'。 logEnable 设置是否在console输出SDK的log信息。默认false,不输出log;设置为true,输出可供调试参考的log信息。发布产品时必须设置为false。 encryptEnable 设置是否对统计信息进行加密传输。默认为false,设置为true,SDK会将日志信息做加密处理。 autoPageEnable 设置页面统计采集方式。默认为false(手动模式)。

Implementation

static Future<void> init({
  required String iOSKey,
  required String androidKey,
  String? channel,
  bool logEnable = false,
  bool encryptEnable = false,
  bool autoPageEnable = false,
}) async {
  final Map<String, dynamic> params = {
    'iOSKey': iOSKey,
    'androidKey': androidKey,
    'channel': channel,
    'logEnable': logEnable,
    'encryptEnable': encryptEnable,
    'autoPageEnable': autoPageEnable,
  };

  return _channel.invokeMethod<void>('init', params);
}