【问题标题】:react-ntaive-admob showing test ad banner why not original ad on emulator ?react-native-admob 显示测试广告横幅为什么不在模拟器上显示原始广告?
【发布时间】:2017-06-05 06:17:44
【问题描述】:

我使用 React-native-admob 在我的 react-native 应用程序中展示谷歌广告。我的广告代码如下。

<View style={{width:slideWidth,height:60}}>
<AdMobBanner
 bannerSize="fullBanner"
 adUnitID="some-unit-id"
 testDeviceID="EMULATOR"

 didFailToReceiveAdWithError={this.bannerError}/>
</View>

它向我展示了这个测试横幅

为什么会这样?为什么它没有向我展示原始广告?

【问题讨论】:

    标签: react-native google-admob


    【解决方案1】:

    因为你写过

    testDeviceID="EMULATOR"
    

    删除此行,您的广告就会展示。

    注意:在开发过程中,不建议使用真实广告进行测试,因为您可能会不小心点击它们。最好检查它是否有效,然后恢复到测试模式。

    【讨论】:

    • 如果我删除它,那么这个测试横幅就不会出现
    • @Asad 您需要添加自己唯一的 adUnitID。说明在github页面中
    • support.google.com/admob/answer/…,获取您的 adUnitID 非常简单,此链接说明了如何设置您的广告单元
    • 我已经有了我的单位 ID,我认为问题出在 Ifone 5
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-02-09
    • 1970-01-01
    • 2021-11-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多