Native Ad
Integrate native ads
Usage
First import RNAatkit and another native ads components (some of them might not be needed, depending on networks providing ads to your app)
import {
RNAatkit,
RNAatkitUnifiedNativeAd,
GenericNativeAdView,
TitleView,
DescriptionView,
ImageView,
IconView,
CallToActionView,
GoogleUnifiedNativeAdView,
GoogleImageView
} from '@addapptr/react-native-aatkit'
import {
FacebookImageView,
FacebookIconView,
FacebookNativeAdView
} from '@addapptr/react-native-aatkit-facebook-ads';
import {
HuaweiImageView,
HuaweiUnifiedNativeAdView
}
from '@addapptr/react-native-aatkit-huawei';Add RNAatkitUnifiedNativeAd as root component of native ad. Set placement name using name property. AATKit will automatically create new placement when RNAatkitUnifiedNativeAd is created. Depending on networks providing native ads to your app, put GenericNativeAdView, GoogleUnifiedNativeAdView and/or FacebookNativeAdView components under RNAatkitUnifiedNativeAd. These components should be parents of native ads layouts.
Google native ads
Prepare layout for native ads provided by Google network. Use TitleView, DescriptionView, GoogleImageView, IconView, CallToActionView and every UI components you like. All these elements should be children of GoogleUnifiedNativeAdView, example:
Facebook native ads
Prepare layout for native ads provided by Facebook network. Use TitleView, DescriptionView, FacebookImageView, FacebookIconView, CallToActionView and every UI components you like. All these elements should be children of FacebookNativeAdView, example:
Huawei native ads
Prepare layout for native ads provided by Huawei network. Use TitleView, DescriptionView, HuaweiImageView, IconView, CallToActionView and every UI components you like. All these elements should be children of HuaweiUnifiedNativeAdView, example:
Generic native ads
Prepare layout for native ads provided by other networks. Use TitleView, DescriptionView, ImageView, IconView, CallToActionView and every UI components you like. All these elements should be children of GenericNativeAdView, example:
Special requirements
When preparing layouts, please keep in mind some ad networks have special requirements on how they should look. If your app gets native ads from Google, Facebook and other networks, finally you might end up with RNAatkitUnifiedNativeAd containing child elements like:
Load native ad
Native ads can't be auto-loaded, so you need to manage loading using reloadPlacement function.
Also you can set reloadOnStart to let AATKit load native ad once it's created and attached to the UI:
Show native ad
When native ad is loaded, you can use showUnifiedNativeAdPlacement function to load and present data of the native ad. RNAatkitUnifiedNativeAd will automatically decide which layout should be visible, depending on the network providing native ad.
Show test data
You can show test for specific layout without loading native ad from the server. To achieve this, set showTestDataForLayout attribute.
Set custom test data
If you are setting showTestDataForLayout attribute, default test data are presented. However, you can set your own test data of the native ad by testData attribute.
API
For more details about properties of native ad component, please see this page in the Reference.
Last updated