@javy,
I tried you code. But, I am getting errors like
Expected specifier-qualifier-list before 'MMABannerXLAdView'
'bannerAdView' undeclared (first use in this function)
Which .h file should I import ?
Thank You.
A fast, easy to use, free, and community supported 2D game engine
I was having the same problem, but i just found a way of making it work.
The ad view needs a UIViewController inorder to work correctly. like this
self.adView = [[[MobclixAdViewiPhone_300x50 alloc] initWithFrame:CGRectMake(10.0f, 10.0f, 300.0f, 50.0f)] autorelease];
UIViewController *controller = [UIViewController new];
[controller.view addSubview:adView];
[[[[CCDirector sharedDirector] openGLView] window] addSubview: controller.view];
Hope that helps
Hmm, using Phlipee's code I can get the ads to show and able to click them. But i can no longer effect the cocos2D app underneath...
Has anyone got this fully working?
Could someones explain why this line :
UIViewController *controller = [UIViewController new];
from Phlipee's snippet's fixes the problems ? It looks a bit strange to me, but well... it works for me. I have tried several other solutions and either the game or the ads don't process the touches correctly.
Edit: before, I was using Admob without a ViewController and it worked perfectly.
Thanks vanillasky65, makes sense.
However, I don't understand why:
[UIViewController new];
works and :
[[UIViewController alloc] init];
doesn't.
I have managed to get mobclix working in a cocos2d application. The only problem now is that like ddeaco said I cannot interact with the game. On my menu screen the advert appears and it can be clicked but none of the options on the menu work.
Anyone know what is wrong?
I managed to get the touches working by replacing this line of code philipee put
[[[[CCDirector sharedDirector] openGLView] window] addSubview: controller.view];
with this
[[[CCDirector sharedDirector] openGLView] addSubview: controller.view];
Hope this helps anyone.
Hope this helps anyone.
Thanks it did!
You must log in to post.