我正在测试 AdMob。我这样做:
AdManager *adManager = [AdManager sharedAdManager];
adManager.gadBannerView.adUnitID = @"a1514981c9444a4";
adManager.gadBannerView.rootViewController = self;
adManager.gadBannerView.delegate = self;
[adManager.gadBannerView setOriginY:self.view.frame.size.height-adManager.gadBannerView.frame.size.height];
[self.view addSubview:adManager.adBannerView];
GADRequest *request = [GADRequest request];
request.testDevices = [NSArray arrayWithObjects:@"CECADC69-4A6B-4BB4-BF24-CACDA871B44A", nil];
[adManager.gadBannerView loadRequest:request];
而@"CECAD..." GAD_SIMULATOR_ID。当我在模拟器上进行测试时,我总是在控制台中收到错误。在我的设备上也出现同样的错误。iOS版本为6.0+。即使我删除request.testDevices = ...
,我也无法获得任何广告。
“Google”:要在此设备上获取测试广告,请调用:request.testDevices = [NSArray arrayWithObjects:GAD_SIMULATOR_ID, nil];