1

最近アップルから承認されたアプリケーションを開発しました。しかし、問題は、iadがiphoneに表示されないのに対し、ipadiAdは完全に表示されることです。開発時に、iAdがロードされ、iPhoneとiPadの両方でテストアドバタイズメントと連動します。しかし、アップルからの承認後、ストアからアプリケーションをダウンロードしましたが、iAdがiphoneにロードされていないのに、ipadにロードされていることに気付きました。他のアプリケーションでiphoneの他のアプリケーションを確認しました。iAdは正常に動作していますが、私のアプリケーションではiAdがロードされていません。では、iAdをiphoneにロードするにはどうすればよいですか。

アプリケーションで使用したコードは

-(void)showiAdInView
{
if (!appDelegate.isUpgraded) {
    bannerView = [[ADBannerView alloc] init];
    bannerView.delegate = self;
    bannerView.backgroundColor = [UIColor colorWithWhite:1.0f alpha:0.005f];
    bannerView.hidden = TRUE;
    bannerIsVisible = FALSE;
    [self.view addSubview:bannerView];
}
}
-(void)bannerViewDidLoadAd:(ADBannerView *)banner
{
bannerIsVisible = YES;
bannerView.hidden = FALSE;
NSLog(@"ADBanner is Showing");
[self bannerViewShow];
}
-(void)bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error
{
bannerIsVisible = FALSE;
bannerView.hidden = TRUE;
NSLog(@"ADBanner is Hidding");
NSLog(@"%@",[error description]);
[self bannerViewHide];
}

-(BOOL)bannerViewActionShouldBegin:(ADBannerView *)banner willLeaveApplication:  (BOOL)willLeave
{
if ([self.captureSession isRunning]) {
    [self.captureSession stopRunning];
    iAdLoaded = TRUE;
}
return YES;
}
-(void)bannerViewActionDidFinish:(ADBannerView *)banner
{
UIInterfaceOrientation interfaceOrientation = [[UIApplication sharedApplication] statusBarOrientation];
[self willRotateToInterfaceOrientation:interfaceOrientation duration:0.2f];
if (![self.captureSession isRunning] && iAdLoaded) {
    [self.captureSession startRunning];
    iAdLoaded = FALSE;
}
}
-(void)bannerViewShow
{
[bannerView setBackgroundColor:[UIColor colorWithWhite:1.0f alpha:0.005f]];
UIInterfaceOrientation interfaceOrientation = [[UIApplication sharedApplication] statusBarOrientation];
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) 
{
    if (UIInterfaceOrientationIsPortrait(interfaceOrientation)) {
        [UIView beginAnimations:nil context:nil];
        [UIView setAnimationDelegate:self];
        [UIView setAnimationDuration:0.5];
        [MsgtextView setFrame:MsgTextVwAdBannerFrame];
        [UIView commitAnimations];
        adBannerFrame = CGRectMake(0, 190, 320, 50);
        clearButton.frame = CGRectMake(ClearButtonFramePotrait.origin.x, ClearButtonFramePotrait.origin.y, ClearButtonFramePotrait.size.width, ClearButtonFramePotrait.size.height);
        [self.view bringSubviewToFront:bannerView];
        [bannerView setFrame:adBannerFrame];
        [bannerView setCurrentContentSizeIdentifier:ADBannerContentSizeIdentifierPortrait];

    }
    else if (UIInterfaceOrientationIsLandscape(interfaceOrientation)) {
        [UIView beginAnimations:nil context:nil];
        [UIView setAnimationDelegate:self];
        [UIView setAnimationDuration:0.5];
        [MsgtextView setFrame:CGRectMake(MsgTextVwAdBannerFrame.origin.x, MsgTextVwAdBannerFrame.origin.y, MsgTextVwAdBannerFrame.size.width, MsgTextVwAdBannerFrame.size.height+8)];
        [UIView commitAnimations];
        adBannerFrame = CGRectMake(0, 105, 470, 32);
        clearButton.frame = CGRectMake(ClearButtonFrameLandscape.origin.x, ClearButtonFrameLandscape.origin.y, ClearButtonFrameLandscape.size.width, ClearButtonFrameLandscape.size.height);
        [bannerView setCurrentContentSizeIdentifier:ADBannerContentSizeIdentifierLandscape];
        [self.view bringSubviewToFront:bannerView];
        [bannerView setFrame:adBannerFrame];

    }
}
else if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
    if (UIInterfaceOrientationIsPortrait(interfaceOrientation)) {
        [UIView beginAnimations:nil context:nil];
        [UIView setAnimationDelegate:self];
        [UIView setAnimationDuration:0.5];
        [MsgtextView setFrame:MsgTextVwAdBannerFrame];
        [UIView commitAnimations];
        adBannerFrame = CGRectMake(0, 640, 768, 50);
        [bannerView setCurrentContentSizeIdentifier:ADBannerContentSizeIdentifierPortrait];
        clearButton.frame = CGRectMake(ClearButtonFrame_iPadPotrait.origin.x, ClearButtonFrame_iPadPotrait.origin.y, ClearButtonFrame_iPadPotrait.size.width, ClearButtonFrame_iPadPotrait.size.height);
        [self.view bringSubviewToFront:bannerView];
        [bannerView setFrame:adBannerFrame];
    }
    else if (UIInterfaceOrientationIsLandscape(interfaceOrientation)) {
        [UIView beginAnimations:nil context:nil];
        [UIView setAnimationDelegate:self];
        [UIView setAnimationDuration:0.5];
        [MsgtextView setFrame:CGRectMake(MsgTextVwAdBannerFrame.origin.x, MsgTextVwAdBannerFrame.origin.y, MsgTextVwAdBannerFrame.size.width, MsgTextVwAdBannerFrame.size.height+8)];
        [UIView commitAnimations];
        adBannerFrame = CGRectMake(0, 325, 1024, 32);
        [bannerView setCurrentContentSizeIdentifier:ADBannerContentSizeIdentifierLandscape];
        clearButton.frame = CGRectMake(ClearButtonFrame_iPadPotrait.origin.x, ClearButtonFrame_iPadPotrait.origin.y, ClearButtonFrame_iPadPotrait.size.width, ClearButtonFrame_iPadPotrait.size.height);
        [self.view bringSubviewToFront:bannerView];
        [bannerView setFrame:adBannerFrame];
    }
}
}
-(void)bannerViewHide
{
[bannerView setBackgroundColor:[UIColor clearColor]];
UIInterfaceOrientation interfaceOrientation = [[UIApplication sharedApplication] statusBarOrientation];
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) 
{
    if (UIInterfaceOrientationIsPortrait(interfaceOrientation)) {
        [UIView beginAnimations:nil context:nil];
        [UIView setAnimationDelegate:self];
        [UIView setAnimationDuration:0.5];
        [MsgtextView setFrame:MsgTextVwFrame];
        clearButton.frame = ClearButtonFramePotrait;
        [bannerView setHidden:YES];
        [UIView commitAnimations];
    }
    else if (UIInterfaceOrientationIsLandscape(interfaceOrientation)) {
        [UIView beginAnimations:nil context:nil];
        [UIView setAnimationDelegate:self];
        [UIView setAnimationDuration:0.5];
        [MsgtextView setFrame:MsgTextVwFrame];
        clearButton.frame = ClearButtonFrameLandscape;
        [bannerView setHidden:YES];
        [UIView commitAnimations];
    }
}
else if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
    if (UIInterfaceOrientationIsPortrait(interfaceOrientation)) {
        [UIView beginAnimations:nil context:nil];
        [UIView setAnimationDelegate:self];
        [UIView setAnimationDuration:0.5];
        [MsgtextView setFrame:MsgTextVwFrame];
        clearButton.frame = ClearButtonFrame_iPadPotrait;
        [bannerView setHidden:YES];
        [UIView commitAnimations];
    }
    else if (UIInterfaceOrientationIsLandscape(interfaceOrientation)) {
        [UIView beginAnimations:nil context:nil];
        [UIView setAnimationDelegate:self];
        [UIView setAnimationDuration:0.5];
        [MsgtextView setFrame:MsgTextVwFrame];
        clearButton.frame = ClearButtonFrame_iPadPotrait;
        [bannerView setHidden:YES];
        [UIView commitAnimations];
    }
}
}
4

1 に答える 1

3

全体として、iAdの充填率はかなり低くなっています。広告ネットワーク(iAdを含む)は、クリック率が高いほど、より多くの広告を送信します。つまり、アプリで広告をクリックしたユーザーの比率:アプリに表示する広告。テスト広告が機能していることを確認し、アプリをリリースしたばかりの場合は、AppleがiPhoneビルドで広告ファイルを送信するのに少し時間がかかる可能性があります。数日待って、どうなるか見てみましょう。

または、「isUpgraded」コードに気づきました。テストしているiPhoneで、アップグレードを購入して忘れてしまい、広告が表示されなくなった可能性はありますか?

于 2012-05-19T02:14:02.853 に答える