我第一次尝试将Google横幅添加到iOS应用程序中,正在阅读Google菜单。www.example.comhttps://developers.google.com/admob/ios/test-ads#swift
它说我需要添加一行带有示例设备ID的代码:
GADMobileAds.sharedInstance().requestConfiguration.testDeviceIdentifiers =
[ "2077ef9a63d2b398840261c8221a0c9b" ] // Sample device ID
我的简单但似乎没有答案的问题是,我如何找到我自己的样本设备ID呢?
现在,XCode项目中的代码在正确页面的ViewDidLoad下看起来如下所示:
bannerView?.adUnitID = "ca-app-pub-31361704xxxxxxxx/94xxxxxxxx"
bannerView?.rootViewController = self
GADMobileAds.sharedInstance().requestConfiguration.testDeviceIdentifiers = [ kGADSimulatorID ]
bannerView?.load(GADRequest())
当我运行时,没有返回任何谷歌横幅。我在想象,在我填写kGADSimulatorID后,它看起来像一个占位符与真实的ID,那么我会没事吗?
谢谢!
1条答案
按热度按时间y0u0uwnf1#
首先转到“添加其他模拟器”
然后从列表中选择任意一个模拟器,您就可以找到该模拟器的标识符。