Skip to main content

Interstitial Placement

Interstitial Placement (Direct)

Interstitial placements display fullscreen ads at natural transition points in your app. Use the direct integration when you don't use AdMob or GAM mediation.

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import tv.teads.sdk.combinedsdk.TeadsAdPlacementEventName
import tv.teads.sdk.combinedsdk.adplacement.TeadsAdPlacementInterstitial
import tv.teads.sdk.combinedsdk.adplacement.config.TeadsAdPlacementInterstitialConfig
import tv.teads.sdk.combinedsdk.adplacement.interfaces.TeadsAdPlacementEventsDelegate
import tv.teads.sdk.combinedsdk.adplacement.interfaces.core.TeadsAdPlacement

class InterstitialActivity : AppCompatActivity(), TeadsAdPlacementEventsDelegate {

private var interstitial: TeadsAdPlacementInterstitial? = null

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

// 1. Build the placement configuration
val config = TeadsAdPlacementInterstitialConfig(
articleUrl = "https://yoursite.com/article",
widgetId = "INT_MW_1", // Provided by your Teads account manager
installationKey = "YOUR_INSTALLATION_KEY"
)

// 2. Create the placement — context MUST be an Activity
interstitial = TeadsAdPlacementInterstitial(this, config, this)

// 3. Request the ad
interstitial?.loadAd()
}

override fun onPlacementEvent(
placement: TeadsAdPlacement<*, *>,
event: TeadsAdPlacementEventName,
data: Map<String, Any>?
) {
// 4. Show the ad as soon as it's ready
if (event == TeadsAdPlacementEventName.READY) {
interstitial?.show(this)
}
}

override fun onDestroy() {
super.onDestroy()
interstitial?.clean()
}
}
warning

For production, articleUrl, widgetId, and installationKey will be unique values provided by your product manager. Contact your local account manager to obtain them.

Lifecycle Events

The interstitial uses the standard TeadsAdPlacementEventsDelegate. The key events are:

EventMeaning
READYAd is preloaded — safe to call show(context)
FAILEDAd failed to load — fall back to unlocking content or a different flow
WILL_PRESENTFired right before the fullscreen interstitial is presented
PRESENTEDFired when the fullscreen interstitial has been presented
RENDEREDAd is on screen
VIEWEDAd met viewability criteria
CLICKEDUser tapped the ad (SDK opens the landing URL automatically)
WILL_DISMISSFired right before the fullscreen interstitial is dismissed
DISMISSEDUser closed the fullscreen ad — resume your flow

If you use AdMob or GAM mediation instead, see the Mediation — Interstitial guide.