Interstitial Ads - cleveradssolutions/CAS-Android Wiki

:zap: Before you start
Make sure you have correctly Initialize SDK.


Interstitial ads are full-screen ads that cover the interface of their host app. They're typically displayed at natural transition points in the flow of an app, such as between activities or during the pause between levels in a game. When an app shows an interstitial ad, the user has the choice to either tap on the ad and continue to its destination or close it and return to the app.

This guide explains how to integrate interstitial ads into an Android app.

Load an ad

Manual load Interstitial ads.
By default, the auto-load ads mode is used and a load method does not need to be called.
If you use LoadingManagerMode.Manual then please call load before each show ad.

manager.loadInterstitial();

You can get a callback for the successful loading of the ads:

manager.getOnAdLoadEvent.Add(new AdLoadCallback(){...});

Check the ad availability

You can ask for the ad availability directly by calling the following function:

boolean adLoaded = manager.isAdReady(AdType.Interstitial);

Show the ad

The showInterstitial() method requires Activity and AdCallback instances as arguments.

manager.showInterstitial(activity, new AdCallback(){...});

Minimum interval between impressions

You can limit the posting of an interstitial ad to a period of time in seconds after the ad is closed, during which display attempts will fail. Unlimited by default 0 seconds.
That the interval starts only after the Interstitial Ad closes AdCallback.onClosed(). During interval after ad closed, display attempts will fire event AdCallback.onShowFailed() with AdError.CODE_INTERVAL_NOT_YET_PASSED.

You can specify minimal interval before initialization to allow overrides settings by the web interface for a given session.

CAS.getSettings().setInterstitialInterval(interval);

If you need to wait for a period of time after the start of the app or after showing a Rewarded Ad until next Interstitial Ad impression then call the following method:

CAS.getSettings().restartInterstitialInterval();

⭐ We recommend define the interstitial ad impression interval once before mediation manager is initialized to be able to override the value remotely via the web interface.

Some best practices


What’s Next?