Pangle: A global platform dedicated to developer growth.|Integration Docs
Knowledge Center

Interstitial Ads

Introduction

The Interstitial Ads is that cover the interface of an app until closed by the user. It can be skipped after 5 seconds. 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.

Precondition

Create an app and Interstitial ad placement on Pangle platform

Pangle Platform Parameter Setting:

  • Orienation: Select the orientation of the video.

Interstitial Ad Implementation

The main steps to integrate Interstitial ads are:

  • Load an interstitial ad.
  • Register ad event callbacks.
  • Display the ad.
  • Preload a fullscreen video ad.

Load an Interstitial Ad

Loading an Interstitial ad is accomplished using the loadAdData method on the BUFullscreenVideoAd object. After that, the property delegate also needs to be set to BUFullscreenVideoAd object before loading the ad. The loaded BUFullscreenVideoAd object is provided as a parameter in the fullscreenVideoMaterialMetaAdDidLoad:and fullscreenVideoAdVideoDataDidLoad: callback.

Create the Fullscreen Video Object

Interstitial ad is requested and shown by BUFullscreenVideoAd object, which needs to be created before loading ads. The BUFullscreenVideoAd object requires one parameter: a String slotID which is your ad unit ID when instantiated and initialized.

Requied:

Field Definition

Field Name

Field Type

Remarks

SlotID

slot ID

NSString

ad placement ID

Load an Interstitial Ad

Calling the loadAdData method on the BUFullscreenVideoAd object to load an Interstitial ad. And make sure to have set the delegate property to be notified of events related to the fullscreen video ad interactions.

Note: It is required to generate a new BUFullscreenVideoAd object each time calling theloadAdDatamethod to request the latest interstitial ad. Please do not reuse the local cache interstitial ad.

Register Ad Event Callbacks

In order to receive notifications for Interstitial ad lifestyle and interactive events , you must implement the protocol BUFullscreenVideoAdDelegate and assign it to the delegate property of the returned ad.

BUFullscreenVideoAdDelegate Callback Instruction

BUFullscreenVideoAdDelegate Callback

Description

fullscreenVideoMaterialMetaAdDidLoad:

This method is called when video ad material loaded successfully.

fullscreenVideoAd: didFailWithError:

This method is called when video ad material failed to load.

fullscreenVideoAdVideoDataDidLoad:

This method is called when video cached successfully.

fullscreenVideoAdWillVisible:

This method is called when video ad slot will be showing.

fullscreenVideoAdDidVisible:

This method is called when video ad slot has been shown.

fullscreenVideoAdDidClick:

This method is called when video ad is clicked.

fullscreenVideoAdWillClose:

This method is called when video ad is about to close.

fullscreenVideoAdDidClose:

This method is called when video ad is closed.

fullscreenVideoAdDidPlayFinish: didFailWithError:

This method is called when video ad play completed or an error occurred.

fullscreenVideoAdDidClickSkip:

This method is called when the user clicked skip button.

fullscreenVideoAdCallback: withType:

This method is used to get the type of fullscreen video ad.

Display the Ad

Interstitial 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.

To show an Interstitial ad, check the fullscreenVideoMaterialMetaAdDidLoad: callback to verify that if the ad is returned. It is recommended to use the fullscreenVideoAdVideoDataDidLoad: method to verify if it's finished loading and cached successfully. Then call showAdFromRootViewController: to show a Fullscreen video. The rootViewController is needed to pass for this method.

Note: To have a better user experience, we recommend to show fullscreenVideoAd after fullscreenVideoAdVideoDataDidLoad: callback is triggered. It means the video has been downloaded successfully.

Preload a Fullscreen video Ad

The best practice is to load another Interstitial Ad in the fullscreenVideoAdDidClose method on BUFullscreenVideoAdDelegate so that the next interstitial ad starts loading as soon as the previous one is dismissed:

Note: BUFullscreenVideoAd is a one-time-use object. This means that once a fullscreen video is shown, the object can't be used to load another ad. To request another Interstitial Ad, you'll need to create a new BUFullscreenVideoAd object.

Test with test ads

Now you have finished the integration. If you wanna test your apps, make sure you use test ads rather than live, production ads. The easiest way to load test ads is to use test mode. 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.

Refer to the How to add a test device? to add your device to the test devices on Pangle platform.

Note

  1. All the rootViewController parameters in Ad APIs must be provided to process ad redirects. In the SDK, all redirects use the present method of UIViewController. Therefore, make sure that the passed rootViewController parameters are not null and do not have other present controllers. Otherwise the present will fail because presentedViewController already exists.
  2. In order to ensure smooth playback and display, we recommend checking the fullscreenVideoAdVideoDataDidLoad: callback before showing the ad to verify if the video is finished loading.
  3. The isAdValid method has been deprecated since V3.3.0.0. Please do not use this field to verify whether the Interstitial ad is valid.