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.
- Kotlin
- Java
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()
}
}
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;
import java.util.Map;
public class InterstitialActivity extends AppCompatActivity implements TeadsAdPlacementEventsDelegate {
private TeadsAdPlacementInterstitial interstitial;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// 1. Build the placement configuration — this 3-arg constructor is a real
// Java-visible overload generated for the config's trailing default parameters
TeadsAdPlacementInterstitialConfig config = new TeadsAdPlacementInterstitialConfig(
"https://yoursite.com/article",
"INT_MW_1", // Provided by your Teads account manager
"YOUR_INSTALLATION_KEY"
);
// 2. Create the placement — context MUST be an Activity
interstitial = new TeadsAdPlacementInterstitial(this, config, this);
// 3. Request the ad
interstitial.loadAd();
}
@Override
public void onPlacementEvent(TeadsAdPlacement<?, ?> placement, TeadsAdPlacementEventName event, Map<String, ?> data) {
// 4. Show the ad as soon as it's ready
if (event == TeadsAdPlacementEventName.READY) {
interstitial.show(this);
}
}
@Override
protected void 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:
| Event | Meaning |
|---|---|
READY | Ad is preloaded — safe to call show(context) |
FAILED | Ad failed to load — fall back to unlocking content or a different flow |
WILL_PRESENT | Fired right before the fullscreen interstitial is presented |
PRESENTED | Fired when the fullscreen interstitial has been presented |
RENDERED | Ad is on screen |
VIEWED | Ad met viewability criteria |
CLICKED | User tapped the ad (SDK opens the landing URL automatically) |
WILL_DISMISS | Fired right before the fullscreen interstitial is dismissed |
DISMISSED | User closed the fullscreen ad — resume your flow |
If you use AdMob or GAM mediation instead, see the Mediation — Interstitial guide.