gpt4 book ai didi

ios - admob 测试广告 -> 没有广告可显示

转载 作者:行者123 更新时间:2023-12-01 16:22:42 25 4
gpt4 key购买 nike

这不是重复的。。

在新的 Admob SDK (Google-Mobile-Ads-SDK 7.31.0) 中,当您展示测试广告时,它会向您显示 真实广告(!)它添加了一个带有“测试广告”字样的注释

但有时,当您确实需要展示广告(出于测试目的)时 - 您会收到错误代码 1“请求错误:没有广告可展示”。

测试广告。测试显示时我可以看到“测试广告”字样! (当它显示时,现在什么都没有显示=[)

所以,我的问题是:
有人知道解决方法吗?

example of annotation in an interstitial ad

最佳答案

现在我知道答案了……这是 SDK 中的一个错误。 =[

see here

The easiest way to load test ads is to use our dedicated test ad unit ID for iOS banners: ca-app-pub-3940256099942544/2934735716

It's been specially configured to return test ads for every request, and you're free to use it in your own apps while coding, testing, and debugging. Just make sure you replace it with your own ad unit ID before publishing your app.



编辑 : 我找到并解决了 真实 问题。

制作广告时,您有两种选择:
  • 将其添加到 View 层次结构 之后 它会加载广告 ---> 始终有效
  • 将其添加到 View 层次结构 之前 它会加载一个广告 ---> 小心这个

  • 如果您选择第二种方法,您必须 设置框架广告浏览量 到可见尺寸 (宽度 + 高度),您必须确保 isHidden = false
    我的问题是我想为广告的展示制作动画。我将横幅添加到 UIStackView 并设置其 isHiddentrue .

    我使用了代理,所以在加载广告时,我为 isHidden 设置了动画。至 false .一切看起来都不错,但显然 Google 移动广告 SDK 会在加载广告之前验证广告是否可见 --- 我的广告 View 是 不是 可见的!所以我得到了 Request Error: No ad to show

    Thanks Google for "great" documentation =[

    关于ios - admob 测试广告 -> 没有广告可显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50737008/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com