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.
<RNAatkitUnifiedNativeAd name="unifiedNativeAd" style={styles.nativeAd}>
<GoogleUnifiedNativeAdView style={styles.nativeAd}>
//Layout for native ads provided by Google network.
</GoogleUnifiedNativeAdView>
<FacebookNativeAdView style={styles.nativeAd}>
//Layout for native ads provided by Facebook network.
</FacebookNativeAdView>
<BlueStackNativeAdView style={styles.nativeAd}>
//Layout for native ads provided by BlueStack network.
</BlueStackNativeAdView>
<GenericNativeAdView style={styles.nativeAd}>
//Layout for native ads provided by other networks.
</GenericNativeAdView>
</RNAatkitUnifiedNativeAd>
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:
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:
Prepare layout for native ads provided by BlueStack network. Use TitleView, DescriptionView, BlueStackImageView, IconView, CallToActionView and every UI components you like. All these elements should be children of BlueStackNativeAdView, example:
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:
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:
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.
You can show test for specific layout without loading native ad from the server. To achieve this, set showTestDataForLayout attribute.
<RNAatkitUnifiedNativeAd name="unifiedNativeAd" showTestDataForLayout={RNAatkitUnifiedNativeAd.googleLayout} style={styles.nativeAd} >
<GoogleUnifiedNativeAdView style={styles.nativeAd}>
//Layout for native ads provided by Google network.
</GoogleUnifiedNativeAdView>
<FacebookNativeAdView style={styles.nativeAd}>
//Layout for native ads provided by Facebook network.
</FacebookNativeAdView>
<BlueStackNativeAdView style={styles.nativeAd}>
//Layout for native ads provided by BlueStack network.
</BlueStackNativeAdView>
<GenericNativeAdView style={styles.nativeAd}>
//Layout for native ads provided by other networks.
</GenericNativeAdView>
</RNAatkitUnifiedNativeAd>
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.
<RNAatkitUnifiedNativeAd
name="unifiedNativeAd"
showTestDataForLayout={RNAatkitUnifiedNativeAd.genericLayout}
testData={
{
title: "Your custom title",
description: "Your custom description of the native ad.",
imageUrl: "main_image_url",
iconUrl: "icon_url",
callToAction: "Your CTA"
}
}
style={styles.nativeAd} >
<GoogleUnifiedNativeAdView style={styles.nativeAd}>
//Layout for native ads provided by Google network.
</GoogleUnifiedNativeAdView>
<FacebookNativeAdView style={styles.nativeAd}>
//Layout for native ads provided by Facebook network.
</FacebookNativeAdView>
<BlueStackNativeAdView style={styles.nativeAd}>
//Layout for native ads provided by BlueStack network.
</BlueStackNativeAdView>
<GenericNativeAdView style={styles.nativeAd}>
//Layout for native ads provided by other networks.
</GenericNativeAdView>
</RNAatkitUnifiedNativeAd>
API
For more details about properties of native ad component, please see this page in the Reference.