0

we have an application built using cocos2d, the first class (scene) called from the app delegate is the levels class which then calls the game class (scene) according to user choice. where should i write my iAd code and how ? any help please.

4 Answers 4

0

My suggestion would be to look at AdWhirl, which would make your ads decoupled from the ad network.

More can be found below.

https://www.adwhirl.com/home/dev

0

My understanding is that you can not put UIViews directly into CCLayer, or CCScene (i hope those are the names), you will have to shrink your scene in order to put the iAd beside your Cocos2d view.

0

To implement iAd add the import

#import <iAd/ADBannerView.h>

If you initialize iAd in the AppDelegate, it will displayed everywhere. This is very easy to achieve.

ADBannerView* iAdView = [[ADBannerView alloc] initWithFrame:CGRectZero];
iAdView.currentContentSizeIdentifier = ADBannerContentSizeIdentifierLandscape;
[[[CCDirector sharedDirector] openGLView] addSubview:iAdView];

For more information, look at apples programming guide http://developer.apple.com/library/ios/#documentation/userexperience/conceptual/iAd_Guide/Introduction/Introduction.html

0

I recently wrote a post about this issue (integrating iAd in a Cocos2d-x game) in my blog. Take a look and ask me if you have any questions.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.