Bidapp Ads
  • 🎁Ab_dout
  • Integration
    • iOS
      • Getting started
      • Additional Settings
      • App Policy Settings
      • Serverless Settings
      • Interstitial Ads
      • Rewarded Ads
      • Banner Ads
      • SKAdNetwork
      • SwiftUI
    • Android
      • Getting started
      • Additional Settings
      • App Policy Settings
      • Serverless Settings
      • Interstitial Ads
      • Rewarded Ads
      • Banner Ads
      • Jetpack Compose
  • PLUGINS
    • Kotlin Multiplatform
      • Getting started
      • Android Platform Setup
      • iOS Platfrom Setup
      • App Policy Settings
      • Interstitial Ads
      • Rewarded Ads
      • Banner Ads
    • Unreal Engine
      • Getting started
      • App Policy Settings
      • Interstitial Ads
      • Rewarded Ads
      • Banner Ads
      • MREC
    • Unity
      • Getting started
      • Android
      • iOS
      • App Policy Settings
      • Interstitial Ads
      • Rewarded Ads
      • Banner Ads
Powered by GitBook
On this page
  • Stopping and Starting Auto-Load
  • Destroying of rewarded with resource release

Was this helpful?

  1. PLUGINS
  2. Kotlin Multiplatform

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()
PreviousInterstitial AdsNextBanner Ads

Last updated 11 months ago

Was this helpful?