Interstitial

Before You Start

Before integrating ads unit in your app, you must:

  • In the AdTiming UI, create an account, create an app, and create an ad placement using the format 'Rewarded Video'. You can follow guides here.
  • Follow our steps to iOS SDK Integration by integrating the AdTiming SDK into your project.
  • If you use mediation, go to Add Mediation Networks and make sure you have added the ad networks' SDKs and the corresponding adapters you wish to work with in your app.

Interstitial 

The AdTiming Interstitial Ad is a full-screen ad unit, usually served at natural transition points during an app's lifecycle. We support both static and video interstitials.

Step 1. Add the Delegate

The AdTiming SDK fires several events to inform you of Ad activity. To show Ad to your user, you need to setup its Delegate before loading the ads to receive Ad status. The following snippets demonstrates how to configure Delegate for AdTimingInterstitial object and implement the AdTimingInterstitialDelegate to receive Ad events.

1. Add the following code to add your Delegate to AdTimingInterstitial object and register to the receive events. The SDK will notify the Delegate of all possible events listed in section 2 below.

Note: Here we use "self" which means the callback function is implemented in the current object.

[[AdTimingInterstitial sharedInstance] addDelegate:self];
AdTimingInterstitial.sharedInstance().add(self) 

2. Implement the following callback function in your code to process ad logic when receive the activity of your ad. For example invoke show function to serve Ad to your users when the Interstitial Ad is ready. 

/// Invoked when interstitial video is available.
- (void)adtimingInterstitialChangedAvailability:(BOOL)available{
     if(available){
       NSLog(@"InterstitialAd is Available");
     }
}

/// Sent immediately when a interstitial video is opened.
- (void)adtimingInterstitialDidOpen:(AdTimingScene *)scene{
     NSLog(@"InterstitialAd is Open");
}

/// Sent immediately when a interstitial video starts to play.
- (void)adtimingInterstitialDidShow:(AdTimingScene *)scene{
     NSLog(@"InterstitialAd Start Play");
}

/// Sent after a interstitial video has been clicked.
- (void)adtimingInterstitialDidClick:(AdTimingScene *)scene{
     NSLog(@"InterstitialAd Did Click");
}

/// Sent after a interstitial video has been closed.
- (void)adtimingInterstitialDidClose:(AdTimingScene *)scene{
     NSLog(@"InterstitialAd Did Close");
}

/// Sent after a interstitial video has failed to play.
- (void)adtimingInterstitialDidFailToShow:(AdTimingScene *)scene withError:(NSError *)error{
     NSLog(@"InterstitialAd failed to play");
}
/// Invoked when interstitial video is available.
func adtimingInterstitialChangedAvailability(_ available: Bool) {
    if available {
         print("InterstitialAd is Available")
    }
 }

 /// Sent immediately when a interstitial video is opened.
func adtimingInterstitialDidOpen(_ scene: AdTimingScene) {
      print(@"InterstitialAd is Open")
 }

 /// Sent immediately when a interstitial video starts to play.
func adtimingInterstitialDidShow(_ scene: AdTimingScene) {
      print(@"InterstitialAd Start Play")
}

 /// Sent after a interstitial video has been clicked.
func adtimingInterstitialDidClick(_ scene: AdTimingScene) {
      print(@"InterstitialAd Did Click")
 }

 /// Sent after a interstitial video has been closed.
func adtimingInterstitialDidClose(_ scene: AdTimingScene) {
      print(@"InterstitialAd Did Close")
 }

 /// Sent after a interstitial video has failed to play.
func adtimingInterstitialDidFail(toShow scene: AdTimingScene, withError error: Error) {
      print(@"InterstitialAd failed to play")
 }

 

Step 2. Check Ad Availability (Optional)

Ad Availability

AdTiming SDK automatic loads ads for you to cache the Rewared Video Ads during the application's lifecycle if only SDK is integrated and initiated successfully. By correctly implementing the AdTimingInterstitialDelegate, you will be notified about the ad availability through the AdTimingInterstitialChangedAvailability callback.

- (void)adtimingInterstitialChangedAvailability:(BOOL)available{
    if(available){
       NSLog(@"InterstitialAd is Available");
    }
}
func adtimingInterstitialChangedAvailability(_ available: Bool) {
    if available {
       print("InterstitialAd is Available")
    }
 }

 

Another way to check if the ad is avalible is by calling the isReady function directly. After you call the Add the Delegate in Step 1, you will be notified whether the Interstitial Ad is ready to show through the isReady method.

/// Check Interstitial video is Ready.
[[AdTimingInterstitial sharedInstance] isReady];
AdTimingInterstitial.sharedInstance().isReady()

 

Step 3. Show a Interstitial Ad

We strongly recommend checking the ad's availibility by calling the isReady method before you serve Interstitial Video Ads, as shown in the following code:

 if ([[AdTimingInterstitial sharedInstance] isReady]) {
     [[AdTimingInterstitial sharedInstance] showWithViewController:@"VIEW_CONTROLLER" scene:@"YOUR_SCENE_NAME"];
}
if AdTimingInterstitial.sharedInstance().isReady() {
    AdTimingInterstitial.sharedInstance().show(with: "VIEW_CONTROLLER", scene: "YOUR_SCENE_NAME")
}

Scene is a new concept being introduced for rewarded video and interstitial ads in Version 4.0. It is used to represent different ad scenarios in your app.

You can use Scene-based frequency control, user rewards and data statistic etc. Go to AdTiming UI to create multiple Scenes in Settings of Placement.

Notes: Scene is optional,if you don't want to use it just ignore the sceneName parameter or use value " ".

 

Step 4. Capping and Pacing (Optional)

You can use scene capping and pacing to improve your app's user experience by limiting the amount of ads served within a defined time frame.  You can configure capping and pacing settings for selected scenes in placement setting.

Important! To ensure you don't show the Interstitial Video button to prompt the user to watch an ad when the placement is capped, you must call the following method to verify if a specific placement has reached its ad limit.

/// Indicates whether the scene has reached the display frequency.
[[AdTimingInterstitial sharedInstance] isCappedForScene:@"YOUR_SCENE_NAME"];
AdTimingInterstitial.sharedInstance().isCapped(forScene:"YOUR_SCENE_NAME")
Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.