Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ionic-framework/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android emulator中未显示横幅广告_Android_Ionic Framework_Emulation_Ads - Fatal编程技术网

Android emulator中未显示横幅广告

Android emulator中未显示横幅广告,android,ionic-framework,emulation,ads,Android,Ionic Framework,Emulation,Ads,我有这段代码用于在Android模拟器中测试bannerads。我有适当的进口商品。调用this.showBannerAd()将停止emulator启动应用程序。在这方面的任何投入都会有所帮助 构造函数代码: constructor( platform: Platform, private admobFree: AdMobFree, ) { if (!platform.is('c

我有这段代码用于在Android模拟器中测试bannerads。我有适当的进口商品。调用
this.showBannerAd()
将停止emulator启动应用程序。在这方面的任何投入都会有所帮助

构造函数代码:

constructor(  platform: Platform, 
              private admobFree: AdMobFree,              

            ) {
                if (!platform.is('core')) {
                  this.showBannerAd();
              }
            }
 async showBannerAd(){
    const bannerConfig: AdMobFreeBannerConfig = {
      isTesting: true,
      autoShow: true
    }
     this.admobFree.banner.config(bannerConfig);

    try {
      const result = this.admobFree.banner.prepare();
      console.log("Admob result: ", result)

    }

    catch(e) {
      console.error(e);
    }
  }
在开发过程中启用测试广告非常重要,因为Google 不允许开发者在应用程序运行时使用真正的横幅 发展

有两种方法可以实现这一点:

使用横幅Id
ca-app-pub-3940256099942544/630978111

或使用填隙式
ca-app-pub-3940256099942544/1033173712

重新运行你的应用程序。如果广告是谷歌广告,你会看到一个测试广告标签在广告顶部居中(横幅、间隙或奖励视频)

在开发过程中启用测试广告非常重要,因为Google 不允许开发者在应用程序运行时使用真正的横幅 发展

有两种方法可以实现这一点:

使用横幅Id
ca-app-pub-3940256099942544/630978111

或使用填隙式
ca-app-pub-3940256099942544/1033173712

重新运行你的应用程序。如果广告是谷歌广告,你会看到广告顶部有一个测试广告标签(横幅、插页或奖励视频)。

我不知道答案(甚至可能不会提供更多信息),但如果你能添加你的模拟器使用的安卓版本,肯定会对回答者有所帮助。此外,这只会发生在模拟器上,还是也会发生在你的硬件手机上?我不知道答案(甚至可能不会提供更多信息),但如果你能添加你的模拟器正在使用的android版本,肯定会对回答者有所帮助。此外,它是否只发生在模拟器上,或者也发生在您的硬件手机上?