'iAd'에 해당되는 글 1

  1. 2010.07.10 [iPhone] iAd 붙여넣기
Interesting/iPhone | Posted by hyena0 2010. 7. 10. 20:40

[iPhone] iAd 붙여넣기


  iOS4가 나오면서 iAd 라는 광고시스템이 적용되게 되었습니다.

  아이폰 앱에 광고가 얼마나 수익을 얻을 수 있을지

  시험해 보기 위해 iAd를 붙여보기로 했습니다.

  최근에 iOS4 로 새로 빌드된 앱들이 많은지

  리뷰할때까지 거의 2주가 소요되더군요.

  결과는 보기좋게 "Reject" 되었답니다.

  그 이유는 아래와 같이 광고배너가 일시적으로 컨텐츠 없이 박스만 보이는 현상이 있는데
  이건 애플의 정책에 맞지 않는 다는 것입니다.





그러면 어떻게 해야 하면 아래와 같은 코드를 추가해야 합니다.

- (void)bannerViewDidLoadAd:(ADBannerView *)banner

{

    if (!self.bannerIsVisible)

    {

NSLog(@"bannerViewDidLoadAd -----");

        [UIView beginAnimations:@"animateAdBannerOn" context:NULL];

// assumes the banner view is offset 50 pixels so that it is not visible.

        banner.frame = CGRectOffset(banner.frame, 0, 50);//50

        [UIView commitAnimations];

        self.bannerIsVisible = YES;


    }

}


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

{//NSLog(@"didFailToReceiveAdWithError");

if (self.bannerIsVisible)

    {

NSLog(@"didFailToReceiveAdWithError");

        [UIView beginAnimations:@"animateAdBannerOff" context:NULL];

// assumes the banner view is at the top of the screen.

        banner.frame = CGRectOffset(banner.frame, 0, -50);//-50);

        [UIView commitAnimations];

        self.bannerIsVisible = NO;

    }

}


이렇게 하면 베너내부에 컨텐츠가 네트워크나 기타 여러사항으로 인해 지연될 경우, 
표시가 아예되지 않도록 합니다. 다시 연결되면 애니메이션 효과로 표시가 되도록 하는 것이지요.
  
일단 다시 등록했는데, 리뷰까지 얼마나 걸릴지 모르겠군요.
광고가 붙는게 승인나면 다음 업데이트까지 무료로 변경할 계획입니다.