Interstitial Integration for Android
The ironSource Interstitial is a full-screen ad unit, usually served at natural transition points during the app lifecycle. We support both static and video interstitials. You can also serve interstitials through the ironSource Mediation platform.
Make sure that you have correctly integrated the ironSource SDK into your application. Integration is outlined here.
The multiple ad units APIs are available here, supported for SDK 8.4.0+
Step 1. Implement the Listener
The ironSource SDK fires several events to inform you of Interstitial Activity. The SDK will notify your delegate of all possible events listed below:
IronSource.setInterstitialListener(new InterstitialListener() { /** Invoked when Interstitial Ad is ready to be shown after load function was called. */ @Override public void onInterstitialAdReady() { } /** invoked when there is no Interstitial Ad available after calling load function. */ @Override public void onInterstitialAdLoadFailed(IronSourceError error) { } /** Invoked when the Interstitial Ad Unit is opened */ @Override public void onInterstitialAdOpened() { } /* * Invoked when the ad is closed and the user is about to return to the application. */ @Override public void onInterstitialAdClosed() { } /** * Invoked when Interstitial ad failed to show. // @param error - An object which represents the reason of showInterstitial failure. */ @Override public void onInterstitialAdShowFailed(IronSourceError error) { } /* * Invoked when the end user clicked on the interstitial ad. * Note - This callback is not supported by all ad networks and might not be supported for all ad types */ @Override public void onInterstitialAdClicked() { } /** Invoked right before the Interstitial screen is about to open. NOTE - This event is available only for some of the networks. You should NOT treat this event as an interstitial impression, but rather use InterstitialAdOpenedEvent */ @Override public void onInterstitialAdShowSucceeded() { } })
- The onInterstitialAdOpened() and onInterstitialAdShowSucceeded() events convey that the ad format has taken over the app screen and been displayed but does not indicate that an ad has been successfully served to your end-user.
- Do not assume the callbacks are always running on the main thread. Any UI interaction or updates resulting from ironSource callbacks need to be passed to the main thread before executing.
- Please make sure to set the listeners before SDK initialization. This will ensure the SDK sends all relevant information.
Step 2. Load Interstitial Ad
We recommend requesting an Interstitial Ad a short while before you plan on showing it to your users as the loading process can take time.
To request an interstitial ad, call the following method:
IronSource.loadInterstitial();
Step 3. Check Ad Availability
After you call the loadInterstitial in Step 2, you will be notified when the ad is loaded and ready to be shown to your user through the delegate with the method onInterstitialAdReady which will inform you about ad availability.
public void onInterstitialReady(){}
In addition, you can also ask for the ad availability directly by calling the following function:
boolean isInterstitialReady();
Once the Interstitial ad is available you will be able to show the ad to your users. With ironSource’s Ad Placements, you can customize and optimize the Interstitial experience. This tool enables you to present Interstitial ads to your users in different places, i.e. app launch, between levels, etc. You can use the function in the next step to define the exact Placement you’d like to show an ad from. In addition, to receive details about a specific Ad Placement, you can call the following:
InterstitialPlacement getInterstitialPlacementInfo(String placementName)
In addition to ironSource’s Ad Placements, you can now configure capping and pacing settings for selected placements. Capping and pacing improve the user experience in your app by limiting the number of ads served within a defined timeframe.
We recommend calling the following to verify if a placement is capped before you serve the Interstitial to your user:
IronSource.isInterstitialPlacementCapped(placementName)
Navigate to the Ad Placement document for more details.
Step 4. Show Interstitial Ad
Once you receive the onInterstitialAdReady callback, you are ready to show an Interstitial Ad to your users. Invoke the following method to serve an Interstitial ad to your users:
IronSource.showInterstitial(placementName);
Done!
If this is a new integration for your application, your app will by default be in ‘Test Mode‘ on your ironSource dashboard. While your app is in Test Mode, the ironSource SDK will print more logs to the console in order to provide greater visibility into the SDK processes. To test your ad inventory, set up your Test Devices. Until you turn on live ad inventory, you will receive test campaigns that don’t generate revenue. Make sure to select Go Live! on the Ad Units page when your app is ready for live ad inventory.
You can now deliver ironSource Interstitial Ads on your app!
Follow our integration guides to integrate additional Interstitial Ad networks or configure additional Ad Units: