Rewarded Ads are loaded automatically. You can observe ad loading events by specifying the delegate:
Copy val rewarded = BIDRewarded (activity)
rearded. setLoadDelegate (rewardedLoadDelegate)
The delegate should implement the following methods:
Copy 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:
Copy rewarde. showRewarded (activity, showDelegate)
The delegate should implement the following methods:
Copy 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:
Copy rewarded. setAutoload ( false )
Once you disable autoload, you should load ads manually every time you need them to show:
Destroying of rewarded with resource release
Last updated 5 months ago