gpt4 book ai didi

swift - Admob 不显示广告

转载 作者:行者123 更新时间:2023-11-28 07:35:48 25 4
gpt4 key购买 nike

  @IBOutlet weak var MyBanner: GADBannerView!

override func viewDidLoad() {
super.viewDidLoad()

//Request

let request = GADRequest()
request.testDevices = [kGADSimulatorID]

//Set up ad

MyBanner.adUnitID = "omitted "
MyBanner.rootViewController = self
MyBanner.delegate = self

MyBanner.load(request)

我已确保我使用的是正确的 adUnitID 并且 IBOutlet 已正确分配,但是当我运行应用程序时,只有空白出现在广告应该出现的位置。这是输出的屏幕截图。 screenshot

这是运行代码时调试器的输出:

2018-11-07 22:12:42.806497-0600 CoverMe[7740:78040] Failed to set (keyPath) user defined inspected property on (UITabBar): [ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key keyPath. 2018-11-07 22:12:42.901273-0600 CoverMe[7740:78040] [MC] System group container for systemgroup.com.apple.configurationprofiles path is /Users/chomiak2/Library/Developer/CoreSimulator/Devices/43BF3F97-0A4D-4BFA-9FF5-1E85CF8DD784/data/Containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles 2018-11-07 22:12:42.901798-0600 CoverMe[7740:78040] [MC] Reading from private effective user settings. 2018-11-07 22:12:42.913366-0600 CoverMe[7740:78081] Could not successfully update network info during initialization. 2018-11-07 22:12:43.439099-0600 CoverMe[7740:78108] WF: === Starting WebFilter logging for process CoverMe 2018-11-07 22:12:43.439570-0600 CoverMe[7740:78108] WF: _userSettingsForUser : (null) 2018-11-07 22:12:43.439822-0600 CoverMe[7740:78108] WF: _WebFilterIsActive returning: NO

最佳答案

您是否尝试过使用测试 ID?它是否适用于测试广告 ID?

  • 如果您使用的是 17+ AdMob SDK(实现'com.google.android.gms:play-services-ads:17.0.0') 你需要在 AndroidManifest.xml 文件中指定应用程序 ID。您可以在 Admob 应用设置中找到您的应用 ID

    <meta-data
    android:name="com.google.android.gms.ads.APPLICATION_ID"
    android:value="@string/app_id"/>
  • 也可以尝试手动卸载应用程序,然后重新安装进行任何更改。

  • 很多时候 AdMob 需要 24-48 小时来转换广告,因此请过一段时间再测试,否则请使用任何旧的广告 ID

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

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