【发布时间】:2017-10-08 02:32:58
【问题描述】:
我设置了一个非常简单的视图控制器,主要目的是尝试使用 Google Mobile Ads 7.20.0 运行测试原生广告。
使用下面发布的我的代码,Google 在其 Admob 存储库中提供的测试 adUnitID 不起作用。从来没有广告。但是,如果我使用生产 adUnitID,它显示得很好。我需要测试广告以用于开发目的。我没有使用 Firebase。
import GoogleMobileAds
import UIKit
class ViewController: UIViewController {
let testID = "ca-app-pub-3940256099942544/8897359316"
@IBOutlet weak var adView: GADNativeExpressAdView! // Using storyboard here.
override func viewDidLoad() {
super.viewDidLoad()
adView.adUnitID = testID
adView.rootViewController = self
let request = GADRequest()
request.testDevices = [kGADSimulatorID]
adView.load(request)
}
}
这是打印到控制台的内容
[DYMTLInitPlatform] platform initialization successful
[MC] System group container for systemgroup.com.apple.configurationprofiles path is /private/var/containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles
[MC] Reading from public effective user settings.
<Google> To get test ads on this device, call: request.testDevices = @[ @"abc123" ];
Metal GPU Frame Capture Enabled
Metal API Validation Enabled
libMobileGestalt MobileGestaltSupport.m:153: pid 1983 (Native Admob Test) does not have sandbox access for frZQaeyWLUvLjeuEK43hmg and IS NOT appropriately entitled
libMobileGestalt MobileGestalt.c:550: no access to InverseDeviceID (see <rdar://problem/11744455>)
上面有什么明显的地方吗? 如何让 Google 测试广告 ID 与 Native Ad Express 一起使用?
【问题讨论】:
-
这里还有一点发现... 结果,我的原生横幅视图有 100 高(在故事板中)。我将其更改为 300 并且上面的代码运行良好。看起来我只需要获得一个为“小模板”原生横幅配置的谷歌测试 adUnitID。所以现在是百万美元的问题:)
-
您是否给了 GoogleAd 的代表?
标签: ios swift admob native-ads