我正在尝试在应用上使用AdMob(专为iOS 4.0而构建)
我添加了教程http://code.google.com/mobile/ads/docs/ios/fundamentals.html中提供的示例代码,其中包含以下内容(我已更改了adUnitID):
// Create a view of the standard size at the bottom of the screen.
bannerView_ = [[GADBannerView alloc]
initWithFrame:CGRectMake(0.0,
self.view.frame.size.height -
GAD_SIZE_320x50.height,
GAD_SIZE_320x50.width,
GAD_SIZE_320x50.height)];
// Specify the ad's "unit identifier." This is your AdMob Publisher ID.
bannerView_.adUnitID = @"XYZ";
// Let the runtime know which UIViewController to restore after taking
// the user wherever the ad goes and add it to the view hierarchy.
bannerView_.rootViewController = self;
[self.view addSubview:bannerView_];
[self.view bringSubviewToFront:bannerView_];
GADRequest * request = [GADRequest request];
// Initiate a generic request to load it with an ad.
[bannerView_ loadRequest:request];
Run Code Online (Sandbox Code Playgroud)
这样做没有任何反应,没有显示广告,我的AdMob应用页面中的请求数量也不规律地增加(即:我似乎无法注意到某种模式),但最重要的是没有显示广告.
如果我添加以下代码:
GADRequest * request = [GADRequest request];
request.testDevices = [NSArray arrayWithObjects:
GAD_SIMULATOR_ID, // Simulator
nil];
// Initiate a generic request to load it with an ad.
[bannerView_ loadRequest:request];
Run Code Online (Sandbox Code Playgroud)
我得到了"成功!你现在已准备好通过App Galaxy"默认横幅,但只有这一个.
所以我的问题是:
提前致谢.
| 归档时间: |
|
| 查看次数: |
11141 次 |
| 最近记录: |