public class NativeAd

  1. Object
  2. NativeAd

The assets of a native ad, loaded by NativeAdLoader. A native ad lets you render the advertiser’s content with your own components so it blends with the surrounding UI. Not every field is populated for every ad; check for null before use.

Native ad support is an optional provider capability. When the active provider does not support it, NativeAdLoader reports the format as unsupported.

Constructors

public NativeAd(String headline, String body, String callToAction, String advertiser, String iconUrl, String imageUrl, double starRating)Creates a native ad asset bundle.

Methods

public String getHeadline()The ad headline, may be null.
public String getBody()The ad body text, may be null.
public String getCallToAction()The call to action label (e.g. “Install”), may be null.
public String getAdvertiser()The advertiser name, may be null.
public String getIconUrl()The URL of the ad icon, may be null.
public String getImageUrl()The URL of the main ad image, may be null.
public double getStarRating()The star rating (0-5), or 0 when not provided.

Inherited methods

Constructor details

NativeAd

public NativeAd(String headline, String body, String callToAction, String advertiser, String iconUrl, String imageUrl, double starRating)
Creates a native ad asset bundle. Intended for providers; applications receive instances through NativeAdLoader.

Method details

getHeadline

public String getHeadline()
The ad headline, may be null.

getBody

public String getBody()
The ad body text, may be null.

getCallToAction

public String getCallToAction()
The call to action label (e.g. “Install”), may be null.

getAdvertiser

public String getAdvertiser()
The advertiser name, may be null.

getIconUrl

public String getIconUrl()
The URL of the ad icon, may be null.

getImageUrl

public String getImageUrl()
The URL of the main ad image, may be null.

getStarRating

public double getStarRating()
The star rating (0-5), or 0 when not provided.