4

里面的文档MPAdView.h说:

/** @name Enabling Test Mode */

/**
 * A Boolean value that determines whether the ad view should request ads in test mode.
 *
 * The default value is NO.
 * @warning **Important**: If you set this value to YES, make sure to reset it to NO before
 * submitting your application to the App Store.
 */
@property (nonatomic, assign, getter = isTesting) BOOL testing;

但是当使用所描述的测试模式请求横幅时:

self.adView = [[MPAdView alloc] initWithAdUnitId:self.adUnitID size:self.size];
self.adView.delegate = self;
self.adView.testing = YES;
[self.adView loadAd];

没有广告返回:

MOPUB: Banner view (7e99efe0cd814f9d8c946ff530aa9900) failed. Error: Error Domain=NSURLErrorDomain Code=-1003 "A server with the specified hostname could not be found." UserInfo=0x167eeef0 {NSErrorFailingURLStringKey=http://testing.ads.mopub.com/m/ad?v=8&udid=ifa:XXXX&id=7e99efe0cd814f9d8c946ff530aa9900&nv=2.4.0&o=l&sc=2.0&z=-0200&mr=1&ct=2&av=1.5&cn=TIM&iso=&mnc=&mcc=&dn=iPhone3%2C1&ts=1, NSErrorFailingURLKey=http://testing.ads.mopub.com/m/ad?v=8&udid=ifa:XXXX&id=7e99efe0cd814f9d8c946ff530aa9900&nv=2.4.0&o=l&sc=2.0&z=-0200&mr=1&ct=2&av=1.5&cn=TIM&iso=&mnc=&mcc=&dn=iPhone3%2C1&ts=1, NSLocalizedDescription=A server with the specified hostname could not be found., NSUnderlyingError=0x167db490 "A server with the specified hostname could not be found."}

我正在使用MoPub SDK 3.0.0iOS 版。

该文档是否已过时?如何启用测试广告?

笔记:

  • 我的互联网连接正常;
  • 当测试模式等于时,我可以展示广告NO
4

1 回答 1

0

据我所知,你在做什么似乎没问题。我建议下载 MoPub SDK 的最新版本:(此时为 3.5.0)

https://github.com/mopub/mopub-ios-sdk/

于 2015-03-21T18:23:41.073 回答