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(Activity) to render it.
| class | AppOpenAd.AppOpenAdLoadCallback | An object for receiving event notifications for loading an app open ad. | |
| @interface | AppOpenAd.AppOpenAdOrientation | App open ad orientation. | |
| int | APP_OPEN_AD_ORIENTATION_LANDSCAPE | Landscape orientation. |
| int | APP_OPEN_AD_ORIENTATION_PORTRAIT | Portrait orientation. |
| abstract String |
getAdUnitId()
Returns the ad unit ID.
|
| abstract FullScreenContentCallback |
getFullScreenContentCallback()
Gets the
FullScreenContentCallback
for this AppOpenAd.
|
| abstract OnPaidEventListener |
getOnPaidEventListener()
Gets the
OnPaidEventListener
for this AppOpenAd.
|
| abstract ResponseInfo |
getResponseInfo()
Returns the
ResponseInfo
for the loaded ad.
|
| static boolean |
isAdAvailable(Context
context, String adUnitId)
Returns
true if there is an available app open ad loaded from
MobileAds.startPreload(Context, List, PreloadCallback).
|
| static void |
load(Context
context, String adUnitId,
AdRequest
adRequest, int orientation,
AppOpenAd.AppOpenAdLoadCallback loadCallback)
This method is deprecated. Use
load(Context, String, AdRequest, AppOpenAdLoadCallback)
instead.
|
| static void | |
| static void |
load(Context
context, String adUnitId,
AdManagerAdRequest adManagerAdRequest, int orientation,
AppOpenAd.AppOpenAdLoadCallback loadCallback)
This method is deprecated. Use
load(Context, String, AdRequest, AppOpenAdLoadCallback)
instead.
|
| static AppOpenAd |
pollAd(Context
context, String adUnitId)
Retrieves the next app open ad loaded from
MobileAds.startPreload(Context, List, PreloadCallback), or
null if no ad is available.
|
| abstract void |
setFullScreenContentCallback(FullScreenContentCallback
fullScreenContentCallback)
Registers a callback to be invoked when ads show and dismiss full screen
content.
|
| abstract void |
setImmersiveMode(boolean immersiveModeEnabled)
Sets a flag that controls if this app open ad object will be displayed in
immersive mode.
|
| abstract void |
setOnPaidEventListener(OnPaidEventListener
listener)
Registers a callback to be invoked when this ad is estimated to have earned
money.
|
| abstract void |
Landscape orientation.
Portrait orientation.
Returns the ad unit ID.
Gets the FullScreenContentCallback
for this AppOpenAd.
Gets the OnPaidEventListener
for this AppOpenAd.
Returns the ResponseInfo
for the loaded ad.
Returns true if there is an available app open ad loaded from
MobileAds.startPreload(Context, List, PreloadCallback).
This method is deprecated.
Use
load(Context, String, AdRequest, AppOpenAdLoadCallback) instead.
Loads an AppOpenAd.
| context | The context. |
|---|---|
| adUnitId | The ad unit ID. |
| adRequest | An ad request with targeting information. |
| orientation | The orientation that the ad will be presented in. |
| loadCallback | An object that handles events for loading an app open ad. |
Loads an AppOpenAd.
| context | The context. |
|---|---|
| adUnitId | The ad unit ID. |
| adRequest | An ad request with targeting information. |
| loadCallback | An object that handles events for loading an app open ad. |
This method is deprecated.
Use
load(Context, String, AdRequest, AppOpenAdLoadCallback) instead.
Loads an AppOpenAd.
| context | The context. |
|---|---|
| adUnitId | The ad unit ID. |
| adManagerAdRequest | A Google Ad Manager ad request with targeting information. |
| orientation | The orientation that the ad will be presented in. |
| loadCallback | An object that handles events for loading an Ad Manager app open ad. |
Retrieves the next app open ad loaded from
MobileAds.startPreload(Context, List, PreloadCallback), or null
if no ad is available.
Registers a callback to be invoked when ads show and dismiss full screen content.
Sets a flag that controls if this app open ad object will be displayed in immersive
mode. Call this method before
show(Activity). 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.
Registers a callback to be invoked when this ad is estimated to have earned money.
Shows the AppOpenAd.
| activity | The activity from which the AppOpenAd is shown from. |
|---|