Interstitial Integration for Xamarin iOS

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.

Before You Start

Make sure you have correctly integrated the ironSource Plugin into your application. Integration is outlined here.

Step 1. Implement the Delegate

The ironSource SDK fires several events to inform you of Interstitial Activity. The SDK will notify your delegate of all possible events listed below:

public class ISDelegate : ISInterstitialDelegate
    {
        readonly UIViewController parent;
        public ISDelegate(UIViewController viewController)
        {
            this.parent = viewController;
        }
        /*
        * Invoked when the ad was opened and shown successfully.
        */
        public override void InterstitialDidShow()
        {
            
        }
        /*
        * Invoked when the end user clicked on the interstitial ad.
        */
        public override void InterstitialDidClick()
        {
            
        }
        /*
         * Invoked when the ad is closed and the user is about to return to the 
         * application.
         */
        public override void InterstitialDidClose()
        {
            
        }
        /*
        * invoked when there is no Interstitial Ad available after calling load function.
        */
        public override void InterstitialDidFailToLoadWithError(NSError error)
        {
            
        }
        /*
         * Invoked when Interstitial ad failed to show.
         * @param error - An object which represents the reason of showInterstitial failure.
         */
        public override void InterstitialDidFailToShow(NSError error)
        {
            
        }
        /*
         * Invoked when Interstitial Ad is ready to be shown after load function was 
called.
        */
        public override void InterstitialDidLoad()
        {
            
        }
        /*
        * Invoked when the Interstitial Ad Unit is opened
        */
        public override void InterstitialDidOpen()
        {
            
        }
    }
  • The InterstitialDidOpen and InterstitialDidShow 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 delegate methods will always invoke on the main thread. [/note]

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 some time. We don’t recommend making consecutive requests for an interstitial ad in a short timespan. Numerous requests in a short period of time have no added value as the chance of available inventory within this time is unlikely.

To request an interstitial ad, call the following method:

IronSource.LoadInterstitial();

Note: If you’d like to serve several Interstitial Ads in your application, you must repeat this step after you’ve shown and closed the previous Interstitial Ad. Once the InterstitialDidClose function is fired, you will be able to load a new Interstitial ad. 

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 InterstitialDidLoad which will inform you about ad availability.

public void InterstitialDidLoad(){}

We don’t recommend making consecutive requests for an interstitial ad in a short timespan. Numerous requests in a short period of time have no added value as the chance of available inventory at this time is unlikely.

Step 4. Show Interstitial Ad

Once you receive the InterstitialDidLoad delegate, 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);

Important! Once you’ve successfully completed step 4, you will have shown your user an Interstitial Ad. In the case you want to serve another Interstitial ad, you must repeat Step 3 to request an additional Interstitial.