简体   繁体   English

AdMob 横幅显示在模拟器中,但不在设备/TestFlight 上

[英]AdMob banner shows in Simulator but not on device/TestFlight

I'm using AdMob for banner ads in an app.我正在将 AdMob 用于应用中的横幅广告。 The banner ads show up on the Simulator but not when I run it on an iPhone device via connected cord or TestFlight.横幅广告显示在模拟器上,但当我通过连接的电源线或 TestFlight 在 iPhone 设备上运行它时不会显示。

This is my code for running it on a real device:这是我在真实设备上运行它的代码:

let request = GADRequest()
bannerView.adUnitID = realAdUnitID
bannerView.rootViewController = self
bannerView.delegate = self
bannerView.load(request)

Am I missing something?我错过了什么吗?

I've tried to look at other questions but nothing has worked for me yet that has been suggested.我试图查看其他问题,但没有任何建议对我有用。

Thanks!谢谢!

First of all, do you running the debug or the release version?首先,你运行的是调试版还是发布版? If you run your app in the debug mode, add the device id (you can find it in the console) to the testDevices array:如果您在调试模式下运行您的应用程序,请将设备 ID(您可以在控制台中找到)添加到testDevices数组:

let request = GADRequest()
request.testDevices = [kGADSimulatorID,  // All simulators
                       "2077ef9a63d2b398840261c8221a0c9b"];  // Sample device ID

Read more about test ads in AdMob Documentation在 AdMob 文档中详细了解测试广告

And the second thing you should consider, that AdMob may not provide enough fill rate for your ads.您应该考虑的第二件事是,AdMob 可能无法为您的广告提供足够的填充率。 Especially if the app is new, it can take some time while traffic will be analysed, before the service will provide your some ads.特别是如果应用程序是新的,可能需要一些时间来分析流量,然后服务才会为您提供一些广告。 Consider this, if your testing your app in release mode.如果您在发布模式下测试您的应用程序,请考虑这一点。

Perhaps try checking your iPhone Settings to see if Limit Ad Tracking is turned on?也许尝试检查您的 iPhone 设置以查看是否启用了限制广告跟踪? (Settings/Privacy/Advertising). (设置/隐私/广告)。

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

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