我使用 AdMob 中介服务设置了一个基本应用程序作为测试。
- (void)viewDidLoad {
[super viewDidLoad];
// Create a view of the standard size at the top of the screen.
// Available AdSize constants are explained in GADAdSize.h.
bannerView_ = [[GADBannerView alloc] initWithAdSize:kGADAdSizeBanner];
// Specify the ad's "unit identifier." This is your AdMob Publisher ID.
bannerView_.adUnitID = kAdMobPublisherID;
// 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_];
// Initiate a generic request to load it with an ad.
[bannerView_ loadRequest:[GADRequest request]];
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.
request.testDevices = [NSArray arrayWithObjects:
@"4D047EB9-A3A7-441E-989E-C5437F05DB04",
@"YOUR_DEVICE_IDENTIFIER",
nil];
}
当应用程序无法接收广告时,我会收到这些错误。我相信 iAd 在测试 iAd 广告期间会发送相当多的错误。
[AppDeveloper]: ADBannerView: Unhandled error (no delegate or delegate does not implement didFailToReceiveAdWithError:): Error Domain=ADErrorDomain Code=4 "The operation couldn’t be completed. Application has iAd Network configuration error" UserInfo=0x9fd8d20 {ADInternalErrorCode=4, ADInternalErrorDomain=ADErrorDomain, NSLocalizedFailureReason=Application has iAd Network configuration error}
该错误是由于没有实现 didFailToReceiveAdWithError。我的问题是如何实现这个方法。
我查看了 iAd 节目指南:iAd Prog 指南
这建议设置这样的方法......
- (void)bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error
但是,由于我的代码没有直接实现 iAd 网络,它是使用中介服务设置的。我不确定如何将上述方法更改为工作。