showInterstitialAd static method

Future<void> showInterstitialAd({
  1. required String interstitialId,
  2. GromoreInterstitialCallback? callback,
})

展示插屏广告

Implementation

static Future<void> showInterstitialAd(
    {required String interstitialId,
    GromoreInterstitialCallback? callback}) async {
  assert(isInit);

  if (callback != null) {
    GromoreMethodChannelHandler<GromoreInterstitialCallback>.register(
        "${FlutterGromoreConstants.interstitialTypeId}/$interstitialId",
        callback);
  }

  await _methodChannel
      .invokeMethod("showInterstitialAd", {"interstitialId": interstitialId});
}