Class AdUnit

java.lang.Object
org.prebid.mobile.AdUnit
Direct Known Subclasses:
BannerBaseAdUnit, NativeAdUnit, VideoBaseAdUnit

public abstract class AdUnit extends Object
Base ad unit for the original API.
  • Field Details

    • configuration

      protected AdUnitConfiguration configuration
    • bidLoader

      protected BidLoader bidLoader
    • adObject

      protected Object adObject
    • bidResponse

      protected BidResponse bidResponse
    • allowNullableAdObject

      protected boolean allowNullableAdObject
  • Constructor Details

    • AdUnit

      public AdUnit(String configId)
  • Method Details

    • setAutoRefreshPeriodMillis

      @Deprecated public void setAutoRefreshPeriodMillis(int periodMillis)
      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 public void fetchDemand(OnCompleteListener2 listener)
      Deprecated.
    • fetchDemand

      public void fetchDemand(Object adObject, OnCompleteListener listener)
      Loads ad and applies keywords to the ad object.
      Parameters:
      adObject - AdMob's (AdManagerAdRequest or AdManagerAdRequest.Builder) or AppLovin's (MaxNativeAdLoader) ad object
      listener - callback when operation is completed (success or fail)
    • fetchDemand

      public void fetchDemand(OnFetchDemandResult listener)
      Loads ad and saves it to cache.
      Parameters:
      listener - callback when operation is completed (success or fail)
    • addContextData

      @Deprecated public void addContextData(String key, String value)
      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 public void updateContextData(String key, Set<String> value)
      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 public void removeContextData(String key)
      Deprecated.
      This method allows to remove specific context data keyword & values set from adunit context targeting
    • clearContextData

      @Deprecated public void clearContextData()
      Deprecated.
      This method allows to remove all context data set from adunit context targeting
    • addExtData

      public void 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. No duplicates will be added
    • updateExtData

      public 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
    • removeExtData

      public void removeExtData(String key)
      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 public void addContextKeyword(String keyword)
      Deprecated.
      Use addExtKeyword
      This method obtains the context keyword for adunit context targeting Inserts the given element in the set if it is not already present.
    • addContextKeywords

      @Deprecated public void addContextKeywords(Set<String> keywords)
      Deprecated.
      Use addExtKeywords
      This method obtains the context keyword set for adunit context targeting Adds the elements of the given set to the set.
    • removeContextKeyword

      @Deprecated public void removeContextKeyword(String keyword)
      Deprecated.
      Use removeExtKeyword
      This method allows to remove specific context keyword from adunit context targeting
    • clearContextKeywords

      @Deprecated public void clearContextKeywords()
      Deprecated.
      Use clearExtKeywords
      This method allows to remove all keywords from the set of adunit context targeting
    • addExtKeyword

      public void addExtKeyword(String keyword)
      This method obtains the context keyword for adunit context targeting Inserts the given element in the set if it is not already present.
    • addExtKeywords

      public void addExtKeywords(Set<String> keywords)
      This method obtains the context keyword set for adunit context targeting Adds the elements of the given set to the set.
    • removeExtKeyword

      public void removeExtKeyword(String keyword)
      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

      public void setAppContent(ContentObject content)
      This method obtains the content for adunit, content, in which impression will appear
    • getAppContent

      public ContentObject getAppContent()
    • addUserData

      public void addUserData(DataObject dataObject)
    • getUserData

      public ArrayList<DataObject> getUserData()
    • clearUserData

      public void clearUserData()
    • getPbAdSlot

      public String getPbAdSlot()
    • setPbAdSlot

      public void setPbAdSlot(String pbAdSlot)
    • getGpid

      public String getGpid()
    • setGpid

      public void setGpid(String gpid)
    • getOrtbConfig

      public String getOrtbConfig()
    • setOrtbConfig

      public void setOrtbConfig(String ortbConfig)
    • createBidListener

      protected BidRequesterListener createBidListener(OnCompleteListener originalListener)
    • convertToResultCode

      protected ResultCode convertToResultCode(AdException renderingException)
    • getConfiguration

      public AdUnitConfiguration getConfiguration()