Menu

Interstitial

💡Tips

  • Smart Cache automatically manages parallel loading, caching, and waterfall display across multiple placements — no need to pass a Mediation Unit ID.
  • After an ad is closed, the SDK auto-replenishes the cache; developers do not need to manually trigger a second load.
  • Smart Cache has its own independent callback channel (McSmartCacheInterstitialListener), which does not interfere with the standard interstitial ad callbacks.
  • If you need manual control over loading and caching, refer to here

1. Set Up Callback Listener

Before loading ads, register the independent Smart Cache interstitial ad callback:

dart Copy
McSdk.setSmartCacheInterstitialListener(McSmartCacheInterstitialListener(
  onDidLoadAd: (McAd ad) {
    // At least one ad is ready and can be shown
  },
  onDidFailToLoadAd: (McError error) {
    // All placements failed to load
  },
  onDidDisplayAd: (McAd ad) {
    // Ad displayed successfully
  },
  onDidHideAd: (McAd ad) {
    // Ad closed, SDK auto-replenishes
  },
  onDidClickAd: (McAd ad) {
    // Ad was clicked
  },
  onDidFailToDisplayAd: (McAd ad, McError error) {
    // Ad failed to display
  },
  onDidAdLoadFinished: () {
    // Current load round finished (regardless of success or failure)
  },
  onDidPayRevenueForAd: (McAd ad) {
    // Revenue callback
  },
));

Call the following method to trigger Smart Cache interstitial ad loading. The SDK will automatically manage parallel requests and caching across multiple placements:

dart Copy
McSdk.smartLoadInterstitial();

3. Check If Ad Is Ready

Before showing, use the following method to check whether a cached ad is available:

dart Copy
bool? isReady = await McSdk.smartIsInterstitialReady();
if (isReady == true) {
  // Ad is ready and can be shown
}

When the ad is ready, call the following method to show the interstitial ad:

dart Copy
McSdk.smartShowInterstitial();

5. Set Custom Parameters

Use the following methods to set extra parameters for fine-grained control over ad behavior:

dart Copy
// Set Extra Parameter (Max only)
McSdk.smartSetInterstitialExtraParameter("key", "value");

// Set Local Extra Parameter
McSdk.smartSetInterstitialLocalExtraParameter("key", value);
Previous
Ad-Formats
Next
App-Open
Last modified: 2026-06-25Powered by