I want to use react-native-fbads in my react-native app (I've never used facebookAds) for inserting an Interstitial Ads.
This is what I've done in one of my app component (after react-native install react-native-fbads
):
import { InterstitialAdManager } from 'react-native-fbads';
constructor(props) {
InterstitialAdManager.showAd("XXXXX_XXXXX") // this is line 16
.then(didClick => {console.log("clicked")})
.catch(error => {console.log("error")})
}
but I keep get this error: undefined is not an object (evaluating 'CTKInterstitialAdManager.showAd')
Have you try running react-native link react-native-fbads
?
This will automatically link the library's native dependencies to your iOS/Android projects.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.