Rewarded Ads
Rewarded Ads are loaded automatically. You can observe ad loading events by specifying the delegate:
val rewarded = BIDRewarded(activity)
rearded.setLoadDelegate(rewardedLoadDelegate)
The delegate should implement the following methods:
var rewardedLoadDelegate : BIDFullLoad? = object : BIDFullLoad {
override fun load(info: BIDAdInfo) {
log("Rewarded - didLoadAd - adtag: ${info.adTag}")
}
override fun failLoad(info: BIDAdInfo, error: String) {
log("Rewarded - didFailToLoadAd - adtag: ${info.adTag} Error:$error")
}
}
To show an reward ad, call showRewarded
instance method:
rewarde.showRewarded(activity, showDelegate)
The delegate should implement the following methods:
var showDelegate: BIDFullShow? = object : BIDFullShow {
override fun display(info: BIDAdInfo) {
print("Rewarded - didDisplayAd. AdInfo: $adInfo")
}
override fun click(info: BIDAdInfo) {
print("Rewarded - didClickAd. AdInfo: $adInfo")
}
override fun hide(info: BIDAdInfo) {
print("Rewarded - didHideAd. AdInfo: $adInfo")
}
override fun failToDisplay(info: BIDAdInfo, error: String) {
print("Rewarded - failToDisplay. All networks fail to display - error: $error")
}
override fun allNetworksFailedToDisplay() {
print("Rewarded - allNetworksDidFailToDisplayAd." )
}
override fun reward() {
print("Rewarded - didRewardUser")
}
}
Stopping and Starting Auto-Load
By default, rewarded preload ads before any load attempt. So a rewarded can use already preloaded ads instead of waiting on a manual load call to load new ads. To disable this feature you need to call the following method:
rewarded.setAutoload(false)
Once you disable autoload, you should load ads manually every time you need them to show:
rewarded.load()
Destroying of rewarded with resource release
rewarded.destroy()
Last updated
Was this helpful?