ios - AdMob 插页式错误 "Request Error: No ad to show"

标签 ios swift admob

我正在使用 Swift2 和 Xcode7 开发一个 iOS 应用程序。我正在尝试实现 AdMob,但它没有显示我的插页式广告。

override func viewDidLoad() {
    super.viewDidLoad()

    _interstitial = createAndLoadInterstitial()
}

func createAndLoadInterstitial()->GADInterstitial {
    let interstitial = GADInterstitial(adUnitID: "interstitial_ID")
    let gadRequest:GADRequest = GADRequest()
    gadRequest.testDevices = ["test device id"]
    interstitial.delegate = self
    interstitial?.loadRequest(gadRequest)

    return interstitial!
}

func interstitialDidReceiveAd(ad: GADInterstitial!) {
    _interstitial?.presentFromRootViewController(self)
}

func interstitial(ad: GADInterstitial!, didFailToReceiveAdWithError error: GADRequestError!) {
    print(error.localizedDescription)
}

func interstitialDidDismissScreen(ad: GADInterstitial!) {
    _interstitial = createAndLoadInterstitial()
}

我收到此错误:

Request Error: No ad to show.

enter image description here

最佳答案

请求错误:没有要显示的广告。

表示您的请求已成功,但 Admob 目前没有针对您的设备展示的广告。确保始终有广告展示的最佳方式是使用中介,这样未完成的请求就会进入另一个广告网络。 Admob 提供了很好的机制来做到这一点。

关于ios - AdMob 插页式错误 "Request Error: No ad to show",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32822987/

相关文章:

android - 为什么包含 Google Play 服务库时权限会自动添加到我的 AndroidManifest

android - 查找 admob 的电话哈希设备 ID

ios - 获取 UIBezierPath 的所有顶点

ios - Split View Controller 和 UIWebView

ios - UITableViewController : Objects properties deallocated

ios - 如何根据用户选择在 CollectionView 标题下方显示不同的单元格?

ios - 如何为 iPhone 8 屏幕与 iPhone X 及更高版本的底部 anchor 设置不同的常量?

android - 控制在我的应用程序上转换哪些广告

ios - Swift 4 CoreML 无法获取数组的第一个值

ios - 如何启动短信应用程序