RewardedInterstitialAd

abstract class RewardedInterstitialAd


Rewarded interstitials are full screen ads that reward users and can be shown without a user opt in.

This ad format is different than com.google.android.gms.ads.rewarded.RewardedAd because rewarded ads require the user to opt-in to watching the video. This ad format is different than com.google.android.gms.ads.interstitial.InterstitialAd because interstitial ads do not reward the user.

Summary

Public constructors

Public functions

abstract Bundle

Gets all available ad metadata for this RewardedInterstitialAd.

abstract String

Returns the ad unit ID.

abstract FullScreenContentCallback?

Gets the FullScreenContentCallback for this RewardedInterstitialAd.

abstract OnAdMetadataChangedListener?

Gets the OnAdMetadataChangedListener for this RewardedInterstitialAd.

abstract OnPaidEventListener?

Gets the OnPaidEventListener for this RewardedInterstitialAd.

abstract ResponseInfo

Returns information about the loaded ad.

abstract RewardItem

Gets reward item for the loaded rewarded interstitial ad.

java-static Unit
load(
    context: Context,
    adUnitId: String,
    adManagerAdRequest: AdManagerAdRequest,
    loadCallback: RewardedInterstitialAdLoadCallback
)

Loads a RewardedInterstitialAd.

java-static Unit
load(
    context: Context,
    adUnitId: String,
    adRequest: AdRequest,
    loadCallback: RewardedInterstitialAdLoadCallback
)

Loads a RewardedInterstitialAd.

abstract Unit
setFullScreenContentCallback(
    fullScreenContentCallback: FullScreenContentCallback?
)

Registers a callback to be invoked when ads show and dismiss full screen content.

abstract Unit
setImmersiveMode(immersiveModeEnabled: Boolean)

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

abstract Unit

Registers a callback to be invoked when the rewarded interstitial ad's metadata changes.

abstract Unit

Registers a callback to be invoked when this ad is estimated to have earned money.

abstract Unit

Sets ServerSideVerificationOptions for this rewarded interstitial ad.

abstract Unit
show(
    activity: Activity,
    onUserEarnedRewardListener: OnUserEarnedRewardListener
)

Shows the rewarded interstitial ad.

Public constructors

RewardedInterstitialAd

RewardedInterstitialAd()

Public functions

getAdMetadata

abstract fun getAdMetadata(): Bundle

Gets all available ad metadata for this RewardedInterstitialAd. Ad metadata is empty if the ad doesn't have metadata. Ad metadata may update. Use onAdMetadataChanged to listen for changes.

getAdUnitId

abstract fun getAdUnitId(): String

Returns the ad unit ID.

getFullScreenContentCallback

abstract fun getFullScreenContentCallback(): FullScreenContentCallback?

Gets the FullScreenContentCallback for this RewardedInterstitialAd.

getOnAdMetadataChangedListener

abstract fun getOnAdMetadataChangedListener(): OnAdMetadataChangedListener?

Gets the OnAdMetadataChangedListener for this RewardedInterstitialAd.

getOnPaidEventListener

abstract fun getOnPaidEventListener(): OnPaidEventListener?

Gets the OnPaidEventListener for this RewardedInterstitialAd.

getResponseInfo

abstract fun getResponseInfo(): ResponseInfo

Returns information about the loaded ad.

getRewardItem

abstract fun getRewardItem(): RewardItem

Gets reward item for the loaded rewarded interstitial ad.

load

java-static fun load(
    context: Context,
    adUnitId: String,
    adManagerAdRequest: AdManagerAdRequest,
    loadCallback: RewardedInterstitialAdLoadCallback
): Unit

Loads a RewardedInterstitialAd.

Parameters
context: Context

The context.

adUnitId: String

The ad unit ID.

adManagerAdRequest: AdManagerAdRequest

A Google Ad Manager ad request with targeting information.

loadCallback: RewardedInterstitialAdLoadCallback

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

load

java-static fun load(
    context: Context,
    adUnitId: String,
    adRequest: AdRequest,
    loadCallback: RewardedInterstitialAdLoadCallback
): Unit

Loads a RewardedInterstitialAd.

Parameters
context: Context

The context.

adUnitId: String

The ad unit ID.

adRequest: AdRequest

An ad request with targeting information.

loadCallback: RewardedInterstitialAdLoadCallback

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

setFullScreenContentCallback

abstract fun setFullScreenContentCallback(
    fullScreenContentCallback: FullScreenContentCallback?
): Unit

Registers a callback to be invoked when ads show and dismiss full screen content.

setImmersiveMode

abstract fun setImmersiveMode(immersiveModeEnabled: Boolean): Unit

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

setOnAdMetadataChangedListener

abstract fun setOnAdMetadataChangedListener(listener: OnAdMetadataChangedListener?): Unit

Registers a callback to be invoked when the rewarded interstitial ad's metadata changes.

setOnPaidEventListener

abstract fun setOnPaidEventListener(listener: OnPaidEventListener?): Unit

Registers a callback to be invoked when this ad is estimated to have earned money.

setServerSideVerificationOptions

abstract fun setServerSideVerificationOptions(
    options: ServerSideVerificationOptions!
): Unit

Sets ServerSideVerificationOptions for this rewarded interstitial ad.

show

abstract fun show(
    activity: Activity,
    onUserEarnedRewardListener: OnUserEarnedRewardListener
): Unit

Shows the rewarded interstitial ad.

Parameters
activity: Activity

The activity from which the rewarded ad should be shown.

onUserEarnedRewardListener: OnUserEarnedRewardListener

The listener to be notified when user earns a reward.