Interstitial Integration for Adobe Air 6.4 and Below
Get up and running with the Interstitial Ad Unit in 4 easy steps:
- Implement the Listener
- Initialize the Interstitial
- Load Interstitial Ad
- Check Ad Availability
- Show Interstitial Ad
Make sure you have correctly integrated the ironSource Adobe Air Plugin. Integration is outlined here.
Step 1. Implement the Interstitial Listener
The ironSource Adobe Air Plugin fires several events to inform you of Interstitial Activity. To receive these events, you must implement the Interstitial EventListener:
Supersonic.instance.addEventListener( "EventName", functionToCall );
- EventName = a string containing the event you want to listen to.
- functionToCall = The function to call when the event is fired.
The ironSource Adobe Air Plugin will notify your Listener of all possible events listed below:
Supersonic.instance.addEventListener("onInterstitialInitSuccess", onInterstitialInitSuccess); Supersonic.instance.addEventListener("onInterstitialInitFailed", onInterstitialInitFailed); Supersonic.instance.addEventListener("onInterstitialReady", onInterstitialReady); Supersonic.instance.addEventListener("onInterstitialLoadFailed", onInterstitialLoadFailed); Supersonic.instance.addEventListener("onInterstitialOpen", onInterstitialOpen); Supersonic.instance.addEventListener("onInterstitialClose", onInterstitialClose); Supersonic.instance.addEventListener("onInterstitialShowSuccess", onInterstitialShowSuccess); Supersonic.instance.addEventListener("onInterstitialShowFailed", onInterstitialShowFailed); Supersonic.instance.addEventListener("onInterstitialClick", onInterstitialClick);
Implementation:
// Invoked when Interstitial initialization process completes successfully. function onInterstitialInitSuccess(event:DataEvent):void { } // Invoked when the initialization process has failed. */ function onInterstitialInitFailed(event:DataEvent):void { } /** * Invoked when Interstitial Ad is ready to be shown after load function was called. */ function onInterstitialReady(event:DataEvent):void { } /** *Invoked when there is no Interstitial Ad available after calling load function. */ function onInterstitialLoadFailed(event:DataEvent):void { } /** * Invoked right before the Interstitial screen is about to open. */ function onInterstitialOpen(event:DataEvent):void { } /** * Invoked when the interstitial ad closed and the user goes back to the application screen. */ function onInterstitialClose(event:DataEvent):void { } /** * Invoked when the ad fails to show. * @param event.message - string - contains information about the failure. */ function onInterstitialShowFailed(event:DataEvent):void { } } /** * Invoked when your end user clicks on the Interstitial ad */ function onInterstitialClick(event:DataEvent):void { } /** * Invoked when the ad was opened and shown successfully. */ function onInterstitialShowSuccess(event:DataEvent):void { }
- The onInterstitialOpen event conveys the ad format has takes over the app screen but does not indicate that an ad has been successfully served to your end-user.
- The onInterstitialShowSuccess event conveys an Interstitial Ad from ironSource or any other ad network was successfully served to your end-user.
Step 2. Initialize the Interstitial Unit
You should initialize the Interstitial Ad Unit as early as possible to allow time for the Interstitial to load. We recommend doing so on app launch.
Supersonic.instance.initInterstitial("YOUR_APPLICATION_KEY", "USER_UNIQUE_ID");
- YOUR_APPLICATION_KEY is the unique ID of your Application in your ironSource account.
- USER_UNIQUE_ID is the unique ID of your end user.
Step 3. 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. Before calling the load method, make sure you received onInterstitialInitSuccess first.
To request an interstitial ad, call the following method:
Supersonic.instance.loadInterstitial();
Step 4. Check Ad Availability
After you have received the onInterstitialInitSuccess() callback and you’ve called the loadInterstitial in Step 3, you will be notified when the ad is loaded and ready to be shown to your user. The onInterstitialReady callback will inform you about ad availability.
function onInterstitialReady(event:DataEvent):void { }
In the case an Interstitial ad isn’t available you will receive the onInterstitialLoadFailed callback:
function onInterstitialLoadFailed(event:DataEvent):void { }
Step 5. Show an Interstitial
Once an Ad Network has an available video you are ready to show this video ad to your users. Serve an interstitial to your users by calling the following method:
Supersonic.instance.showInterstitial();
With ironSource 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 below function to define the exact Placement you’d like to show an ad from. Navigate to the Ad Placement document for more details.
Supersonic.instance.showInterstitial(placementName:String);
In addition to ironSource Ad Placements, you can now configure capping and pacing settings for selected placements. Capping and pacing improves the user experience in your app by limiting the amount of ads served within a defined timeframe. Read more about capping and pacing here.
Done!
You are now all set to deliver Interstitial Ads in your application.
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 ironSourc 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.
Follow our integration guides to implement additional Ad Units: