I recommend using Adwhirl - that way you can have iAd, admob, inmobi, ... and you can configure them on the fly even after your app is in the app store. Most times, you don't get an ad from iAd. This way, you get ads from atleast one ad network.
For convenience, you can take my static library at git@github.com:navisingh/ad-networks.git and use it as follows:
//your view controller class looks like this:
#import "AdWhirl/AdWhirlView.h"
//AdWhirl's two requirements.
- (NSString *)adWhirlApplicationKey {
return @"your key here"; //key obtained from adwhirl site.
} //supply the key
- (UIViewController *)viewControllerForPresentingModalView {
return self;
} //and supply the controller.
//Animate ad from adwhirl.
- (void)adWhirlDidReceiveAd:(AdWhirlView *)adView {
NSString *network = [adWhirlView_ mostRecentNetworkName];
[UIView beginAnimations:@"AdWhirlDelegate.adWhirlDidReceiveAd:" context:nil];
[UIView setAnimationDuration:0.7];
//move the add to the bottom of the view instead of the top.
CGSize adSize = [adView actualAdSize];
CGRect newFrame = adView.frame;
newFrame.size = adSize;
CGFloat w = self.view.bounds.size.width;
CGFloat h = self.view.bounds.size.height;
newFrame.origin.x = (w - adSize.width)/ 2;
newFrame.origin.y = (h - adSize.height);
adView.frame = newFrame;
[UIView commitAnimations];
}
- (void)requestAdWhirlView
{
//add the AdWhirl view
NSLog(@"Request ad");
adWhirlView_ = [AdWhirlView requestAdWhirlViewWithDelegate:self];
[sparrowView addSubview:adWhirlView_];
//http://stackoverflow.com/questions/4160010/is-it-a-problem-when-an-iad-may-be-obscured
[sparrowView bringSubviewToFront:adWhirlView_];
}
- (void)stopRequestingAds
{
[adWhirlView_ ignoreNewAdRequests];
NSString *network = [adWhirlView_ mostRecentNetworkName];
if ([network isEqualToString:@"iad"]) {
int xxx = 0;
}
adWhirlView_.hidden = YES;
[adWhirlView_ release];
}
- (void)loadView
{
[super loadView];
CGRect frame = [[UIScreen mainScreen] bounds];
sparrowView = [[ [SPView alloc] initWithFrame:frame] autorelease];
sparrowView.clipsToBounds = YES;
[[self view] addSubview: sparrowView];
}
- (void)viewDidLoad {
[super viewDidLoad];
//load sparrow
SP_CREATE_POOL(pool);
[SPStage setSupportHighResolutions:YES];
[SPAudioEngine start];
Game *game = [[Game alloc] init];
mSparrowView.stage = game;
mSparrowView.multipleTouchEnabled = NO;
mSparrowView.frameRate = 30.0f;
[game release];
[mWindow makeKeyAndVisible];
[mSparrowView start];
SP_RELEASE_POOL(pool);
[self performSelector:@selector(requestAdWhirlView:) withObject:nil afterDelay:2.0];
}