Package org.prebid.mobile
Class AdUnit
java.lang.Object
org.prebid.mobile.AdUnit
- Direct Known Subclasses:
BannerBaseAdUnit
,NativeAdUnit
,VideoBaseAdUnit
Base ad unit for the original API.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected boolean
protected Object
protected WeakReference<android.view.View>
protected boolean
protected BidLoader
protected BidResponse
protected AdUnitConfiguration
protected final VisibilityMonitor
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
activatePrebidImpressionTracker
(android.view.View adView) Applies the native visibility tracker for tracking `burl` url.protected ResultCode
convertToResultCode
(AdException renderingException) protected BidRequesterListener
createBidListener
(OnCompleteListener originalListener) void
destroy()
Destroy ad unit and stop downloading.void
fetchDemand
(Object adObject, OnCompleteListener listener) Loads ad and applies keywords to the ad object.void
fetchDemand
(OnFetchDemandResult listener) Loads ad and saves it to cache.AdUnitConfiguration
getGpid()
void
Resumes auto refresh interval after stopping.void
setAutoRefreshInterval
(int seconds) Auto refresh interval for banner ad.void
void
setImpOrtbConfig
(String ortbConfig) Sets imp level OpenRTB config JSON string that will be merged with the original imp object in the bid request.void
setPbAdSlot
(String pbAdSlot) void
Stops auto refresh interval.
-
Field Details
-
configuration
protected AdUnitConfiguration configuration -
bidLoader
protected BidLoader bidLoader -
adObject
-
bidResponse
protected BidResponse bidResponse -
visibilityMonitor
-
adViewReference
-
allowNullableAdObject
protected boolean allowNullableAdObject -
activateInterstitialPrebidImpressionTracker
protected boolean activateInterstitialPrebidImpressionTracker
-
-
Constructor Details
-
AdUnit
-
-
Method Details
-
setAutoRefreshInterval
public void setAutoRefreshInterval(int seconds) Auto refresh interval for banner ad. -
resumeAutoRefresh
public void resumeAutoRefresh()Resumes auto refresh interval after stopping. -
stopAutoRefresh
public void stopAutoRefresh()Stops auto refresh interval. -
destroy
public void destroy()Destroy ad unit and stop downloading. -
fetchDemand
Loads ad and applies keywords to the ad object.- Parameters:
adObject
- AdMob's (AdManagerAdRequest
orAdManagerAdRequest.Builder
) or AppLovin's (MaxNativeAdLoader
) ad objectlistener
- callback when operation is completed (success or fail)
-
fetchDemand
Loads ad and saves it to cache.- Parameters:
listener
- callback when operation is completed (success or fail)
-
activatePrebidImpressionTracker
public void activatePrebidImpressionTracker(android.view.View adView) Applies the native visibility tracker for tracking `burl` url.- Parameters:
adView
- the ad view object (f.e.AdManagerAdView
)
-
getPbAdSlot
-
setPbAdSlot
-
getGpid
-
setGpid
-
getImpOrtbConfig
-
setImpOrtbConfig
Sets imp level OpenRTB config JSON string that will be merged with the original imp object in the bid request. Expected format:"{"new_field": "value"}"
.- Parameters:
ortbConfig
- JSON config string.
-
createBidListener
-
convertToResultCode
-
getConfiguration
public AdUnitConfiguration getConfiguration()
-