Home / iOS / Objective C / Interstitials

Using the SDK


Interstitial is an ad shown in full-screen, with the option to close it. Add the following lines to the ViewController.h file:

#import <TappxFramework/TappxAds.h>

@interface ViewController : UIViewController <TappxInterstitialViewControllerDelegate>

@property (retain, nonatomic) TappxInterstitialViewController* tappxInterstitial;


Now you need to initialize the Interstitial in the ViewController.m file. Example:

#import "ViewController.h"
#import <TappxFramework/TappxAds.h>

@interface ViewController ()

@implementation ViewController

- (void)viewDidLoad {
[super viewDidLoad];
_tappxInterstitial = [[TappxInterstitialViewController alloc] initWithDelegate:self];
[_tappxInterstitial setAutoShowWhenReady:YES];
[_tappxInterstitial load];

return self;

If you want to request an interstitial to be shown as soon as it's ready, you can use this method:

[_tappxInterstitial setAutoShowWhenReady:YES];

If you want to have more control, you can use the following three options: load, isReady and show.

load is the request to get the ad and load all the information so you can show the ad.

[_tappxInterstitial load];

isReady allows you to check if the ad is ready to be shown. You will receive a "true" if the ad is ready and a "false" if not.

[_tappxInterstitial isReady];

show allows you to display the interstitial ad that has loaded previously.

[_tappxInterstitial show];


You can add listener events into the Interstitial to be notified when a specific event happens in the ad. Here you have examples:

-(void) tappxInterstitialViewControllerDidFinishLoad:(TappxInterstitialViewController*) viewController{
NSLog(@"INTERSTITIAL: FinishLoad");

-(void) tappxInterstitialViewControllerDidFail:(TappxInterstitialViewController*) viewController
withError:(TappxErrorAd*) error{
NSLog(@"INTERSTITIAL: DidFail %@", error.descriptionError);

-(void) tappxInterstitialViewControllerDidPress:(TappxInterstitialViewController*) viewController{

-(void) tappxInterstitialViewControllerDidClose:(TappxInterstitialViewController*) viewController{

-(void) tappxInterstitialViewControllerDidAppear:(TappxInterstitialViewController*) viewController{
NSLog(@"INTERSTITIAL: DidAppear");