I am implementing the ADbanner view in appdelegate.mm file in cocos2d game. The ads are displaying perfectly but i would like to know where i can implement the iAd banner view delegates. I have added them to appdelegate.mm file but they do not get called.
This is the code to display the ads (they are displayed successfully)
iAdView = [[ADBannerView alloc] initWithFrame:CGRectZero];
iAdView.currentContentSizeIdentifier = ADBannerContentSizeIdentifierLandscape;
[[[CCDirector sharedDirector]view]addSubview:iAdView];
I now need to implement this
- (void)bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error
- (void)bannerViewDidLoadAd:(ADBannerView *)banner
I am not using UIViewController as i am using cocos2d(it has scenes)
Thanks in advance for any help.
You have to set the delegate of your ADBannerView to your appDelegate:
Hope this helps.