iAd出现在模拟器中,但不出现在设备上 [英] iAd appears in simulator but not on device

查看:135
本文介绍了iAd出现在模拟器中,但不出现在设备上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我运行我的应用程序时,我可以在模拟器中看到我的iAd,它预填充了测试广告。

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.

为什么是这样?

我的iAd位于UITableViewCell中:

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


推荐答案

在提问者添加更多信息后编辑:

Edit after questioner added more information:

如果iAd位于表格单元格内,Apple将拒绝您的申请。 iAds必须位于网页的静态位置,而不是任何类型的滚动视图(包括表视图)。这是因为iAd通过展示以及点击付费,因此在表格视图单元格中使用iAd会导致它在每次滚动和再次显示时重新加载,这可能会多次。这看起来像是点击欺诈或类似的行为。 Apple不允许这样做。

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请求可能会失败,请求失败。如果请求失败,则发送失败代理消息。有多种原因,包括您所在国家/地区无法使用iAd,没有足够的广告资源来完成请求,广告已在此会话后显示等。

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).

这篇关于iAd出现在模拟器中,但不出现在设备上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆