react-native(expo)应用中的Admob不显示

时间:2019-02-19 07:23:09

标签: android react-native expo

我刚刚为我的android应用应用了生产广告单元ID(未发布到Google Play,并且我正在手机上进行测试,并且还使用产品广告单元ID进行了模拟器,但广告未展示,像这样的源代码

// Display a banner
<AdMobBanner
  bannerSize="fullBanner"
  adUnitID="ca-app-pub-3940256099942544/6300978111" // Test ID, Replace with your-admob-unit-id
  testDeviceID="EMULATOR"
  onDidFailToReceiveAdWithError={this.bannerError} />

https://docs.expo.io/versions/latest/sdk/admob/

上面带有测试ID的代码显示在我的应用程序中(在我的手机和模拟器上进行测试),但是我使用读取密钥,有人知道这是什么问题吗?

1 个答案:

答案 0 :(得分:0)

/*I have tried using this approach to see if will stop the indexing upon running the project, but the search algorithm never works thereafter because not results was returned*/
FullTextEntityManager fullTextEntityManager = Search.getFullTextEntityManager(em);
            fullTextEntityManager.createIndexer().optimizeAfterPurge(true);


//This is the code doing the indexing of the db records before deployment
 public void initializeHibernateSearch() {

        try {
            FullTextEntityManager fullTextEntityManager = Search.getFullTextEntityManager(em);
            fullTextEntityManager.createIndexer().startAndWait();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }

将测试设备ID放入类似

的testDevices中

testDevices = {“ sdflhfdshfsdgudsgfuydsgfydsgftysdfdfgsh”}