OC

Knowledge OS
登录 注册
全部话题 移民 创业 iOS Mac Objective-C Swift Android 招聘 求职

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

windgo
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确实看不到啊,这没什么啊

2楼 ·
coderonloft 回复于 2014年05月09日

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

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

3楼 ·
windgo 回复于 2014年05月09日

1楼 @tinyfool 要吐血啊......

4楼 ·
windgo 回复于 2014年05月09日

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

5楼 ·
windgo 回复于 2014年05月09日

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

6楼 ·
coderonloft 回复于 2014年05月09日

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

7楼 ·
tinyfool 回复于 2014年05月09日

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

8楼 ·
coderonloft 回复于 2014年05月09日

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

登录 或者 注册

相关新闻

AltStyle によって変換されたページ (->オリジナル) /