showSmartInterstitial static method

bool showSmartInterstitial({
  1. BuildContext? context,
  2. int loaderDuration = 1,
})

Show interstitial ad with smart frequency management

Implementation

static bool showSmartInterstitial({
  BuildContext? context,
  int loaderDuration = 1,
}) {
  if (!canShowInterstitial()) {
    return false;
  }

  final shown = AivoryAdControl.instance.showAd(
    AdUnitType.interstitial,
    context: context,
    loaderDuration: loaderDuration,
  );

  if (shown) {
    _lastInterstitialShown = DateTime.now();
    _sessionAdCount++;
  }

  return shown;
}