InterstitialAd

Interface for interstitial ads, a type of full-screen ad.

General usage of insterstitials:

  1. Moloco.createInterstitial() instance first

  2. Fetch ortb bid response

  3. load() bid response. AdLoad.Listener or isLoaded can be used for load status check

  4. show() ad when needed. You can also provide an optional InterstitialAdShowListener.

  5. Once ad is not needed anymore destroy() it to prevent memory leaks

Things to note:

  • In order to load an another ad, call load() again provided with a new bid response

  • load() call will force finish and hide the currently displaying ad. Therefore, if there's a need to implement preloading of multiple ads, consider creation of an additional interstitial ad instance via Moloco.createInterstitial()

Samples

com.moloco.sdk.publisher.InterstitialAdActivitySample

Properties

Link copied to clipboard
abstract val isLoaded: Boolean

Property indicating if the ad is loaded

Functions

Link copied to clipboard
abstract fun destroy()

Release all resources held by this object, and prevent further use.

Link copied to clipboard
abstract fun load(bidResponseJson: String, listener: AdLoad.Listener?)

Loads the ad with the specified bidResponseJson and listener. If the ad is currently being displayed, the underlying ad object will be destroyed before loading a new one.

Link copied to clipboard
abstract fun show(listener: InterstitialAdShowListener?)

Shows the ad to the user.