Rewarded Ads

Rewarded ads are full-screen, video or interactive ads that offer users an in-app reward (like extra lives, in-game currency, or exclusive content) for watching the complete ad.

Building the Ad Placement (Ad Spot)

Add the required controllers to set up the ad placement:

Java
// Spot integration for Rewarded Ads
InneractiveAdSpot mSpot = InneractiveAdSpotManager.get().createSpot();

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

// Adding the Video adview controller
InneractiveFullscreenVideoContentController videoContentController = new InneractiveFullscreenVideoContentController();

controller.addContentController(videoContentController);

mSpot.addUnitController(controller);

Adding Listeners

Add listeners for the controller and the spot.

Adding Event Listener for the Controller

The examples below demonstrate how you would add an EventListener to receive rewarded ad callbacks:

Events:

Video Events:

Rewarded Events:

You can also use InneractiveFullScreenAdRewardedListener to receive Rewarded Ad callbacks.

Adding Request Listener for the Spot

The example below demonstrates how you would use a RequestListener:

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

Use InneractiveAdRequest adRequest to set up the ad placement request:

Optionally, you can mute ads 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