Skip to main content

Banners

Loading an Banners

To load a banner, create a BannerView instance. Important: for a single instance of a banner, load() and show() can only be called once. Create new instance for every new banner (in case refreshing banner by timeout as well).

val banner = BannerView(context)

Set BannerListener for receiving all-related events, including loading/displaying and revenue callbacks.

banner.setBannerListener(object : BannerListener {
override fun onAdLoaded(ad: Ad) {
// ready to show
}

override fun onAdLoadFailed(cause: BidonError) {
}

override fun onAdShowFailed(cause: BidonError) {
}

override fun onAdShown(ad: Ad) {
}

override fun onAdClicked(ad: Ad) {
}

override fun onAdExpired(ad: Ad) {
}

override fun onRevenuePaid(ad: Ad) {
// ad.price - ad revenue from mediation
}
})
banner.setAdSize(BannerSize.Banner)
banner.load(pricefloor) // or use DefaultMinPrice

Displaying banners

To show banner, place it to you AdContainer and invoke show()

banner.show()

BannerSize

Ad View FormatSizeDescription
Banner320 x 50Fixed size banner for phones
LeaderBoard728 x 90Fixed size banner for pads
MRec300 x 250Fixed medium rectangle banners
Adaptive-/- x 50/90Flexible width banners