An object for requesting ads.
Nested Class Summary
class | AdLoader.Builder | Builder for a AdLoader . |
Public Method Summary
String |
getMediationAdapterClassName()
This method is deprecated. Use
NativeAd.getResponseInfo() instead.
|
boolean |
isLoading()
Returns
true if the ad is loading.
|
void |
loadAd(PublisherAdRequest
publisherAdRequest)
This method is deprecated. Use {
loadAd(AdManagerAdRequest) }.
|
void | |
void | |
void |
Inherited Method Summary
Public Methods
public String getMediationAdapterClassName ()
This method is deprecated.
Use NativeAd.getResponseInfo()
instead.
Returns the mediation adapter class name. In the case of a mediated ad response,
this is the name of the class that was responsible for performing the ad request and
returning the ad. For non-mediated responses, this value is null
.
public boolean isLoading ()
Returns true
if the ad is loading. If multiple ads are requested,
returns true
until all ads finish loading.
public void loadAd (PublisherAdRequest publisherAdRequest)
This method is deprecated.
Use {loadAd(AdManagerAdRequest)
}.
Loads an ad.
Parameters
publisherAdRequest | An Ad Manager ad request. |
---|
public void loadAd (AdRequest adRequest)
Loads an ad.
Parameters
adRequest | An object containing all of the request information. |
---|
public void loadAd (AdManagerAdRequest adManagerAdRequest)
Loads an ad.
Parameters
adManagerAdRequest | An Ad Manager ad request. |
---|
public void loadAds (AdRequest adRequest, int maxNumberOfAds)
Send a request for maxNumberOfAds
ads. The AdLoader will send up to
maxNumberOfAds
callbacks in response, which may include any combination of
the following:
NativeContentAd.OnContentAdLoadedListener.onContentAdLoaded(NativeContentAd)
NativeAppInstallAd.OnAppInstallAdLoadedListener.onAppInstallAdLoaded(NativeAppInstallAd)
NativeCustomFormatAd.OnCustomFormatAdLoadedListener.onCustomFormatAdLoaded(NativeCustomFormatAd)
NativeCustomTemplateAd.OnCustomTemplateAdLoadedListener.onCustomTemplateAdLoaded(NativeCustomTemplateAd)
NativeAd.OnNativeAdLoadedListener.onNativeAdLoaded(NativeAd)
UnifiedNativeAd.OnUnifiedNativeAdLoadedListener.onUnifiedNativeAdLoaded(UnifiedNativeAd)
AdListener.onAdFailedToLoad(LoadAdError)
isLoading()
inside their implementations of these methods to determine whether the AdLoader has
completely finished loading ads.
Parameters
adRequest | An object containing all of the request information. |
---|---|
maxNumberOfAds | An integer denoting the maximum number of ads to load. |