Interstitial Ads

Interstitial ads are full-screen, video, or interactive ads that appear at natural transition points within an app, such as between levels in a game or when a user is switching screens.

Building the Ad Placement (Ad Spot)

Add the required controllers to set up the ad placement:

Java
// Spot integration for fullscreen ad
InneractiveAdSpot mSpot = InneractiveAdSpotManager.get().createSpot();

// Adding the fullscreen controller
InneractiveFullscreenUnitController controller = new InneractiveFullscreenUnitController();

// Adding the video fullscreen controller
InneractiveFullscreenVideoContentController videoContentController = new InneractiveFullscreenVideoContentController();

// Adding the video fullscreen controller to the adview controller
controller.addContentController(videoContentController);
mSpot.addUnitController(controller);

Adding Listeners

Add listeners for the controller and the spot.

Adding Event Listener for the Controller

The example below demonstrates how you would add an EventListener to receive Interstitial ad callbacks:

Events:

Video Events:

Adding Request Listener for the Spot

The example below demonstrates how you would add a RequestListener for the Spot:

Fetching the Ad

The way in which the ad is fetched depends on the mediation type — Waterfall or SDK Bidding.

Fetching the Ad for Waterfall

In Waterfall mediation, use InneractiveAdRequest adRequest to request the ad:

Optionally, you can mute ads by including setMuteVideo(true):

Fetching the Ad for SDK Bidding

In SDK Bidding, DT Exchange must first generate a token for the Mediation SDK to use when identifying the request to the server.

Use getBidderToken to generate a Bidder Token in a background thread:

Return type: java.lang.String. If an error occurs, the returned value is null.

If DT Exchange wins the auction, load the ad with the signaldata (adm) that was received from the server:

If the load is successful: public void onInneractiveSuccessfulAdRequest(InneractiveAdSpot inneractiveAdSpot) callback is invoked.

If the ad fails to load: public void onInneractiveFailedAdRequest(InneractiveAdSpot inneractiveAdSpot, InneractiveErrorCode inneractiveErrorCode) callback is invoked.

Displaying the Ad

After a successful ad request, use mSpot.isReady to confirm the ad is ready and controller.show(this); to display the Ad:

Releasing an Ad Placement

DT recommends releasing the allocated resources for ad display. For more information, see Releasing Ad Instance Resources.

Last updated