Native ad is a flexible type of advertising. You can adapt the display for your UI by preparing a template.
1. Basic Integration
Native AdQueue is the new native ad implementation and management tool in Appodeal SDK. You no longer need to load Native Ads manually. All you have to do is to set the AdQueue object, and it will load new items automatically.
Be careful when using AdQueue: if your app loads too many ads, but is not able to use them, 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 native ad fields marked as mandatory must be displayed.
- Every ad should have a sign that clearly indicates that it is an ad. For example "Ad" or "Sponsored".
- Provided images can be resized to fit your ad space but should not be significantly distorted or cropped.
2. Configuring Native Ad Settings
adQueue.settings you can set the following parameters for the native ads displayed in your app:
adQueue.settings setting name
Native Ad Type
Default template: APDDefaultNativeAdView.class
Mask for caching media files
Icon caching: (APDNativeResourceAutocacheIcon): 1
Image and Video caching (APDNativeResourceAutocacheMedia): 2
Caching all media files: 3
3. Initializing a Specific Native Ad Type
Appodeal SDK provides both static and video types of native ads.
To implement static native ads in your app, use the following code:
There are two types of native video ads in Appodeal SDK:
- skippable - if “skippable” flag is stated, the video can be skipped after 5 seconds;
- muted - if “muted” flag is stated, the video will be played with no sound.
4. Caching Native Ads
Native ads will start downloading when a native ad queue instance is created. You don't need to control the loading lifecycle. But if you bring some ad from ad queue, you need to have strong reference to it during the whole native ad presentation time. Native ad doesn't have a strong reference to view and view doesn't have a strong reference on the native ad. If application loses reference to the native ad after the impression, the native ad won't be tracking any events.
5. Using Native Ads Callbacks
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. Using Custom Native Ad Templates
To use your custom templates for native ads, simply state your template 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. Getting All Native Ads from Native AdQueue
8. Native Ad Object
NativeAd objects have the following characteristics in Appodeal SDK. All of the fields marked as “Mandatory” must be displayed:
|Name of field||Required?||Description|
|NSString *title;||Mandatory||Native ad title. At least 25 characters of the title should always be displayed. You can add ellipsis at the end if the title is longer.|
|NSString *subtitle||Optional||Native ad subtitle.|
|NSString *descriptionText||Optional||Text description of the native ad. If you choose to display the description, you should display ate least 75 characters. You can add ellipsis at the end.|
|NSString *callToActionText||Mandatory||The call to action text. Should be displayed on a visible button without truncation.|
|NSString *contentRating||Optional||Rating of the content.|
|NSNumber *starRating||Optional||App in the [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 publishers to add a special mark to native ads, 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 must 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.
- Overlapping native ad elements
Make sure that all native ad elements are visible and do not overlap.
10. Getting Predicted eCPM
This method returns the expected eCPM for the cached ad. The amount is calculated based on historical data for the current ad unit.
11. Checking if Native Ad Has Been Initialized
true, if the Native has been initialized.