Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
403 views
in Technique[技术] by (71.8m points)

ios - 除非在测试设备上,否则iOS AdMob广告不会展示(iOS AdMob ads not showing up unless on Test Device)

I have followed the tutorial provided by Google here: https://developers.google.com/mobile-ads-sdk/docs/admob/ios/quick-start in order to setup admob banner ads.

(我已经按照Google提供的教程进行了操作: https//developers.google.com/mobile-ads-sdk/docs/admob/ios/quick-start ,以便设置admob标语广告。)

My code is exactly how it is shown in the guide from the link above, so when I run the app on my test device or simulator a 'Smart Banner' 'Test Ad' appears..however, the second I remove the line of code below no banner appears at all..

(我的代码与上面链接中的指南完全相同,因此,当我在测试设备或模拟器上运行该应用程序时,会出现“智能横幅”“测试广告”。但是,第二个代码行删除了下方完全没有显示横幅。)

 request.testDevices = @[ @"70b9ee4e66c8e6fa26cb84def25706d9" ];

Also, I've loaded the app on another device and still there is no ad banner appearing, which makes me wonder when I submit the app to the App Store it only makes sense that all my users won't be seeing ads on their devices.

(另外,我已经在其他设备上加载了该应用程序,但是仍然没有广告横幅出现,这让我想知道当我将该应用程序提交到App Store时,这仅意味着我所有的用户都不会在其设备上看到广告。)

Why is this happening?

(为什么会这样呢?)

I've been scratching my head on this one!

(我一直在挠头!)

I don't want to submit it for review until I am certain everything is working correctly and I know that ads will appear not only on test devices but when the app goes LIVE as well.

(在确定一切正常运行之前,我不希望将其提交审核,并且我知道广告不仅会在测试设备上展示,而且会在应用程序上线时展示。)

Thanks in advance!

(提前致谢!)

:)

(:))

  ask by Mike Simz translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Weird solution but it worked:

(奇怪的解决方案,但是有效:)

By following the guide provided by Google to setup Ad Mediation in iOS, it tells you to implememnt it via Storyboard/nib.

(按照Google提供的指南在iOS中设置广告中介,它可以告诉您通过Storyboard / nib实施它。)

Once I removed this method and simply implemented the GADBannerView programmatically, everything began to work as expected.

(一旦我删除了此方法,并以编程方式简单地实现了GADBannerView,一切便开始按预期工作。)

Quite the annoying issue, but thankfully it's solved and I can move on.

(非常令人讨厌的问题,但幸运的是,它已解决,我可以继续。)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...