I'm facing problem implementing NativeAds using this library. I've followed what the docs say (Link here), but what I have in the code is deferent from what the documentation says.
1- I created a file for the Native Ad component :
import React from 'react';
import { View, Text } from 'react-native';
import {
withNativeAd,
AdIconView,
TriggerableView,
MediaView,
} from 'react-native-fbads';
const AdComponent = ({ nativeAd }) => {
return (
<View>
<AdIconView style={{ width: 50, height: 50 }} />
<MediaView style={{ width: 160, height: 90 }} />
<TriggerableView>
<Text>{nativeAd.description}</Text>
</TriggerableView>
</View>
);
};
export const MyNativeAd = withNativeAd(AdComponent);
2- Inside the screen where I want to display this ad :
import { InterstitialAdManager, AdSettings, NativeAdsManager } from 'react-native-fbads';
import { MyNativeAd } from 'components/NativeBanner';
...
let nativeAdsManager: NativeAdsManager = new NativeAdsManager(PLACEMENT_ID);
...
export const Myscreen = () => {
<View>
<MyNativeAd adsManager={nativeAdsManager} nativeAd={???????} />
</View>
}
As you can see in the code above, I must provide a nativeAd
property to the MyNativeAd
component. I don't know what I should put there. As the documentation do not mention anything related to this property. Any assistance how to correctly use the Native Ads would be appreciated.