Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do I get the iAD methods to get called
    primarykey
    data
    text
    <p>I am trying to display iADs into my cocos2d game scene. I am able to successfully display ads, but I want to be able to show the view controller on screen only when the ad is being displayed. </p> <p>So for this I tried to use the -(void) bannerViewDidLoadAd:(ADBannerView *)banner method which I believed would get called if I added it in my view controllers implementation. But it doesn't get called at all. Below is my code. </p> <p>Can you kindly let me know if I am doing anything wrong. Thanks :)</p> <p>BannerAd.h</p> <pre><code>@interface BannerAd: UIViewController &lt;ADBannerViewDelegate&gt; { id delegate; } @property (nonatomic, retain) ADBannerView *adView; -(id)init: (id) dele; -(void) removeAd; -(void) bannerViewDidLoadAd:(ADBannerView *)banner; @end </code></pre> <p>BannerAd.m</p> <pre><code>@implementation BannerAd @synthesize adView = adView_; -(id)init: (id) dele { if((self=[super init])) { NSLog(@"init called, delegate set"); delegate = dele; } return self; } - (void)viewDidLoad { [super viewDidLoad]; self.adView = [[ADBannerView alloc] initWithFrame:CGRectZero]; self.adView.currentContentSizeIdentifier = ADBannerContentSizeIdentifierPortrait; [self.view addSubview:self.adView]; } -(void) bannerViewDidLoadAd:(ADBannerView *)banner { NSLog(@"AD did load"); } </code></pre> <p>Inside my game scene(cocos2d scene) i call this:</p> <pre><code> BannerAd *bannerAdDetailView = [[BannerAd alloc] init]; [bannerAdDetailView init:self]; [[[CCDirector sharedDirector]view] addSubview:bannerAdDetailView.view]; [bannerAdDetailView.view setFrame:CGRectMake(0, 0, 320, 568)]; </code></pre> <p>Kindly let me know how i can make sure my app is notified when the ad gets loaded. </p> <p>Thanks!!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload