Interface NativeGenericAd

com.yandex.mobile.ads.nativeads

public interface NativeGenericAd

All Known Subinterfaces:
NativeAppInstallAd, NativeContentAd, NativeImageAd

Defines the interface for interacting with the native ad object.

Methods

void addImageLoadingListener(final NativeAdImageLoadingListener listener)

Adds an object of the NativeAdImageLoadingListener class.

void bindNativeAd(final NativeAdViewBinder viewBinder)

Binds the View of a native ad to the content of this ad.

NativeAdAssets getAdAssets()

Returns the ad assets.

NativeAdType getAdType()

Returns the type of a native ad.

String getInfo()

Returns an arbitrary string in the ad (set in the Partner interface).

void loadImages()

Loads images if manual loading is selected.

void removeImageLoadingListener(final NativeAdImageLoadingListener listener)

Deletes the object of the NativeAdImageLoadingListener class to stop receiving notifications about the image loading process.

void setAdEventListener(final NativeAdEventListener eventListener)

Sets an object of the NativeAdEventListener class.

void shouldOpenLinksInApp(final boolean shouldOpenLinksInApp)

Determines how to open links from the app.

Method Detail

addImageLoadingListener

public void addImageLoadingListener (final NativeAdImageLoadingListener listener)

Adds an object of the NativeAdImageLoadingListener class.

Parameters:
listener

An object of the NativeAdImageLoadingListener class, which will receive notifications about the image loading process.

bindNativeAd

public void bindNativeAd (final NativeAdViewBinder viewBinder)

Binds the View of a native ad to the content of this ad.

Parameters:
viewBinder

An object of the NativeAdViewBinder class.

Throws:

NativeAdException

Missing view for a required asset, or no view for a required asset.

getAdAssets

public NativeAdAssets getAdAssets ()

Returns the ad assets.

Returns:

Assets.

getAdType

public NativeAdType getAdType ()

Returns the type of a native ad.

Returns:

Type of native ad.

getInfo

public String getInfo ()

Returns an arbitrary string in the ad (set in the Partner interface).

Note.

The method is only used for working with ADFOX.

Returns:

null or any string.

loadImages

public void loadImages ()

Loads images if manual loading is selected.

Each loaded image gets the appropriate imageView. Images are not stored in memory and must be loaded each time the view is bound to the assets.
Note.

You can set how to load images in NativeAdLoaderConfiguration.

removeImageLoadingListener

public void removeImageLoadingListener (final NativeAdImageLoadingListener listener)

Deletes the object of the NativeAdImageLoadingListener class to stop receiving notifications about the image loading process.

Parameters:
listener

An object of the NativeAdImageLoadingListener class.

setAdEventListener

public void setAdEventListener (final NativeAdEventListener eventListener)

Sets an object of the NativeAdEventListener class.

Parameters:
eventListener

An object of the NativeAdEventListener class.

shouldOpenLinksInApp

public void shouldOpenLinksInApp (final boolean shouldOpenLinksInApp)

Determines how to open links from the app.

Parameters:
shouldOpenLinksInApp
How to open links from the app. Acceptable values:
  • true — Open links in the app browser.

  • false — Open links in the device browser.

The default value is false.