简体   繁体   English

Admob广告显示不快

[英]Admob ads not showing swift

Hi i am trying to add admob ads into an application that is already uploaded to the appstore using swift. 嗨,我正在尝试将admob广告添加到已经使用swift上传到应用商店的应用中。 I made an app in the admob and copied appid, and ads ids and showed respective banner and interstitial ads. 我在admob中制作了一个应用,并复制了appid和广告ID,并分别显示了横幅广告和插页式广告。 The problem here is that when i write this line 这里的问题是当我写此行时

request.testDevices = [ "53441f52e531b870fe8c34151a2f6013" ]

the test ads show and work perfectly but when i comment this line the following error is shown in the console. 测试广告可以正常显示和运行,但是当我对此行发表评论时,控制台中显示以下错误。

Request Error: No ad to show. 请求错误:无广告显示。

This message is printed in the overloaded method of GADBannerViewDelegate 该消息以GADBannerViewDelegate的重载方法打印

 public func interstitial(_ ad: GADInterstitial, didFailToReceiveAdWithError error: GADRequestError){
    print("Inter error: \(error.localizedDescription)")
}

Please help me through this problem. 请帮助我解决这个问题。 I am really not sure why is it happening? 我真的不确定为什么会这样吗?

Nothing wrong in your code. 您的代码没有错。 Sometimes ads are not displayed due to lack of inventory. 有时由于缺乏库存而无法显示广告。 It depends upon where you are displaying your advertisements, Which country you are trying to display ads? 这取决于您在哪里展示广告,您试图在哪个国家展示广告?

If you want 100% fill rate for your ads try an advertisements mediation 如果您希望广告的填充率为100%,请尝试广告中介

https://developers.google.com/admob/android/mediation https://developers.google.com/admob/android/mediation

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM