问题描述
我在尝试使用 Admob Free 插件显示广告时遇到了 Ionic 3 的问题.我的广告只会在测试模式下展示 (isTesting: true).如果我将其设置为 false 或注释该行,则没有广告 ...
I have a problem with Ionic 3 when trying to display ads with Admob Free plugin.My Ads will only show in test mode (isTesting: true).If I set it to false or comment the line, no Ads ...
这是我的代码:
showBannerAd(){
const bannerConfig: AdMobFreeBannerConfig = {
id:'BANNER-ID',
autoShow: true,
isTesting: false
}
this.adMob.banner.config(bannerConfig);
this.adMob.banner.prepare().then(()=>{
//this.adMob.banner.show();
}).catch(err => console.log(err));
}
如果我取消注释 this.adMob.banner.show() 以强制投放广告,则只会出现一个黑色单元.
If I uncomment the line this.adMob.banner.show() to force the ads, only a black unit appears.
我以为可能和我的项目有关,所以我什至开始了一个空白项目,结果都是一样的.
I thought it could be related to my project, so I even started a blank project and the results were the same.
有人修过吗?谢谢!!!
Has anyone fixed before?Thanks!!!
推荐答案
我终于解决了这个问题!
Finally I solved this issue!
由于我的代码似乎是正确的,当测试广告正常工作时,我回到我的 Admob 帐户,发现我缺少付款信息.
Since my code seemed to be right, as the test Ads were working, I went back to my Admob account and found out that I had missing payment info.
我在付款页面上添加我的地址后,我的实时广告就开始投放了.
As soon as I added my address on the payment page, my live Ads started being served.
我已经在 Android(模拟器和设备)和 IOS(仅限模拟器)上测试了我的应用,并且在两者上都可以正常投放实时广告.
I have tested my app on Android (emulator and device) and IOS (emulator only) and the Live Ads are being served with no problem on both.
这篇关于IONIC 3 - Admob Free 在测试为假时不显示广告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!