views:

196

answers:

1

When I run my application I can see my iAd in the simulator, that is pre-filled with "Test Advertisement"

However, when I run the application on my device, the iAd area is blank, with no pre-filled ad.

Why is this?

My iAd is in a UITableViewCell:

#import "iAdCell.h"


@implementation iAdCell
@synthesize adView;

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if ((self = [super initWithStyle:style reuseIdentifier:reuseIdentifier])) {
        adView = [[ADBannerView alloc] initWithFrame:CGRectZero];
        adView.requiredContentSizeIdentifiers = [NSSet setWithObject:ADBannerContentSizeIdentifier320x50];
        adView.currentContentSizeIdentifier = ADBannerContentSizeIdentifier320x50;
        adView.delegate=self;
        [self.contentView addSubview:adView];
    }
    return self;
}


- (void)setSelected:(BOOL)selected animated:(BOOL)animated {

    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}


- (void)dealloc {
    [adView release];
    [super dealloc];
}


@end
+1  A: 

Edit after questioner added more information:

Apple will reject your application if an iAd is within a table cell. iAds are required to be in a static position on the page, and not in any kind of scroll view (this includes table views). This is because iAds pay by impression as well as by click, so having an iAd in a table view cell will cause it to be reloaded whenever it scrolls off and on screen again, which could be many times. This would seem like "click-fraud" or similar behaviour. Apple will not allow this.


Probably because your request is failing. Put a breakpoint or some logging into the failure delegate message that is sent when requests fail and you will be able to see if it is getting called.

iAd requests can fail for a number of reasons, including iAds not being available in your country, there not being enough inventory to fulfil a request, the ad has already been shown once this session, etc.

It's possible that is displays on the Simulator because the Simulator doesn't really have any concept of its location (eg, Maps always shows your location as Apple's HQ in Cupertino).

Jasarien