Fullscreen (Interstitial)

Integrate fullscreen ads

This guide shows you how to integrate fullscreen ads of RTBSDK into your app.

Create RTBFullscreenAd Instance

Create an instance of RTBFullscreenAdarrow-up-right:

val fullscreenAd = RTBFullscreenAd(this)

Listen to Callbacks

Through the use of RTBFullscreenDelegatearrow-up-right, you can listen to the different callbacks.

fullscreenAd.delegate = this

Request Ad

To load a fullscreen ad, you will need to pass an instance of RTBFullscreenRequestConfigurationarrow-up-right with placementID and the bundleId. Please contact our supportenvelope for getting the needed IDs.

val rtbFullscreenRequestConfiguration = RTBFullscreenRequestConfiguration(<PLACEMENT_ID>, <BUNDLE_ID>)
rtbFullscreenRequestConfiguration.sellerId = "<SELLERID>" // Optional
fullscreenAd.load(rtbFullscreenRequestConfiguration)

You will be notified about the loading success/failure through the RTBFullscreenDelegatearrow-up-right

Optional - set user targeting

You can pass user targeting data to each request, allowing ads to be more relevant to your audience. Each field in RTBUserTargetingarrow-up-right is optional.

rtbFullscreenRequestConfiguration.userTargeting = RTBUserTargeting(userID = "<USER_ID>", gender = RTBGender.MALE, keywords = listOf("keyword1", "keyword2"), yearOfBirth = 1990)
// yearOfBirth must be a 4-digit number, otherwise it will be ignored

Show Ad

After the ad gets loaded, it can be presented by calling:

circle-info

The currency of bidFloor and priceCPM parameters is USD.

Complete Code Example

Last updated