init method

Future<bool> init({
  1. required String androidAppKey,
  2. required String iosAppKey,
  3. String channel = '',
})

初始化 preInit 是否预加载 仅支持android

Implementation

Future<bool> init(
    {required String androidAppKey,
    required String iosAppKey,
    String channel = ''}) async {
  if (!_supportPlatform) return false;
  final bool? state = await _channel.invokeMethod<bool?>(
      'init', <String, dynamic>{
    'appKey': _isAndroid ? androidAppKey : iosAppKey,
    'channel': channel
  });
  _isInit = state ?? false;
  return state ?? false;
}