Separate Loading and Rendering of Banner Ads
Request Ad
val configuration = RTBBannerRequestConfiguration(<PLACEMENT_ID>, <BUNDLE_ID>)
configuration.sellerId = "<SELLERID>" // Optional
configuration.bidFloor = <BID_FLOOR> // Optional
RTBBannerAdProvider.loadBannerAd(context, RTBBannerSize.banner320x50, rtbBannerRequestConfiguration, bannerLoadListener)Optional - set user targeting
configuration.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 ignoredGet Loaded Banner View
override fun bannerAdDidReceiveAd(bannerBid: RTBBannerBid) {
// Optionally - examine bid details:
val priceCPM = bannerBid.priceCPM
val bannerView = RTBBannerAdProvider.getBannerView(context, bannerBid, interactionListner)
// Add the banner view to the layout
}Complete Code Example
Last updated