Builder for a AdLoader.
|
Builder(Context
context, String adUnitID)
Creates a new
AdLoader.Builder
for constructing an AdLoader.
|
Creates a new AdLoader.Builder
for constructing an AdLoader.
| context | The context. |
|---|---|
| adUnitID | The ad unit ID. |
Registers a listener to handle loading a Google Ad Manager banner ad.
| listener | The callback that will run when a banner ad loads. |
|---|---|
| adSizes | Sets the supported sizes of the banner ad. |
| IllegalArgumentException | If adSizes is null or empty. |
|---|
Enables the AdLoader to load custom format ads.
| customFormatId | Custom format ID defined in the Ad Manager UI. |
|---|---|
| adLoadedListener | A listener to be called when a NativeCustomFormatAd
loads. |
| customClickListener | An optional listener to define custom click logic for ad clicks. When set, this overrides the ad's default click through behavior of navigating to the click URL defined in the Ad Manager UI. |
This method is deprecated.
Use
forCustomFormatAd(String, NativeCustomFormatAd.OnCustomFormatAdLoadedListener,
NativeCustomFormatAd.OnCustomClickListener).
Enables the AdLoader to load custom format ads.
| templateId | Custom format ID defined in the Ad Manager UI. |
|---|---|
| adLoadedListener | A listener to be called when a NativeCustomTemplateAd loads. |
| customClickListener | An optional listener to define custom click logic for ad clicks. When set, this overrides the ad's default click through behavior of navigating to the click URL defined in the Ad Manager UI. |
This method is deprecated.
Use
forNativeAd(NativeAd.OnNativeAdLoadedListener).
Registers a listener to handle UnifiedNativeAd. The UnifiedNativeAd should be shown in UnifiedNativeAdView or NativeAdViewHolder.
| listener | An object that handles displaying native ads. |
|---|
| listener | An object that handles errors encountered when retrieving native ads. |
|---|
Sets options to use for loading a Google Ad Manager ad view.
| options | Google Ad Manager banner ad options. |
|---|
Sets the native ad options to the ad loader builder.
| options | An object that specifies various native ad options. |
|---|
This method is deprecated.
Use
withNativeAdOptions(NativeAdOptions).
| options | An object that specifies various native ad options. |
|---|