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 Object
protected boolean
protected BidLoader
protected BidResponse
protected AdUnitConfiguration
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addContextData
(String key, String value) Deprecated.void
addContextKeyword
(String keyword) Deprecated.Use addExtKeywordvoid
addContextKeywords
(Set<String> keywords) Deprecated.Use addExtKeywordsvoid
addExtData
(String key, String value) This method obtains the context data keyword & value for adunit context targeting if the key already exists the value will be appended to the list.void
addExtKeyword
(String keyword) Deprecated.imp.ext.context.keywords doesn't existvoid
addExtKeywords
(Set<String> keywords) Deprecated.imp.ext.context.keywords doesn't existvoid
addUserData
(DataObject dataObject) void
Deprecated.void
Deprecated.Use clearExtKeywordsvoid
This method allows to remove all context data set from adunit context targetingvoid
This method allows to remove all keywords from the set of adunit context targetingvoid
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.void
fetchDemand
(OnCompleteListener2 listener) Deprecated.AdUnitConfiguration
getGpid()
void
removeContextData
(String key) Deprecated.void
removeContextKeyword
(String keyword) Deprecated.Use removeExtKeywordvoid
removeExtData
(String key) This method allows to remove specific context data keyword & values set from adunit context targetingvoid
removeExtKeyword
(String keyword) This method allows to remove specific context keyword from adunit context targetingvoid
Resumes auto refresh interval after stopping.void
setAppContent
(ContentObject content) This method obtains the content for adunit, content, in which impression will appearvoid
setAutoRefreshInterval
(int seconds) Auto refresh interval for banner ad.void
setAutoRefreshPeriodMillis
(int periodMillis) Deprecated.Please use setAutoRefreshInterval() in seconds!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
setOrtbConfig
(String config) Deprecated, for removal: This API element is subject to removal in a future version.void
setPbAdSlot
(String pbAdSlot) void
Stops auto refresh interval.void
updateContextData
(String key, Set<String> value) Deprecated.void
updateExtData
(String key, Set<String> value) This method obtains the context data keyword & values for adunit context targeting the values if the key already exist will be replaced with the new set of values
-
Field Details
-
configuration
protected AdUnitConfiguration configuration -
bidLoader
protected BidLoader bidLoader -
adObject
-
bidResponse
protected BidResponse bidResponse -
allowNullableAdObject
protected boolean allowNullableAdObject
-
-
Constructor Details
-
AdUnit
-
-
Method Details
-
setAutoRefreshPeriodMillis
Deprecated.Please use setAutoRefreshInterval() in seconds! -
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
Deprecated. -
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)
-
addContextData
Deprecated.This method obtains the context data keyword & value for adunit context targeting if the key already exists the value will be appended to the list. No duplicates will be added -
updateContextData
Deprecated.This method obtains the context data keyword & values for adunit context targeting the values if the key already exist will be replaced with the new set of values -
removeContextData
Deprecated.This method allows to remove specific context data keyword & values set from adunit context targeting -
clearContextData
Deprecated.This method allows to remove all context data set from adunit context targeting -
addExtData
This method obtains the context data keyword & value for adunit context targeting if the key already exists the value will be appended to the list. No duplicates will be added -
updateExtData
This method obtains the context data keyword & values for adunit context targeting the values if the key already exist will be replaced with the new set of values -
removeExtData
This method allows to remove specific context data keyword & values set from adunit context targeting -
clearExtData
public void clearExtData()This method allows to remove all context data set from adunit context targeting -
addContextKeyword
Deprecated.Use addExtKeywordThis method obtains the context keyword for adunit context targeting Inserts the given element in the set if it is not already present. -
addContextKeywords
Deprecated.Use addExtKeywordsThis method obtains the context keyword set for adunit context targeting Adds the elements of the given set to the set. -
removeContextKeyword
Deprecated.Use removeExtKeywordThis method allows to remove specific context keyword from adunit context targeting -
clearContextKeywords
Deprecated.Use clearExtKeywordsThis method allows to remove all keywords from the set of adunit context targeting -
addExtKeyword
Deprecated.imp.ext.context.keywords doesn't exist -
addExtKeywords
Deprecated.imp.ext.context.keywords doesn't exist -
removeExtKeyword
This method allows to remove specific context keyword from adunit context targeting -
clearExtKeywords
public void clearExtKeywords()This method allows to remove all keywords from the set of adunit context targeting -
setAppContent
This method obtains the content for adunit, content, in which impression will appear -
getAppContent
-
addUserData
-
getUserData
-
clearUserData
public void clearUserData() -
getPbAdSlot
-
setPbAdSlot
-
getGpid
-
setGpid
-
setOrtbConfig
Deprecated, for removal: This API element is subject to removal in a future version. -
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()
-