initialize static method

Future<void> initialize({
  1. required String androidAppKey,
  2. required String iosAppKey,
  3. required String channel,
  4. bool logEnabled = false,
  5. bool encryptEnabled = true,
})

初始化友盟统计 SDK

androidAppKey : Android平台的AppKey iosAppKey : iOS平台的AppKey channel : 渠道标识,可随意填写,但不能为空 logEnabled : 是否开启日志打印(建议调试时开启,发布时关闭) encryptEnabled: 是否开启加密传输(默认开启)

Implementation

static Future<void> initialize({
  required String androidAppKey,
  required String iosAppKey,
  required String channel,
  bool logEnabled = false,
  bool encryptEnabled = true,
}) async {
  // await _channel.invokeMethod('initialize', {
  //   'androidAppKey': androidAppKey,
  //   'iosAppKey': iosAppKey,
  //   'channel': channel,
  //   'logEnabled': logEnabled,
  //   'encryptEnabled': encryptEnabled,
  // });
  return UmengAnalyticsPluginPlatform.instance.initialize(
    androidAppKey: androidAppKey,
    iosAppKey: iosAppKey,
    channel: channel,
    logEnabled: logEnabled,
    encryptEnabled: encryptEnabled,
  );
}