Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iAd not working on iPad

I made an iPhone Application which uses iAd. On the iPhone Simulator and the Device it works fine. It already is on the App Store.

Today, one of my customers told me that iAd is not showing up on the iPad. So I build my app on the iPad Simulator and it is not showing up, while the iPhone Simulator / iPhone Device work like expected.

I never test which device it is before displaying something, so this can not be the error.

This one does not show up any error: - (void)bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error

Any ideas?

like image 547
DAS Avatar asked Dec 12 '22 03:12

DAS


2 Answers

If you want to use iAd, you pretty much need to be a universal app. My iPhone-only iAd app when run on an iPad in compatibility mode (on the simulator or on a real iPad) would call bannerViewDidLoadAd but then displayed a blank space instead of an ad. The Apple "iAd Implementation Best Practices" doc says:

Create Universal Apps

To ensure your app is capable of displaying iAd banners for all your users, 
make sure you’ve developed a universal app that supports all possible devices. 
**iPhone apps running in compatibility mode on iPad will not display a test ad
in development or live ads in deployed apps.**

https://developer.apple.com/library/ios/technotes/tn2264/_index.html

like image 128
mrzzmr Avatar answered Dec 29 '22 19:12

mrzzmr


I had a similar problem. The only solution for me was to make the application universal. Once the application was universal the iAds start working.

You might notice that even some of applications from iAds suite form Apple did not work. And they mention somehting in this regard in their description here:

http://developer.apple.com/library/ios/#samplecode/iAdSuite/Introduction/Intro.html

The BasicBanner and ContainerBanner are configured to support both iPhone and iPad idioms, the TabbedBanner and NavigationBanner to support only the iPhone idiom, and the SplitViewBanner to support only the iPad idiom.

The only difference I have found was the universal vs. iPhone app settings (target->SUmmary->Device combobox).

Hoever, if I remember correctly, my - (void)bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error was called. The error was saying something about that there is no available iAds.

Also, I tried only on iOS5 (both simulator and device).

Hope this will help you a little ;)

Update: Also check this SO question in case you are using some older SDK: Is iAds not available for iPad apps?

like image 37
Ondrej Peterka Avatar answered Dec 29 '22 20:12

Ondrej Peterka