[英]can't insert Facebook interstitial ads into react-native app
I want to use react-native-fbads in my react-native app (I've never used facebookAds) for inserting an Interstitial Ads. 我想在我的react-native应用程序中使用react-native-fbads (我从未使用过facebookAds)来插入非页内广告。
This is what I've done in one of my app component (after react-native install react-native-fbads
): 这是我在一个应用程序组件中完成的操作(
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')
但我一直收到此错误:
undefined is not an object (evaluating 'CTKInterstitialAdManager.showAd')
Have you try running react-native link react-native-fbads
? 您是否尝试运行
react-native link react-native-fbads
?
This will automatically link the library's native dependencies to your iOS/Android projects. 这将自动将库的本机依赖项链接到您的iOS / Android项目。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.