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 interstitial with resource release

Was this helpful?

  1. PLUGINS
  2. Kotlin Multiplatform

Interstitial Ads

Interstitial Ads are loaded automatically. You can observe ad loading events by specifying the delegate:

val interstitial: BIDInterstitial? = BIDInterstitial(activity)
interstitial?.setLoadDelegate(interstitialLoadDelegate)

The delegate should implement the following methods:

var interstitialLoadDelegate : BIDFullLoad? = object : BIDFullLoad {
    override fun load(info: BIDAdInfo) {
        log("Interstitial - didLoadAd - adtag: ${info.adTag}")
    }

    override fun failLoad(info: BIDAdInfo, error: String) {
        log("Interstitial - didFailToLoadAd - adtag: ${info.adTag} Error:$error")
   }
}

To show an interstitial ad, call showInterstitial instance method:

interstitial.showInterstitial(activity, showDelegate)

The delegate should implement the following methods:

var fullShow : BIDFullShow? = object : BIDFullShow {
    override fun display(info: BIDAdInfo) {
        print("Interstitial - didDisplayAd. AdInfo: $adInfo")
    }

    override fun click(info: BIDAdInfo) {
        print("Interstitial - didClickAd. AdInfo: $adInfo")
    }

    override fun hide(info: BIDAdInfo) {
        print("Interstitial - didHideAd. AdInfo: $adInfo")
    }

    override fun failToDisplay(info: BIDAdInfo, error: String) {
        print("Interstitial - failToDisplay. All networks fail to display - error: $error")
    }

    override fun allNetworksFailedToDisplay() {
        print("Interstitial - allNetworksDidFailToDisplayAd." )
    }
}

Stopping and Starting Auto-Load

By default, Interstitials preload ads before any load attempt. So an Interstitial 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:

interstitial.setAutoload(false)

Once you disable autoload, you should load ads manually every time you need them to show:

interstitial.load()

Destroying of interstitial with resource release

interstitial.destroy()
PreviousApp Policy SettingsNextRewarded Ads

Last updated 11 months ago

Was this helpful?