com.applovin.sdk.AppLovinAdService |
This class is responsible for loading and displaying advertisements.
An instance of this class can be obtained from an AppLovinSdk
instance via getAdService()
.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String | URI_AD_SERVICE | This is an object name for custom AppLovin URL. | |||||||||
String | URI_API_SERVICE | This is an object name for custom AppLovin URL. | |||||||||
String | URI_CLOSE_AD | This is an endpoint name for custom AppLovin URL for forcing ad container to close itself:
applovin://com.applovin.sdk/adservice/close_ad |
|||||||||
String | URI_CONTRACT_AD | This is an endpoint name for custom AppLovin URL for forcing an ad expanded before
using URI_EXPAND_AD contract back
applovin://com.applovin.sdk/adservice/contract_ad |
|||||||||
String | URI_EXPAND_AD | This is an endpoint name for custom AppLovin URL for forcing ad container to
expand itself (using MRAID mechanism):
applovin://com.applovin.sdk/adservice/expand_ad |
|||||||||
String | URI_LAUNCH_APP | This is an object name for custom AppLovin URL. | |||||||||
String | URI_NEXT_AD | This is an endpoint name for custom AppLovin URL for forcing container to load the next ad:
applovin://com.applovin.sdk/adservice/next_ad |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
abstract void |
addAdUpdateListener(AppLovinAdUpdateListener adListener)
This method is deprecated.
Use
addAdUpdateListener(AppLovinAdUpdateListener adListener, AppLovinAdSize adSize) instead.
| ||||||||||
abstract void |
addAdUpdateListener(AppLovinAdUpdateListener adListener, AppLovinAdSize adSize)
Ad a listener that will be updated every time a new ad is loaded.
| ||||||||||
abstract String |
getBidToken()
Generates a token used for advanced header bidding.
| ||||||||||
abstract boolean |
hasPreloadedAd(AppLovinAdSize adSize)
This method is deprecated.
Manually preloading ads in the background has been deprecated and will be removed in a future SDK version. Please use
loadNextAd(AppLovinAdSize, AppLovinAdLoadListener) to load ads to display.
| ||||||||||
abstract boolean |
hasPreloadedAdForZoneId(String zoneId)
This method is deprecated.
Manually preloading ads in the background has been deprecated and will be removed in a future SDK version. Please use
loadNextAdForZoneId(String, AppLovinAdLoadListener) to load ads to display.
| ||||||||||
abstract void |
loadNextAd(AppLovinAdSize adSize, AppLovinAdLoadListener callback)
Fetch a new ad, of a given size, notifying a supplied listener on completion.
| ||||||||||
abstract void |
loadNextAdForAdToken(String adToken, AppLovinAdLoadListener callback)
Fetch a new ad for the given ad token.
| ||||||||||
abstract void |
loadNextAdForZoneId(String zoneId, AppLovinAdLoadListener callback)
Fetch a new ad, for a given zone, notifying a supplied listener on completion.
| ||||||||||
abstract void |
loadNextAdForZoneIds(List<String> zoneIds, AppLovinAdLoadListener callback)
Fetch a new ad for any of the provided zone ids.
| ||||||||||
abstract void |
loadNextMediatedAd(AppLovinAdSize adSize, AppLovinAdLoadListener callback)
Fetch a new ad, of a given size, notifying a supplied listener on completion.
| ||||||||||
abstract void |
preloadAd(AppLovinAdSize adSize)
This method is deprecated.
Manually preloading ads in the background has been deprecated and will be removed in a future SDK version. Please use
loadNextAd(AppLovinAdSize, AppLovinAdLoadListener) to load ads to display.
| ||||||||||
abstract void |
preloadAdForZoneId(String zoneId)
This method is deprecated.
Manually preloading ads in the background has been deprecated and will be removed in a future SDK version. Please use
loadNextAdForZoneId(String, AppLovinAdLoadListener) to load ads to display.
| ||||||||||
abstract void |
removeAdUpdateListener(AppLovinAdUpdateListener adListener, AppLovinAdSize adSize)
Remove a listener that was notified every time an ad was loaded.
|
This is an object name for custom AppLovin URL. For example:
applovin://com.applovin.sdk/adservice/*
This is an object name for custom AppLovin URL. For example:
applovin://com.applovin.sdk/api/*
This is an endpoint name for custom AppLovin URL for forcing ad container to close itself:
applovin://com.applovin.sdk/adservice/close_ad
This is an endpoint name for custom AppLovin URL for forcing an ad expanded before using URI_EXPAND_AD contract back
applovin://com.applovin.sdk/adservice/contract_ad
This is an endpoint name for custom AppLovin URL for forcing ad container to expand itself (using MRAID mechanism):
applovin://com.applovin.sdk/adservice/expand_ad
This is an object name for custom AppLovin URL. For example:
applovin://com.applovin.sdk/launch/*
This is an endpoint name for custom AppLovin URL for forcing container to load the next ad:
applovin://com.applovin.sdk/adservice/next_ad
This method is deprecated.
Use addAdUpdateListener(AppLovinAdUpdateListener adListener, AppLovinAdSize adSize)
instead.
Overloaded method for addAdUpdateListener(AppLovinAdUpdateListener, AppLovinAdSize)
, where ad size is defaulted to BANNER.
adListener | A listener for the new ads. Must not be null. |
---|
Ad a listener that will be updated every time a new ad is loaded. Each listener only listens to ads that are of the given size.
adListener | A listener for the new ads. Must not be null. |
---|---|
adSize | The size of the ad. |
Generates a token used for advanced header bidding.
This method is deprecated.
Manually preloading ads in the background has been deprecated and will be removed in a future SDK version. Please use loadNextAd(AppLovinAdSize, AppLovinAdLoadListener)
to load ads to display.
This method is deprecated.
Manually preloading ads in the background has been deprecated and will be removed in a future SDK version. Please use loadNextAdForZoneId(String, AppLovinAdLoadListener)
to load ads to display.
Fetch a new ad, of a given size, notifying a supplied listener on completion.
adSize | Size of an ad to load. Must not be null. |
---|---|
callback | A callback to notify of the fact that the ad is loaded. Must not be null. A reference to the callback will be persisted until the ad is loaded. |
Fetch a new ad for the given ad token. Provided ad token must be received from AppLovin S2S API.
Please note: this method is designed to be called by SDK mediation providers. Please use
loadNextAdForZoneId(String, AppLovinAdLoadListener)
for regular integrations.
adToken | Ad token returned from AppLovin S2S API. Must not be null. |
---|---|
callback | A callback to notify that the ad has been loaded. Must not be null. |
Fetch a new ad, for a given zone, notifying a supplied listener on completion.
zoneId | The zone to load an ad for. Must not be null. |
---|---|
callback | A callback to notify of the fact that the ad is loaded. |
Fetch a new ad for any of the provided zone ids.
Please note: this method is designed to be called by SDK mediation providers. Please use
loadNextAdForZoneId(String, AppLovinAdLoadListener)
for regular integrations.
zoneIds | A list of zone identifiers for which an ad should be loaded. Must not be null. |
---|---|
callback | A callback to notify that the ad has been loaded. Must not be null. |
Fetch a new ad, of a given size, notifying a supplied listener on completion. This ad will be served using AppLovin Mediation layer, so it may actually be rendered by a third-party SDK
adSize | Size of an ad to load. Must not be null. |
---|---|
callback | A callback to notify of the fact that the ad is loaded. Must not be null. A reference to the callback will be persisted until the ad is loaded. |
This method is deprecated.
Manually preloading ads in the background has been deprecated and will be removed in a future SDK version. Please use loadNextAd(AppLovinAdSize, AppLovinAdLoadListener)
to load ads to display.
This method is deprecated.
Manually preloading ads in the background has been deprecated and will be removed in a future SDK version. Please use loadNextAdForZoneId(String, AppLovinAdLoadListener)
to load ads to display.
Remove a listener that was notified every time an ad was loaded. The listener must have been added through addAdUpdateListener()
.
adListener | Listener to remove. |
---|---|
adSize | The size of the ad for which this listener should stop receiving notifications. |