Interface NativeAdUnit

com.yandex.mobile.ads.nativeads

public interface NativeAdUnit

The interface binds the content of native ads to an object of the NativeAdUnitView class.

Methods

void bindAdUnit(@Nullable final NativeAdUnitView adUnitView)

Binds the content of native ads to an object of the NativeAdUnit class.

List<?extends NativeGenericAd > getNativeAds()

Ads to be displayed in a native ad block.

String getSponsored()

Returns information about the advertiser.

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

bindAdUnit

public void bindAdUnit (@Nullable final NativeAdUnitView adUnitView)

Binds the content of native ads to an object of the NativeAdUnit class.

Parameters:
adUnitView

An object of the NativeAdUnitView class. The root view of a native ad block and superview for each view's asset.

Throws:

NativeAdException

Missing view for a required asset.

getNativeAds

public List<?extends NativeGenericAd > getNativeAds ()

Ads to be displayed in a native ad block.

Each ad should be like view for the view of a native ad block.

Returns:

A list of ads in the block.

getSponsored

public String getSponsored ()

Returns information about the advertiser.

Returns:

Information about the advertiser.

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.