【发布时间】:2024-04-28 04:25:01
【问题描述】:
最近我尝试将 react-native-admob 添加到我的应用程序中。 我在使用 ios 时遇到错误。 不变违规:requireNativeComponent:在 UIManager 中找不到“RNGADBannerView”。
"react": "16.8.6",
"react-native": "0.60.5",
"react-native-admob": "^2.0.0-beta.5",
我将此添加到 podfile。 pod '谷歌-移动-广告-SDK' 然后,再次安装 pod。 光盘 吊舱安装
我还在 info 中添加了 GADApplicationIdentifier。
import {
AdMobBanner,
} from 'react-native-admob'
class BannerAds extends Component {
render() {
return (
<AdMobBanner
style={styles.bottomBanner}
adSize="banner"
adUnitID="my app id"
onAdFailedToLoad={error => console.error(error)}
/>
// <View>
// </View>
)
}
}
【问题讨论】:
标签: ios react-native react-native-android ads