应用上架后看不到广告 哪位大侠知道怎么回事?

windgo 发布于 2014年05月09日 | 更新于 2014年05月09日
无人欣赏。

在本机调试可以看到广告条,发布到商店上之后,就看不到了……

代码如下:

#pragma mark 广告的实现

- (instancetype)init
{
    self = [super init];
    if (self) {
       ...

        Class classAdBannerView = NSClassFromString(@"ADBannerView");
        if (classAdBannerView != nil)
        {
            if ([ADBannerView instancesRespondToSelector:@selector(initWithAdType:)]) {
                _adView = [[ADBannerView alloc] initWithAdType:ADAdTypeBanner];

            } else {
                _adView = [[ADBannerView alloc] init];
            }
            //_adView.requiredContentSizeIdentifiers = [NSSet setWithObject:ADBannerContentSizeIdentifierPortrait];
            //_adView.currentContentSizeIdentifier = ADBannerContentSizeIdentifierPortrait;
            [_adView setAutoresizingMask:UIViewAutoresizingFlexibleWidth];
            [[[CCDirector sharedDirector]view]addSubview:_adView];
            [_adView setBackgroundColor:[UIColor clearColor]];
            [[[CCDirector sharedDirector]view]addSubview:_adView];
            _adView.delegate = self;
            [self layoutAnimated:YES];
        }
    }
    return self;
}


- (void)layoutAnimated:(BOOL)animated
{
    // As of iOS 6.0, the banner will automatically resize itself based on its width.
    // To support iOS 5.0 however, we continue to set the currentContentSizeIdentifier appropriately.
    CGRect contentFrame = [CCDirector sharedDirector].view.bounds;
    if (contentFrame.size.width < contentFrame.size.height) {
        _adView.currentContentSizeIdentifier = ADBannerContentSizeIdentifierPortrait;

    } else {
        _adView.currentContentSizeIdentifier = ADBannerContentSizeIdentifierLandscape;
            }

    CGRect bannerFrame = _adView.frame;
    if (_adView.bannerLoaded) {
        contentFrame.size.height -= _adView.frame.size.height;
        bannerFrame.origin.y = 0;
    } else {
        bannerFrame.origin.y = 0;
    }

    [UIView animateWithDuration:animated ? 0.25 : 0.0 animations:^{
        _adView.frame = bannerFrame;
    }];
}

- (void)bannerViewDidLoadAd:(ADBannerView *)banner {
    [self layoutAnimated:YES];
}

- (void)bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error {
    [self layoutAnimated:YES];
}
共8条回复
tinyfool 回复于 2014年05月09日

国内ip确实看不到啊,这没什么啊

coderonloft 回复于 2014年05月09日

1、苹果iAd投放地区就那么几个,中国区不在iAd投放范围内。

2、申请苹果iAd广告有内部审核流程,一般在app通过审核后再4-7天才会有广告填充

windgo 回复于 2014年05月09日

1楼 @tinyfool 要吐血啊……

windgo 回复于 2014年05月09日

我是不是应该把广告删了,直接改成收费应用……

windgo 回复于 2014年05月09日

ourcoders就是牛啊,这个问题我在cocoachina上问了,还没回复……

coderonloft 回复于 2014年05月09日

5楼 @windgo 收费、IAP或者谷歌广告。

tinyfool 回复于 2014年05月09日

4楼 @windgo 看你的客户在哪里了,要是都在国外的话,iAd还是可以赚钱的

coderonloft 回复于 2014年05月09日

7楼 @tinyfool iAd比谷歌广告好,无论是用户体验还是收入。缺憾就是覆盖区域受限。

登录 或者 注册
相关帖子