AppOpenAd

abstract class AppOpenAd


App open ads are used to display ads when users enter your app. An AppOpenAd object contains all the data necessary to display an ad. Unlike interstitial ads, app open ads make it easy to provide an app branding area so that users understand the context in which they see the ad. Use one of the static load methods to load an AppOpenAd. Then call show to render it.

Summary

Nested types

An object for receiving event notifications for loading an app open ad.

Public constructors

Public functions

abstract String

Returns the ad unit ID.

abstract FullScreenContentCallback?

Gets the FullScreenContentCallback for this AppOpenAd.

abstract OnPaidEventListener?

Gets the OnPaidEventListener for this AppOpenAd.

abstract ResponseInfo

Returns the ResponseInfo for the loaded ad.

java-static Boolean
isAdAvailable(context: Context, adUnitId: String)

This function is deprecated.

Use isAdAvailable instead.

java-static Unit
load(
    context: Context!,
    adUnitId: String!,
    adRequest: AdRequest!,
    loadCallback: AppOpenAd.AppOpenAdLoadCallback!
)

Loads an AppOpenAd.

java-static AppOpenAd?
pollAd(context: Context, adUnitId: String)

This function is deprecated.

Use pollAd instead.

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 app open ad object will be displayed in immersive mode.

abstract Unit

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

abstract Unit
show(activity: Activity)

Shows the AppOpenAd.

Public constructors

AppOpenAd

AppOpenAd()

Public functions

getAdUnitId

abstract fun getAdUnitId(): String

Returns the ad unit ID.

getFullScreenContentCallback

abstract fun getFullScreenContentCallback(): FullScreenContentCallback?

Gets the FullScreenContentCallback for this AppOpenAd.

getOnPaidEventListener

abstract fun getOnPaidEventListener(): OnPaidEventListener?

Gets the OnPaidEventListener for this AppOpenAd.

getResponseInfo

abstract fun getResponseInfo(): ResponseInfo

Returns the ResponseInfo for the loaded ad.

isAdAvailable

java-static fun isAdAvailable(context: Context, adUnitId: String): Boolean

Returns true if there is an available app open ad loaded from startPreload.

load

java-static fun load(
    context: Context!,
    adUnitId: String!,
    adRequest: AdRequest!,
    loadCallback: AppOpenAd.AppOpenAdLoadCallback!
): Unit

Loads an AppOpenAd.

Parameters
context: Context!

The context.

adUnitId: String!

The ad unit ID.

adRequest: AdRequest!

An ad request with targeting information.

loadCallback: AppOpenAd.AppOpenAdLoadCallback!

An object that handles events for loading an app open ad.

pollAd

java-static fun pollAd(context: Context, adUnitId: String): AppOpenAd?

Retrieves the next app open ad loaded from startPreload, or null if no ad is available.

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 app open ad object will be displayed in immersive mode. Call this method before show. During show time, 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 app open ad.

setOnPaidEventListener

abstract fun setOnPaidEventListener(listener: OnPaidEventListener?): Unit

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

show

abstract fun show(activity: Activity): Unit

Shows the AppOpenAd.

Parameters
activity: Activity

The activity from which the AppOpenAd is shown from.