Interstitial Ads

The following code block sets up an interstitial ad and loads it:

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    // set config to production
    [SAInterstitialAd setConfigurationProduction];

    // to display test ads
    [SAInterstitialAd enableTestMode];

    // lock orientation to portrait or landscape
    [SAInterstitialAd setOrientationPortrait];

    // start loading ad data for a placement
    [SAInterstitialAd load: 30473];
}

Once you’ve loaded an ad, you can also display it:

@IBAction void onClick:(id) sender {

    // check if ad is loaded
    if ([SAInterstitialAd hasAdAvailable: 30473]) {

        // display the ad
        [SAInterstitialAd play: 30473 fromVC: self];
    }
}

These are the default values:

Parameter Value
Configuration Production
Test mode Disabled
Orientation Any