Question

I inserted the adBannerView in an iphone app. I follow the apple examples described on documentation. when App runs in debug mode the ads are shown correctly (Test version), but in the release version, when real users use the app I see a white box where it should be shown the banner.

Maybe I missed/forgot somehting or I made something wrong?

the view controller that shows the banner have an initBanner Method:

- (void) initBanner{

    ADBannerView *_bannerView = nil;

    if (!is2ShowBanner){
        _bannerView = nil;
        MyLogEvidence(@"%@ BANNER da Nascondere", [self.class description]);
        return;
    }

    MyLogEvidence(@"%@ BANNER da Visualizzare", [self.class description]);


    _bannerView = [[ADBannerView alloc] initWithAdType:ADAdTypeBanner];
    [_bannerView setDelegate:self];

    CGRect bounds = self.view.bounds ;
    CGRect frame = _bannerView.frame;
    frame.origin = CGPointMake(CGRectGetMinX(bounds),CGRectGetMaxY(bounds)- _bannerView.frame.size.height);

    [_bannerView setFrame:frame];

    [self.view  addSubview:_bannerView];
}

-(void)bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error{

    [self layoutForBanner:banner animated:YES ];
}


-(void)bannerViewDidLoadAd:(ADBannerView *)banner{

    [self layoutForBanner:banner animated:YES];
}

- (void)layoutForBanner:(ADBannerView*)_bannerView animated:(BOOL)animated

{

    if (_bannerView == nil){

        MyLog(@"BANNER non presente");

        [_constraintVerticalForBanner setConstant:3.0];
        [self.view layoutIfNeeded];
        [self.view updateConstraintsIfNeeded];

        return;
    }


    [_bannerView setHidden:!_bannerView.bannerLoaded];

    [_constraintVerticalForBanner setConstant:_bannerView.hidden? 3.0 : _bannerView.frame.size.height+3];

        [self.view layoutIfNeeded];

        [self.view updateConstraintsIfNeeded];

        MyLog(@"%@.constraintVerticalForBanner start: %3.0f",[self.class description],_constraintVerticalForBanner.constant);

}

-(BOOL)bannerViewActionShouldBegin:(ADBannerView *)banner willLeaveApplication:(BOOL)willLeave{

    return YES;

}

the call start from:

-(void)viewDidAppear:(BOOL)animated{

    [super viewDidAppear:animated];

    [self initBanner];

}
Was it helpful?

Solution

Well if it works when testing but not for real users then you probably made the common and painful mistake of not enabling iads under application management in your itunes connect.

Look here for how to enable the ads if you haven't done it already.

Why is it painful ? because you will have to change you application state to waiting for upload and your app will have to wait for another review. (After your uploaded a new binary)

Another reason might be that iads impressions rate is not so so from what I read and not every ad request from your app is replied with an impression so try to wait a few minutes until one is shown.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top