Test Ads does not work


#1

With iOS SDK I get timeout while connecting
http://testing.ads.mopub.com/m/ad?v=8&udid=ifa:XXXX&id=f729cb754d1246ea9ae0d9f1649202dd&nv=3.1.0&o=p&sc=2.0&z=+0400&mr=1&ct=2&av=2.4&cn=Carrier&iso=ru&mnc=20&mcc=250&dn=iPhone5%2C1&ts=3

MOPUB: Banner view (f729cb754d1246ea9ae0d9f1649202dd) loading ad with MoPub server URL: http://testing.ads.mopub.com/m/ad?v=8&udid=ifa:XXXX&id=f729cb754d1246ea9ae0d9f1649202dd&nv=3.1.0&o=p&sc=2.0&z=+0400&mr=1&ct=2&av=2.4&cn=Carrier&iso=ru&mnc=20&mcc=250&dn=iPhone5%2C1&ts=3
MOPUB: Banner view (f729cb754d1246ea9ae0d9f1649202dd) failed. Error: Error Domain=NSURLErrorDomain Code=-1001 "Превышен лимит времени на запрос." UserInfo=0x16dab510 {NSErrorFailingURLStringKey=http://testing.ads.mopub.com/m/ad?v=8&udid=ifa:XXXX&id=f729cb754d1246ea9ae0d9f1649202dd&nv=3.1.0&o=p&sc=2.0&z=+0400&mr=1&ct=2&av=2.4&cn=Carrier&iso=ru&mnc=20&mcc=250&dn=iPhone5%2C1&ts=3, NSErrorFailingURLKey=http://testing.ads.mopub.com/m/ad?v=8&udid=ifa:XXXX&id=f729cb754d1246ea9ae0d9f1649202dd&nv=3.1.0&o=p&sc=2.0&z=+0400&mr=1&ct=2&av=2.4&cn=Carrier&iso=ru&mnc=20&mcc=250&dn=iPhone5%2C1&ts=3, NSLocalizedDescription=Превышен лимит времени на запрос., NSUnderlyingError=0x16d97160 "Превышен лимит времени на запрос."}

#2

Hey Ivans,

Why are you calling http://testing.ads.mopub.com/m/ ?

On a live app and simulator, you should be calling http://ads.mopub.com/m/

What are you testing this on and what is the context of this timeout?

Edward


#3

Hi Edward,
I just use your sdk in test mode.
I don’t know why this sdk trying to reach this url.


#4

On MoPub for iOS, MPAdView contains a property

/**
 * 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;

Which I have conditionally enabled during testing like so

#ifdef DEBUG
        self.adView.testing = YES;
#else
        self.adView.testing = NO;
#endif

However, this results in the following error (and test Ads do not show) - note error in truncated for brevity/privacy

NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9843)
2016-07-26 13:20:02.420 [10141:12057531] MOPUB: Banner view (f8cf1caadec0440abfd335457ba174cd) failed. Error: Error Domain=NSURLErrorDomain Code=-1202 "The certificate for this server is invalid. You might be connecting to a server that is pretending to be “testing.ads.mopub.com” which could put your confidential information at risk." UserInfo={NSURLErrorFailingURLPeerTrustErrorKey=<SecTrustRef: 0x7f9af1ec7ee0>, NSLocalizedRecoverySuggestion=Would you like to connect to the server anyway?, _kCFStreamErrorDomainKey=3, _kCFStreamErrorCodeKey=-9843, NSErrorPeerCertificateChainKey=<CFArray 0x7f9af1e32af0 [0x1107f8a40]>{type = immutable, count = 2, values = (
	0 : <cert(0x7f9af1ed6210) s: *.mopub.com i: DigiCert SHA2 High Assurance Server CA>
	1 : <cert(0x7f9af1ee4bc0) s: DigiCert SHA2 High Assurance Server CA i: DigiCert High Assurance EV Root CA>
)}, NSUnderlyingError=0x7f9af30027d0 {Error Domain=kCFErrorDomainCFNetwork Code=-1202 "The certificate for this server is invalid. You might be connecting to a server that is pretending to be “testing.ads.mopub.com” which could put your confidential information at risk." UserInfo={NSErrorFailingURLStringKey=https://testing.ads.mopub.com/m/ad?

#5

Hi @doescode,

Thank you for providing that clarification. Please note that test mode has been deprecated and we are working to remove this functionality from future SDK releases. For now, you’ll want to disable testing mode in order to ensure that requests are made to “http://ads.mopub.com/m/” rather than " http://testing.ads.mopub.com/m/", which has been deprecated.

Our apologies for the confusion this has created. If you have any trouble testing your ad units with test mode turned off, please don’t hesitate to let us know. The best and fastest way to reach us is via our Support Team, who can be reached at support@mopub.com. Please make sure to include the email address associated with your account, your ad unit IDs and any other information relevant to your problem when you reach out.

Thanks!