Native ad assets

Warning.

This is an archived version of the documentation. Actual documentation for all platforms can be found here.

Note.

Read the advertising requirements.

  1. Asset list
  2. Asset layout

Asset list

The library includes both the required and optional assets. According to the advertising rules, it's enough that you render only the required assets. In practice, layouts that use a complete set of assets are more clickable. That's why we recommend that you use the design based on a complete set of supported assets.

Ad element Asset Type Required

Title

title

TextView

Yes

Domain

domain

TextView

Yes

Disclamer

warning

TextView

Yes

The “Ad” label and the age restriction label

sponsored

TextView

Yes

Menu icon

feedback

ImageView

Yes

Action button

callToAction

TextView

Yes

Media

media

MediaView

Yes

App icon

icon

ImageView

Yes, for Ads for Mobile Apps

Price

price

TextView

Yes, for Ads for Mobile Apps

Favicon

favicon

ImageView

No

Review count

reviewCount

TextView

No

Rating

rating

View implements Rating interface

No

Text

body

TextView

No
Ad element Asset Type Required

Title

title

TextView

Yes

Domain

domain

TextView

Yes

Disclamer

warning

TextView

Yes

The “Ad” label and the age restriction label

sponsored

TextView

Yes

Menu icon

feedback

ImageView

Yes

Action button

callToAction

TextView

Yes

Media

media

MediaView

Yes

App icon

icon

ImageView

Yes, for Ads for Mobile Apps

Price

price

TextView

Yes, for Ads for Mobile Apps

Favicon

favicon

ImageView

No

Review count

reviewCount

TextView

No

Rating

rating

View implements Rating interface

No

Text

body

TextView

No

The list of required assets defines the set of data for which, if those assets are present, a View must be provided for rendering.

Tip.

We recommend that you use a layout that can render a complete set of both required and optional ad assets.

Asset layout

  1. feedback

feedback

Menu icon. Required asset. The user can click the menu icon to hide or report an ad.

The menu icon is added to the upper-right corner of the ad.

Note.

The developer must define what to do with the ad after the reason for closing it is chosen (for example, hide the ad or show a text). If there is no further action defined, the SDK will register the reason for closing, but the ad will not be hidden.

Layout options:

feedback_dark_dots_with_background

White menu icon, with dark dots and a translucent background. Default value.

feedback_light_dots

Menu icon without a background, with light dots.

Code example:
final NativeAdLoader loader = new NativeAdLoader(this);
final HashMap<String, String> parameters = new HashMap<String, String>(){{
	put("feedback_image", "feedback_light_dots");
}};
final NativeAdRequestConfiguration nativeAdRequestConfiguration =
	new NativeAdRequestConfiguration.Builder("demo-native-app-yandex")
		.setParameters(parameters)
mNativeAdLoader.loadAd(nativeAdRequestConfiguration);
feedback_dark_dots

Menu icon without a background, with dark dots.

Code example:
final NativeAdLoader loader = new NativeAdLoader(this);
final HashMap<String, String> parameters = new HashMap<String, String>(){{
	put("feedback_image", "feedback_dark_dots");
}};
final NativeAdRequestConfiguration nativeAdRequestConfiguration =
	new NativeAdRequestConfiguration.Builder("demo-native-app-yandex")
		.setParameters(parameters)
mNativeAdLoader.loadAd(nativeAdRequestConfiguration);