Adx3
EN
EN
  • Introduction to Broearn Ads Operation
    • Introduction to Broearn Ads Operation(SSP)
      • Login Operation
      • Website
      • Apps-For Android
      • Withdraw
      • Advertising Statistics
      • User Center
    • Introduction to Broearn Ads Operation (DSP)
      • Login Operation
      • Top-up
      • Ad Campaign Management
      • Ad Management
      • Advertising Statistics and Data Analysis
      • User Center
    • Adx3-Agent system manual(AGENT)
      • Log In
      • Add Account
      • Capital Account
      • Data Review
  • interface documentation
    • Monitor incident escalation(DSP)
    • Monitor incident escalation(SSP)
    • CPA, CPS Event Report
    • ANDRIOD
      • Start
        • Getting Started Guide
        • Test
      • Ad formats
        • Banner
        • Interstitial
        • Rewarded
        • APP Open
        • Native
        • Multiple
    • IOS
      • Get started
        • Getting Started Guide
        • Test
      • Ad formats
        • App Open
        • Interstital
        • Banner
        • Rewarded
        • Native
        • Multiple
  • FAQ
    • FAQ
Powered by GitBook
On this page
  • Prerequisites
  • Always test with test ads
  • Implementation
  1. interface documentation
  2. IOS
  3. Ad formats

Interstital

PreviousApp OpenNextBanner

Last updated 1 year ago

Interstitial ads are full-screen ads that cover the interface of an app until closed by the user. They're typically displayed at natural transition points in the flow of an app, such as between activities or during the pause between levels in a game. When an app shows an interstitial ad, the user has the choice to either tap on the ad and continue to its destination or close it and return to the app.

This guide shows you how to integrate interstitial ads into an iOS app.

Prerequisites

  • Complete the .

Always test with test ads

When building and testing your apps, make sure you use test ads rather than live, production ads. Failure to do so can lead to suspension of your account. The easiest way to load test ads is to use our dedicated test ad unit ID for app interstitial ads:

63a573a507ebe

It's been specially configured to return test ads for every request, and you're free to use it in your own apps while coding, testing, and debugging. Just make sure you replace it with your own ad unit ID before publishing your app.

Implementation

The main steps to integrating interstitial ads are:

  • Load an ad

  • Register for callbacks

  • Display the ad and handle the event

Load an ad

Loading an ad is accomplished using the static loadAdWithPlacementID: method on the Adx3InterstitialAd class. The load method requires your ad unit ID, a userId object, and a completion handler which gets called when ad loading succeeds or fails. userId object can not be passed or your custom user identifier. The below example shows how to load an Adx3InterstitialAd in your ViewController class.

import UIKit

class ViewController: UIViewController, Adx3InterstitialDeleagte {
    
    override func viewDidLoad() {
        super.viewDidLoad()
        loadInterstitialAd()
        // Do any additional setup after loading the view.
    }
    
    func loadInterstitialAd() {
        Adx3InterstitialAd.sharedManager().load(withPlacementID: "Your Placement ID", userId: "", delegate: self) { isSuccess in
            
        }
    }

}
#import "Adx3Framework/Adx3Ad.h"

@interface ViewController()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self loadInterstitialAd];
}

- (void)loadInterstitialAd {
    [[Adx3InterstitialAd sharedManager] loadAdWithPlacementID:@"Your Placement ID" userId:@"" delegate:self completionHandler:^(BOOL isReady) {
        
    }];
}

@end

Register for callbacks

You should rely on the Adx3InterstitialDelegate (optional) to handle display events and request events. The following code shows how to implement the protocol:

import UIKit

class ViewController: UIViewController, Adx3InterstitialDeleagte {
    
    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view.
    }
}

extension ViewController {
    
    func didFinishLoadingAD(withPlacementID placementID: String!) {
        print("----Interstitial AD Load Finish----")
    }
    
    func didFailToLoadAD(withPlacementID placementID: String!, error: Error!) {
        print("----\(error.debugDescription)----")
    }
    
    func interstitialDidShow(forPlacementID placementID: String!, extra: [AnyHashable : Any]!) {
        
    }
    
    func interstitialDidClick(forPlacementID placementID: String!, extra: [AnyHashable : Any]!) {
        
    }
    
    func interstitialDidClose(forPlacementID placementID: String!, extra: [AnyHashable : Any]!) {
        
    }
    
    func interstitialDidEndPlayingVideo(forPlacementID placementID: String!, extra: [AnyHashable : Any]!) {
        
    }
    
    func interstitialDidStartPlayingVideo(forPlacementID placementID: String!, extra: [AnyHashable : Any]!) {
    
    }
    
    func interstitialFailedToShow(forPlacementID placementID: String!, error: Error!, extra: [AnyHashable : Any]!) {
        
    }
    
    func interstitialDidFailToPlayVideo(forPlacementID placementID: String!, error: Error!, extra: [AnyHashable : Any]!) {
        
    }
    
}
#import "Adx3Framework/Adx3Ad.h"

@interface ViewController() <Adx3InterstitialDeleagte>

@end

@implementation ViewController

@end

#pragma mark - Adx3AdLoadingDelegate

- (void)didFinishLoadingADWithPlacementID:(NSString *)placementID {
    NSLog(@"---Interstitial AD Load Finish----");
}

- (void)didFailToLoadADWithPlacementID:(NSString *)placementID error:(NSError *)error {
    NSLog(@"----%@----", error.description);
}

#pragma mark - Adx3InterstitialDeleagte

-(void)interstitialDidShowForPlacementID:(NSString*)placementID extra:(NSDictionary*)extra {

}

-(void)interstitialFailedToShowForPlacementID:(NSString*)placementID error:(NSError*)error extra:(NSDictionary*)extra {

}

-(void)interstitialDidStartPlayingVideoForPlacementID:(NSString*)placementID extra:(NSDictionary*)extra {

}

-(void)interstitialDidEndPlayingVideoForPlacementID:(NSString*)placementID extra:(NSDictionary*)extra {

}

-(void)interstitialDidFailToPlayVideoForPlacementID:(NSString*)placementID error:(NSError*)error extra:(NSDictionary*)extra {

}

-(void)interstitialDidCloseForPlacementID:(NSString*)placementID extra:(NSDictionary*)extra {

}

-(void)interstitialDidClickForPlacementID:(NSString*)placementID extra:(NSDictionary*)extra {

}

Display the ad

Interstitials should be displayed during natural pauses in the flow of an app. Between levels of a game is a good example, or after the user completes a task. Here's an example of how to do this in one of the action methods in a UIViewController:

func showInterstitialAd() {
    Adx3InterstitialAd.sharedManager().showInterstitial(in: self, delegate: self)
}
- (void)showInterstitialAd {
    [[Adx3InterstitialAd sharedManager] showInterstitialInViewController:self delegate:self];
}
Getting Started Guide