Native ad is a flexible type of advertising. You can adapt the display to your UI by preparing a template.
1. Basic integration
Native AdQueue is the new native ad implementation and management tool in the Appodeal SDK. You no longer need to load Native Ads up manually. All you have to do is to set the AdQueue object, and it will load new items automatically.
Be careful using AdQueue: if your app loads too many ads but is not able to use it, the ad network can either lower the cost of each impression for you or limit your ability to load native ads.
Native ads requirements
- All of the fields of native ad marked as mandatory must be displayed.
- Every ad should have a sign that clearly indicates that it is an ad. For example "Ad" or "Sposored".
- Provided images can be resized to fit your ad space but should not be significantly distorted or cropped.
2. Configure settings for native ads
adQueue.settings you can set the following parameters for the native ads of your app:
adQueue.settings setting name
Native Ad Type
Default template: APDDefaultNativeAdView.class
Mask for caching media files
Icons caching: (APDNativeResourceAutocacheIcon): 1
Image and Video caching (APDNativeResourceAutocacheMedia): 2
Cache all media files: 3
3. Initialize a specific type of native ads
The Appodeal SDK provides both static and video types of native ads.
To implement static native ads into your app, use the following code:
There are two types of native video ads in the Appodeal SDK:
- skippable - if “skippable” flag is stated, then the video can be skipped after 5 seconds from the start;
- muted - if “muted” flag is stated, then the video will be played with no sound.
4. Cache native ads
Native ads will start download when native ad queue instance is created. You don't need to control loading lifecycle. But if you bring some ad from ad queue you need to have strong reference on it during whole native ads presentation time. Native ad doesn't have strong reference on view and view doesn't have strong reference on native ad. If application lost reference on native ad after presenting on screen native ad won't tracks any events.
5. Use native ads callbacks
The callbacks are used to track different events in the lifecycle of an ad, e.g., when an ad was clicked on or closed. To get them, you need to set the delegate as follows:
APDNativeAdPresentationDelegate to the header file:
6. Use custom templates for native ads
To use your custom templates for native ads, simply state your templates class in
adQueue.setting.adViewClass, as follows:
titleLabel- container for title text;
callToActionLabel- container for call-to-action text;
descriptionLabel- container for description text;
iconView- container for icon image;
mediaContainerView- container for media files (images and video files);
contentRatingLabel- container for showing rating of the content;
adChoicesView- container for showing adChoice;
rating- container for showing rating of the app;
nib- nib-file for template.
UICollectionViewCell), these views should be contained in the hierarchy of
7. Get all native ads from Native AdQueue
8. Native Ad object
The NativeAd object has the following characteristics in the Appodeal SDK. All of the fields, marked as “Mandatory”, must be displayed:
|Name of field||Required?||Description|
|NSString *title;||Mandatory||The title of the native ad. Minimum 25 symbols of the title should always be displayed. You can add ellipsis at the end if the title is longer.|
|NSString *subtitle||Optional||The subtitle of the native ad.|
|NSString *descriptionText||Optional||The text description of the native ad. If you choose to display the description, you should display minimum 75 characters. You can add ellipsis at the end.|
|NSString *callToActionText||Mandatory||The call to action text. Should be displayed without truncation on a visible button.|
|NSString *contentRating||Optional||Rating of the content.|
|NSNumber *starRating||Optional||Rating of the app in [0-5] range.|
|APDImage *mainImage||Optional||Bitmap of an image. An ad object contains both icon and image. It’s mandatory to use at least one of these elements. Deprecated method. |
|APDImage *iconImage||Mandatory||Bitmap of an icon. An ad object contains both icon and image. It’s mandatory to use at least one of these elements.|
|UIView *adChoicesView||Mandatory||View. If it doesn’t return |
9. Common mistakes with native ads
- No ad attribution or AdChoices icon
The majority of ad networks require from publishers to add a special mark to a native ad, so users don’t mistake them for content. That’s why you always need to make sure, that native ads in your app have the ad attribution (e.g., “Ad”) or the AdChoices icon.
- Absence of the required native ad elements
Every native ad should contain:
- call-to-action button;
- ad attribution or AdChoices icon;
icon, image or video.
- Native ad elements alteration
Advertisers expect that their ads will be displayed clearly and without any alteration. You can scale buttons and images, but you shouldn't crop, cover or distort them.
- Overlaying elements of native ads on each other
Make sure, that all elements of a native ad are visible and not overlaid.
10. Get Predicted eCPM
This method return expected eCPM for cached ad. Amount is calculated based on historical data for the current ad unit.
11. Check if Native was initialized
true, if Native was initialized.