ios - Admob 广告不显示 swift

标签 ios swift xcode admob

您好,我正在尝试将 admob 广告添加到已使用 swift 上传到应用商店的应用程序中。我在 admob 中制作了一个应用程序并复制了 appid 和广告 ID,并显示了相应的横幅广告和插页式广告。这里的问题是当我写这一行时

request.testDevices = [ "53441f52e531b870fe8c34151a2f6013" ]

测试广告显示和运行完美,但当我评论此行时,控制台中显示以下错误。

Request Error: No ad to show.

此消息打印在GADBannerViewDelegate的重载方法中

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

请帮我解决这个问题。我真的不确定为什么会这样?

最佳答案

你的代码没有错。 有时由于库存不足而无法显示广告。这取决于您展示广告的位置, 您要在哪个国家/地区展示广告?

如果您希望广告达到 100% 的填充率,请尝试广告中介

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

关于ios - Admob 广告不显示 swift,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44479174/

相关文章:

ios - 为什么不在 objective-c 中工作委托(delegate)?

swift - Swift 中高效且一致的时序 (GCD)

ios - fatal error : unexpectedly found nil while unwrapping an Optional value while using Swift

objective-c - 如何使用 cocoa 进度条?

iphone - 如何将 XML 作为字符串发送到 Soap Action?

ios - 线程 1 收到信号 SIGABART 错误

iphone - iOS访问云存储中存储的文件

ios - Xcode 仪器 : Leaks - App crashes on launch

ios - 如何修复 UICollectionViewCell 中的图像高度?

ios - SWIFT:切换 rootviewcontroller