init method

Future<bool> init(
  1. {String? appId,
  2. String? appKey,
  3. String? appSecret}
)

初始化sdk

Implementation

Future<bool> init({String? appId, String? appKey, String? appSecret}) async {
  if (!_supportPlatform) return false;
  bool? state = false;
  if (_isAndroid) {
    state = await _channel.invokeMethod<bool?>('initPush');
  } else if (_isIOS) {
    assert(appId != null);
    assert(appKey != null);
    assert(appSecret != null);
    state = await _channel.invokeMethod<bool?>('initSDK',
        {'appId': appId, 'appKey': appKey, 'appSecret': appSecret});
  }
  return state ?? false;
}