RTBSDK Android Integration
Release Notes
  • Start
    • Setup
      • Maven
      • Configure RTBSDK
    • Consent
  • Formats
    • Banner
    • Fullscreen (Interstitial)
    • Native Ads
    • Advanced
      • Separate Loading and Rendering of Banner Ads
  • Other
    • AppLovin Custom Adapter
    • AdMob Custom Events
    • Reference
      • Classes
        • RTBSDKManager
        • RTBBannerView
        • RTBBannerAdProvider
        • RTBBannerRequestConfiguration
        • RTBBannerSize
        • RTBFullscreenAd
        • RTBFullscreenRequestConfiguration
        • RTBBidInfo
        • RTBNativeAd
        • RTBNativeAdRequestConfiguration
        • RTBUserTargeting
        • RTBNativeAdLoader
      • Interfaces
        • RTBBannerViewDelegate
        • RTBBannerAdLoadDelegate
        • RTBBannerAdInteractionDelegate
        • RTBFullscreenDelegate
        • RTBNativeAdLoadDelegate
        • RTBNativeAdInteractionDelegate
      • Enumerations
        • RTBGender
  • Sample App
Powered by GitBook
On this page
  • Create RTBFullscreenAd Instance
  • Listen to Callbacks
  • Request Ad
  • Show Ad
  • Complete Code Example
  1. Formats

Fullscreen (Interstitial)

Integrate fullscreen ads

PreviousBannerNextNative Ads

Last updated 2 months ago

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

Create RTBFullscreenAd Instance

Create an instance of :

val fullscreenAd = RTBFullscreenAd(this)

Listen to Callbacks

Through the use of , 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 with placementID and the bundleId. Please contact our for getting the needed IDs.

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

You will be notified about the loading success/failure through the

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 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:

fullscreenAd?.show(this)

The currency of bidFloor and priceCPM parameters is USD.

Complete Code Example

class MainActivity : AppCompatActivity(), RTBFullscreenDelegate {

    private var fullscreenAd: RTBFullscreenAd? = null

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        fullscreenAd = RTBFullscreenAd(this)

        // Set the interstitial delegate to listen to events
        fullscreenAd?.delegate = this

        // Request a fullscreen ad using the placement ID and bundle ID
        val rtbFullscreenRequestConfiguration = RTBFullscreenRequestConfiguration(placementId, bundleId)
        rtbFullscreenRequestConfiguration.sellerId = "<SELLERID>" // Optional
        fullscreenAd.load(rtbFullscreenRequestConfiguration)
    }

    // RTBFullscreenDelegate implementation:
    override fun fullscreenAdDidReceiveAd(fullscreenAd: RTBFullscreenAd, bidInfo: RTBBidInfo, networkName: String)
        // An ad has been loaded
        // Show the ad:
        fullscreenAd.show(this)
    }

    override fun fullscreenAdDidFailToReceiveAd(fullscreenAd: RTBFullscreenAd, error: String, networkName: String) {
        // Failed to load an ad
    }

    override fun fullscreenAdDidRecordClick(fullscreenAd: RTBFullscreenAd, networkName: String) {
        // The ad received a click
    }

    override fun fullscreenAdDidPauseForAd(fullscreenAd: RTBFullscreenAd, networkName: String) {
        // The app paused for displaying a fullscreen ad
    }

    override fun fullscreenAdDidResumeAfterAd(fullscreenAd: RTBFullscreenAd, networkName: String) {
        // The app resumed after dismissing a fullscreen ad
    }

}
RTBFullscreenAd
RTBFullscreenDelegate
RTBFullscreenRequestConfiguration
support
RTBFullscreenDelegate
RTBUserTargeting