setApiKey method

Future<bool> setApiKey({
  1. required String androidKey,
  2. required String iosKey,
})

设置 apiKey

Implementation

Future<bool> setApiKey(
    {required String androidKey, required String iosKey}) async {
  if (!_supportPlatform) return false;
  bool? state = false;
  String? key;
  if (_isAndroid) key = androidKey;
  if (_isIOS) key = iosKey;
  if (key != null) {
    state = await _channel.invokeMethod<bool?>('setApiKey', key);
  }
  return state ?? false;
}