iAd не загружается на iPhone, но загружается на iPad после одобрения Apple

Я разработал приложение, которое недавно было одобрено Apple. Но проблема в том, что iAd не отображается в iphone, тогда как в ipad iAd отображается отлично. На момент разработки iAd загружается и работает с тестовой рекламой как в iPhone, так и в iPad. Но после одобрения от Apple я загрузил приложение из магазина и заметил, что 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];
    }
}
}

person Sumanth    schedule 18.05.2012    source источник


Ответы (1)


iAd в целом имеет довольно низкий уровень заполнения. Рекламные сети (включая iAd) отправляют вам больше объявлений, чем выше ваш рейтинг кликов; т. е. соотношение пользователей, которые нажимают на рекламу в вашем приложении, к рекламе, которую вы показываете в своем приложении. Если вы подтвердили, что тестовая реклама работает, и вы только что выпустили приложение, вполне возможно, что Apple требуется некоторое время, чтобы отправить вам рекламные файлы для сборки iPhone. Подожди пару дней и посмотри как пойдет.

С другой стороны, я замечаю ваш код «isUpgraded» — возможно ли, что на iPhone, на котором вы тестируете, вы купили обновление и забыли, и теперь реклама больше не возвращается?

person WendiKidd    schedule 19.05.2012
comment
если это так, код одинаков как для iphone, так и для ipad, но в ipad iad загружается довольно хорошо, но в iphone iad не загружается, также я видел в сети itunesconnect iad есть много запросов на iad, но очень меньше впечатлений слева, какое впечатление производит ipad, я думаю. Итак, не могли бы вы предложить мне, как избавиться от этой проблемы, или мне следует связаться с Apple по той же проблеме? - person Sumanth; 19.05.2012
comment
я не покупал приложение в магазине на iphone, некоторые функции заблокированы в приложении, заявляя, что это пробная версия. А на айпаде работает нормально - person Sumanth; 19.05.2012
comment
Если вы не вытащили живое приложение из магазина на iPhone, откуда вы знаете, что оно не работает? - person WendiKidd; 19.05.2012
comment
Это бесплатное приложение для загрузки и использования, чтобы получить полную версию, которую нам нужно приобрести, как при покупке приложения. iAds придет, если это облегченная версия означает бесплатное приложение. Если мы купим приложение с помощью In Application Purchase, iAd не придет. - person Sumanth; 21.05.2012