Interface NativeAdData

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      abstract Unit attachToLayout(ViewGroup layout, View mainImageView, View iconView, View ctaView) Binds the native ad instance with given ViewGroup.
      abstract Unit detachFromLayout() Removes the binding between native ad and ViewGroup.
      abstract String getTitle() Returns the title of native ad.
      abstract String getDescription() Returns the description of native ad.
      abstract String getCallToAction() Returns the call to action of native ad.
      abstract String getImageUrl() Returns the URL of the image asset of native ad.
      abstract String getIconUrl() Returns the URL of the icon asset of native ad.
      abstract NativeAd.NativeAdRating getRating() Returns the rating asset of native ad.
      abstract View getBrandingLogo() Returns the view with branding logo or ad information related to the ad network providing the native ad.
      abstract String getAdvertiser() Returns the advertiser asset of native ad (not the same as ad network providing it).
      abstract AdNetwork getNetwork() Returns the ad network providing given native ad
      abstract AdInfo getAdInfo() Returns additional information like price and currency of the ad.
      abstract Boolean isExpired() Returns if the native ad has expired and shall no longer be used.
      abstract Boolean isReady() Returns if the native ad is ready to be displayed.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • attachToLayout

         abstract Unit attachToLayout(ViewGroup layout, View mainImageView, View iconView, View ctaView)

        Binds the native ad instance with given ViewGroup. Needed for click handling and tracking.

        Parameters:
        layout - ViewGroup used to render the native ad.
        mainImageView - View used to show the main image of the ad.
        iconView - View used to show the icon of the native ad.
        ctaView - View used to show the Call To Action of the native ad.
      • detachFromLayout

         abstract Unit detachFromLayout()

        Removes the binding between native ad and ViewGroup. Should be called when the native ad will no longer be presented and should be destroyed.

      • getTitle

         abstract String getTitle()

        Returns the title of native ad.

        Returns:

        String with title asset of the ad, or null if it is not available.

      • getDescription

         abstract String getDescription()

        Returns the description of native ad.

        Returns:

        String with description asset of the ad, or null if it is not available.

      • getCallToAction

         abstract String getCallToAction()

        Returns the call to action of native ad.

        Returns:

        String with call to action asset of the ad, or null if it is not available.

      • getImageUrl

         abstract String getImageUrl()

        Returns the URL of the image asset of native ad.

        Returns:

        String with URL of the image asset of the ad, or null if it is not available.

      • getIconUrl

         abstract String getIconUrl()

        Returns the URL of the icon asset of native ad.

        Returns:

        String with URL of the icon asset of the ad, or null if it is not available.

      • getRating

         abstract NativeAd.NativeAdRating getRating()

        Returns the rating asset of native ad.

        Returns:

        NativeAdRating instance containing both value and scale of rating, or null if it is not available.

      • getBrandingLogo

         abstract View getBrandingLogo()

        Returns the view with branding logo or ad information related to the ad network providing the native ad. Some networks like Facebook Audience Network require this special view to be visible on native ads.

        Returns:

        View that should be added to native ad layout, or null if it is not available.

      • getAdvertiser

         abstract String getAdvertiser()

        Returns the advertiser asset of native ad (not the same as ad network providing it).

        Returns:

        String with advertiser asset of the ad, or null if it is not available.

      • getNetwork

         abstract AdNetwork getNetwork()

        Returns the ad network providing given native ad

        Returns:

        Enum value representing the ad network providing the ad.

      • getAdInfo

         abstract AdInfo getAdInfo()

        Returns additional information like price and currency of the ad.

      • isExpired

         abstract Boolean isExpired()

        Returns if the native ad has expired and shall no longer be used.

        Returns:

        True if native ad has expired, false otherwise.

      • isReady

         abstract Boolean isReady()

        Returns if the native ad is ready to be displayed.

        Returns:

        True if native ad is ready, false otherwise.