Native ad assets
This is an archived version of the documentation. Actual documentation for all platforms can be found here.
Read the advertising requirements.
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 | titleLabel | UILabel | Yes |
Domain | domainLabel | UILabel | Yes |
Disclamer | warningLabel | UILabel | Yes |
The “Ad” label and the age restriction label | sponsoredLabel | UILabel | Yes |
Menu icon | feedbackButton | UIButton | Yes |
Action button | callToActionButton | UIButton | Yes |
Media | mediaView | YMANativeMediaView | Yes |
App icon | iconImageView | UIImageView | Yes, for Ads for Mobile Apps |
Price | priceLabel | UILabel | Yes, for Ads for Mobile Apps |
Favicon | faviconImageView | UIImageView | No |
Review count | reviewCountLabel | UILabel | No |
Rating | ratingView | UIView<YMARating> | No |
Text | bodyLabel | UILabel | No |
Ad element | Asset | Type | Required |
---|---|---|---|
Title | titleLabel | UILabel | Yes |
Domain | domainLabel | UILabel | Yes |
Disclamer | warningLabel | UILabel | Yes |
The “Ad” label and the age restriction label | sponsoredLabel | UILabel | Yes |
Menu icon | feedbackButton | UIButton | Yes |
Action button | callToActionButton | UIButton | Yes |
Media | mediaView | YMANativeMediaView | Yes |
App icon | iconImageView | UIImageView | Yes, for Ads for Mobile Apps |
Price | priceLabel | UILabel | Yes, for Ads for Mobile Apps |
Favicon | faviconImageView | UIImageView | No |
Review count | reviewCountLabel | UILabel | No |
Rating | ratingView | UIView<YMARating> | No |
Text | bodyLabel | UILabel | 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.
We recommend that you use a layout that can render a complete set of both required and optional ad assets.
Asset layout
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.
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:
White menu icon, with dark dots and a translucent background. Default value.
Menu icon without a background, with light dots.
YMANativeAdLoader *adLoader = [[YMANativeAdLoader alloc] init];
YMAMutableNativeAdRequestConfiguration *requestConfiguration =
[[YMAMutableNativeAdRequestConfiguration alloc] initWithAdUnitID:@"demo-native-content-yandex"];
requestConfiguration.parameters = @{ @"feedback_image": "feedback_light_dots" };
[self.adLoader loadAdWithRequestConfiguration:requestConfiguration];
Menu icon without a background, with dark dots.
YMANativeAdLoader *adLoader = [[YMANativeAdLoader alloc] init];
YMAMutableNativeAdRequestConfiguration *requestConfiguration =
[[YMAMutableNativeAdRequestConfiguration alloc] initWithAdUnitID:@"demo-native-content-yandex"];
requestConfiguration.parameters = @{ @"feedback_image": "feedback_dark_dots" };
[self.adLoader loadAdWithRequestConfiguration:requestConfiguration];
media
Subview
for media content (image or video).
How media content is displayed in mediaView: if the response to the ad request contains media content, mediaView displays it after buffering.
- To check for the presence of media content, use the media property of the YMANativeAdAssets object. If the response contains media content, the property returns a nonzero YMANativeAdMedia object.
- To check for the presence of an image, use the image property of the YMANativeAdAssets object. If the response to the ad request contains an image, the property returns a nonzero YMANativeAdImage object.