RewardedInterstitialAd

public interface RewardedInterstitialAd extends Ad


Rewarded interstitials are full screen incentivized ads that reward users and appear automatically during natural app transitions.

Unlike com.google.android.libraries.ads.mobile.sdk.rewarded.RewardedAd, users aren’t required to opt-in to view a rewarded interstitial. Instead of the opt-in prompt in rewarded ads, rewarded interstitials require an intro screen that announces the reward and gives users a chance to opt-out if they wish to do so.

Summary

Nested types

Public methods

abstract RewardedInterstitialAdEventCallback

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

abstract @NonNull Bundle

Gets all available ad metadata for this RewardedInterstitialAd.

abstract @NonNull RewardItem

Gets the RewardItem for the loaded ad.

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

Loads a RewardedInterstitialAd, providing the result via adLoadCallback.

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

Loads a RewardedInterstitialAd, providing the result via adLoadCallback.

abstract void

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

abstract void
setImmersiveMode(boolean immersiveModeEnabled)

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

abstract void

Sets ServerSideVerificationOptions for this RewardedInterstitialAd.

abstract void
show(
    @NonNull Activity activity,
    @NonNull OnUserEarnedRewardListener onUserEarnedRewardListener
)

Shows the 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 RewardedInterstitialAdEventCallback getAdEventCallback()

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

getAdMetadata

abstract @NonNull Bundle getAdMetadata()

Gets all available ad metadata for this RewardedInterstitialAd. Ad metadata is empty if the loaded ad doesn't have metadata. Ad metadata may update after loading. Override RewardedInterstitialAdEventCallback.onAdMetadataChanged to listen for changes:

ad.adEventCallback = object : RewardedInterstitialAdEventCallback {
override fun onAdMetadataChanged() {
val metadata = ad.getAdMetadata()
}
}

getRewardItem

abstract @NonNull RewardItem getRewardItem()

Gets the RewardItem for the loaded ad.

load

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

Loads a RewardedInterstitialAd, providing the result via adLoadCallback.

Parameters
@NonNull AdRequest adRequest

An AdRequest with targeting information.

@NonNull AdLoadCallback<@NonNull RewardedInterstitialAd> adLoadCallback

A callback to be invoked when a rewarded interstitial ad finishes loading.

loadFromAdResponse

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

Loads a RewardedInterstitialAd, providing the result via adLoadCallback.

Parameters
@NonNull String adResponse

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

@NonNull AdLoadCallback<@NonNull RewardedInterstitialAd> adLoadCallback

A callback to be invoked when loading completes.

setAdEventCallback

abstract void setAdEventCallback(
    RewardedInterstitialAdEventCallback adEventCallback
)

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

setImmersiveMode

abstract void setImmersiveMode(boolean immersiveModeEnabled)

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

setServerSideVerificationOptions

abstract void setServerSideVerificationOptions(
    @NonNull ServerSideVerificationOptions options
)

Sets ServerSideVerificationOptions for this RewardedInterstitialAd.

show

abstract void show(
    @NonNull Activity activity,
    @NonNull OnUserEarnedRewardListener onUserEarnedRewardListener
)

Shows the ad.

Parameters
@NonNull Activity activity

An Activity context from which to present the ad.

@NonNull OnUserEarnedRewardListener onUserEarnedRewardListener

The listener to be notified when user earns a reward.