在单击添加时。safari 打开并显示一条警报,其中包含 safari 无法打开此 URL 因为 URL 无效的消息。我使用下面的代码来测试添加。我在这段代码中遗漏了什么?
bannerView_ = [[GADBannerView alloc] initWithAdSize:kGADAdSizeBanner];
bannerView_.rootViewController = self;
bannerView_.adUnitID = MY_BANNER_UNIT_ID;
[bannerView_ setFrame:CGRectMake(0,370 ,bannerView_.bounds.size.width, bannerView_.bounds.size.height)];
GADRequest *request = [GADRequest request];
// Make the request for a test ad. Put in an identifier for
// the simulator as well as any devices you want to receive test ads.
UIDevice *device = [UIDevice currentDevice];
NSString *uniqueIdentifier = [device uniqueIdentifier];
request.testing = YES;
//NSLog(@"Device GUID: %@", uniqueIdentifier);
request.testDevices = [NSArray arrayWithObjects:
uniqueIdentifier,
nil];
[bannerView_ loadRequest:request];