InterstitialAd

public interface InterstitialAd extends Ad


A full page ad experience at natural transition points such as a page change, an app launch, or a game level load. Interstitials use a close button that removes the ad from the user's experience.

Summary

Nested types

public static class InterstitialAd.Companion

Public methods

abstract InterstitialAdEventCallback

Optional callback for ad events during the lifecycle of this InterstitialAd.

default static final void
load(
    @NonNull AdRequest adRequest,
    @NonNull AdLoadCallback<@NonNull InterstitialAd> adLoadCallback
)

Loads an InterstitialAd, providing the result via adLoadCallback.

default static final void
loadFromAdResponse(
    @NonNull String adResponse,
    @NonNull AdLoadCallback<@NonNull InterstitialAd> adLoadCallback
)

Loads an InterstitialAd, providing the result via adLoadCallback.

abstract void

Optional callback for ad events during the lifecycle of this InterstitialAd.

abstract void
setImmersiveMode(boolean immersiveModeEnabled)

Sets a flag that controls if this interstitial object will be displayed in immersive mode.

abstract void
show(@NonNull Activity activity)

Shows the interstitial ad.

Inherited methods

From com.google.android.libraries.ads.mobile.sdk.common.Ad
abstract void

Destroys the ad, stopping any extra processing and destroying resources associated with the ad.

abstract long

An identifier for a placement in reporting.

abstract @NonNull ResponseInfo

Gets information about the ad response for this ad.

abstract void
setPlacementId(long placementId)

An identifier for a placement in reporting.

Public methods

getAdEventCallback

abstract InterstitialAdEventCallback getAdEventCallback()

Optional callback for ad events during the lifecycle of this InterstitialAd.

load

default static final void load(
    @NonNull AdRequest adRequest,
    @NonNull AdLoadCallback<@NonNull InterstitialAd> adLoadCallback
)

Loads an InterstitialAd, providing the result via adLoadCallback.

Parameters
@NonNull AdRequest adRequest

An ad request with targeting information.

@NonNull AdLoadCallback<@NonNull InterstitialAd> adLoadCallback

A callback to be invoked when an interstitial ad finishes loading.

loadFromAdResponse

default static final void loadFromAdResponse(
    @NonNull String adResponse,
    @NonNull AdLoadCallback<@NonNull InterstitialAd> adLoadCallback
)

Loads an InterstitialAd, providing the result via adLoadCallback.

Parameters
@NonNull String adResponse

An ad response from a server-to-server ad request.

@NonNull AdLoadCallback<@NonNull InterstitialAd> adLoadCallback

A callback to be invoked when loading completes.

setAdEventCallback

abstract void setAdEventCallback(InterstitialAdEventCallback adEventCallback)

Optional callback for ad events during the lifecycle of this InterstitialAd.

setImmersiveMode

abstract void setImmersiveMode(boolean immersiveModeEnabled)

Sets a flag that controls if this interstitial object will be displayed in immersive mode. Call this method before InterstitialAd.show. During InterstitialAd.show, if this flag is on and immersive mode is supported, the interstitial ad will turn on the SYSTEM_UI_FLAG_IMMERSIVE_STICKY & SYSTEM_UI_FLAG_HIDE_NAVIGATION flags.

show

abstract void show(@NonNull Activity activity)

Shows the interstitial ad.

Parameters
@NonNull Activity activity

An Activity context from which to present the ad.