Banner

Integrate banner ads

Banner ads are displayed in RTBBannerView instances, so the first step towards integrating banner ads is to create an instance of RTBBannerView and add it to your view hierarchy.

Create an RTBBannerView Instance

Create an instance of RTBBannerViewarrow-up-right:

val bannerAdView = RTBBannerView(this)
bannerAdView.bannerSize = RTBBannerSize.banner320x50

The banner sizearrow-up-right will be used later while loading a new banner ad.

Listen to Callbacks

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

bannerAdView.delegate = this

Request Ad

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

val rtbBannerRequestConfiguration = RTBBannerRequestConfiguration(<PLACEMENT_ID>, <BUNDLE_ID>)
rtbBannerRequestConfiguration.sellerId = "<SELLERID>" // Optional
rtbBannerRequestConfiguration.bidFloor = <BID_FLOOR>  // Optional
bannerAdView.load(rtbBannerRequestConfiguration)

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

circle-info

The currency of bidFloor and priceCPM parameters is USD.

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.

Complete Code Example

Last updated