Integration with iAd

Integration with iAd
0.0 0



Does anyone have a sample project with iAd integration?


oops, waiting for the sample…


May be we should add this to the wish list !


Somebody has done it, and it seems it is easy to do it. Just add a subview. Only 3 lines added to achieve it.


Hello Team

no easy for not objective c programmer.

can someone tell me the right way ??

so i add a subview with the iad banner
#import <iAd/iAd.h>

the standard method - (BOOL)application:(UIApplication )applicationdidFinishLaunchingWithOptions**:launchOptions {
// Override point for customization after application launch.
// Add the view controller’s view to the window and display.
window = initWithFrame: bounds]];
EAGLView***glView =
pixelFormat: kEAGLColorFormatRGBA8
preserveBackbuffer: NO
sharegroup: nil
multiSampling: NO
numberOfSamples: 0 ];
// Use RootViewController manage EAGLView
viewController = initWithNibName:nil bundle:nil];
viewController.wantsFullScreenLayout = YES;
viewController.view =*glView;

// Set RootViewController to window
window.rootViewController = viewController;
[window makeKeyAndVisible];

[[UIApplication sharedApplication] setStatusBarHidden: YES];
//add glview as a subview

* [window addSubview:viewController.view];
[window makeKeyAndVisible];*
// what are the next step ?
//self.bannerView = [[ADBannerView alloc] initWithFrame:CGRectZero];

return YES;

doesnt work


Hello Team

no easy for not objective c programmer.
even with the good link it s still not easy…

Kind regards



the following code compile and run but i dont see my banner , any idea?

// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.

  • (void)viewDidLoad {
    [super viewDidLoad];

ADBannerView **bannerView;
CGRect contentFrame = self.view.bounds;
*bannerView = [[ADBannerView alloc] init];
*bannerView.currentContentSizeIdentifier = ADBannerContentSizeIdentifierPortrait;
CGRect bannerFrame =*bannerView.frame;

if (*bannerView.bannerLoaded) {
contentFrame.size.height -=*bannerView.frame.size.height;
bannerFrame.origin.y = contentFrame.size.height;
} else {
bannerFrame.origin.y = contentFrame.size.height;
self.view.frame = contentFrame;
[self.view layoutIfNeeded];
_bannerView.frame = bannerFrame;

[self.view addSubview:_bannerView];


kind regards



yes that was simple, i added the following line and everything is fine,

_bannerView.frame = CGRectMake(0.0, 0.0, *bannerView.frame.size.width,*bannerView.frame.size.height);

sure , a better looking in the APPLE documentation help a lot……everythings we need is there with alot of sample.

my solution is not optimal but working…
i will it up cleanup



I don’t suppose someone could post a tutorial for how to setup and use iAD with a cocos2d-x project.


Check out this link.
It works 100%
quiet easy it was.


You could also check the last tutorial I wrote in my blog: