-
public abstract class AdUnitBase ad unit for the original API.
-
-
Field Summary
Fields Modifier and Type Field Description protected AdUnitConfigurationconfiguration
-
Method Summary
Modifier and Type Method Description AdUnitConfigurationgetConfiguration()voidsetAutoRefreshInterval(@IntRange(from = AUTO_REFRESH_DELAY_MIN / 1000, to = AUTO_REFRESH_DELAY_MAX / 1000) int seconds)Auto refresh interval for banner ad. voidresumeAutoRefresh()Resumes auto refresh interval after stopping. voidstopAutoRefresh()Stops auto refresh interval. voiddestroy()Destroy ad unit and stop downloading. voidfetchDemand(Object adObject, @NonNull() OnCompleteListener listener)Loads ad and applies keywords to the ad object. voidfetchDemand(OnFetchDemandResult listener)Loads ad and saves it to cache. voidactivatePrebidImpressionTracker(View adView)Applies the native visibility tracker for tracking `burl` url. StringgetPbAdSlot()voidsetPbAdSlot(String pbAdSlot)StringgetGpid()voidsetGpid(@Nullable() String gpid)StringgetImpOrtbConfig()voidsetImpOrtbConfig(@Nullable() String ortbConfig)Sets imp level OpenRTB config JSON string that will be merged with the original imp object in the bid request. StringgetGlobalOrtbConfig()voidsetGlobalOrtbConfig(@Nullable() String ortbConfig)Sets the global OpenRTB configuration string for the ad unit. -
-
Constructor Detail
-
AdUnit
AdUnit(String configId)
-
-
Method Detail
-
getConfiguration
@VisibleForTesting() AdUnitConfiguration getConfiguration()
-
setAutoRefreshInterval
void setAutoRefreshInterval(@IntRange(from = AUTO_REFRESH_DELAY_MIN / 1000, to = AUTO_REFRESH_DELAY_MAX / 1000) int seconds)
Auto refresh interval for banner ad.
-
resumeAutoRefresh
void resumeAutoRefresh()
Resumes auto refresh interval after stopping.
-
stopAutoRefresh
void stopAutoRefresh()
Stops auto refresh interval.
-
destroy
void destroy()
Destroy ad unit and stop downloading.
-
fetchDemand
void fetchDemand(Object adObject, @NonNull() OnCompleteListener listener)
Loads ad and applies keywords to the ad object.
- Parameters:
adObject- AdMob's ({@code AdManagerAdRequest}or{@code AdManagerAdRequest.Builder})or AppLovin's ({@code MaxNativeAdLoader}) ad objectlistener- callback when operation is completed (success or fail)
-
fetchDemand
void fetchDemand(OnFetchDemandResult listener)
Loads ad and saves it to cache.
- Parameters:
listener- callback when operation is completed (success or fail)
-
activatePrebidImpressionTracker
void activatePrebidImpressionTracker(View adView)
Applies the native visibility tracker for tracking `burl` url.
- Parameters:
adView- the ad view object (f.e.
-
getPbAdSlot
String getPbAdSlot()
-
setPbAdSlot
void setPbAdSlot(String pbAdSlot)
-
getImpOrtbConfig
@Nullable() String getImpOrtbConfig()
-
setImpOrtbConfig
void setImpOrtbConfig(@Nullable() String ortbConfig)
Sets imp level OpenRTB config JSON string that will be merged with the original imp object in the bid request.Expected format:
{@code "{"new_field": "value"}"}.- Parameters:
ortbConfig- JSON config string.
-
getGlobalOrtbConfig
@Nullable() String getGlobalOrtbConfig()
-
setGlobalOrtbConfig
void setGlobalOrtbConfig(@Nullable() String ortbConfig)
Sets the global OpenRTB configuration string for the ad unit. It takes precedence over `TargetingParams.setGlobalOrtbConfig`.Expected format:
{@code "{"new_field": "value"}"}.- Parameters:
ortbConfig- The global OpenRTB JSON configuration string to set.
-
-
-
-