Class PrebidNativeAd


  • public class PrebidNativeAd
    extends java.lang.Object
    • Method Detail

      • create

        public static PrebidNativeAd create​(java.lang.String cacheId)
      • addTitle

        public void addTitle​(NativeTitle title)
      • addData

        public void addData​(NativeData data)
      • addImage

        public void addImage​(NativeImage image)
      • getTitles

        public java.util.ArrayList<NativeTitle> getTitles()
      • getImages

        public java.util.ArrayList<NativeImage> getImages()
      • getDataList

        public java.util.ArrayList<NativeData> getDataList()
      • getTitle

        public java.lang.String getTitle()
        Returns:
        First title or empty string if it doesn't exist
      • getDescription

        public java.lang.String getDescription()
        Returns:
        First description data value or empty string if it doesn't exist
      • getIconUrl

        public java.lang.String getIconUrl()
        Returns:
        First icon url or empty string if it doesn't exist
      • getImageUrl

        public java.lang.String getImageUrl()
        Returns:
        First main image url or empty string if it doesn't exist
      • getCallToAction

        public java.lang.String getCallToAction()
        Returns:
        First call to action data value or empty string if it doesn't exist
      • getSponsoredBy

        public java.lang.String getSponsoredBy()
        Returns:
        First sponsored by data value or empty string if it doesn't exist
      • registerView

        public boolean registerView​(android.view.View container,
                                    java.util.List<android.view.View> clickableViews,
                                    PrebidNativeAdEventListener listener)
        This API is used to register the view for Ad Events (#onAdClicked(), #onAdImpression, #onAdExpired).
        Parameters:
        container - the native ad container used to track impression
        clickableViews - list of views that should handle click
        listener - must not contain any references to View, Activity, because it can be in memory for a long time. Should be class implementation and not anonymous object. If it is anonymous class it can produce memory leak.
        Returns:
        true if views registered successfully
      • registerPrebidNativeAdEventListener

        protected boolean registerPrebidNativeAdEventListener​(PrebidNativeAdEventListener listener)
      • getWinEvent

        public java.lang.String getWinEvent()
      • getImpEvent

        public java.lang.String getImpEvent()