iAd device rotation causes 'may be obscured' warning

Go To StackoverFlow.com

0

I have a portrait/portraitupsidedown only app in which I've implemented iAds - it all seems to work successfully, the page I've implemented it on is just an image view and a bunch of buttons so I have it set not to move when the ad moves above the main view, but if I rotate the device I get the banner may be obscured error.

I can only get the error once per session on the page, further rotations do not cause a repeat, but if i go to another page and back i can repeat the warning once more.

If I leave the app running for a while ads come and go depending on their availability without warnings - it doesn't seem as though there are ads on top of each other.

Is this likely a brief glitch occurring during rotation and is there some way I can diagnose further?

I have added [self.view bringSubviewToFront:theBannerView]; to the animation stage, but it makes no difference, not surprising really as it's in rotation that's the problem!

2012-04-05 21:38
by John


0

Try this:

- (void)changeBannerOrientation:(UIInterfaceOrientation)toOrientation
{

    if (UIInterfaceOrientationIsLandscape(toOrientation)) {
        self.bannerView.currentContentSizeIdentifier = ADBannerContentSizeIdentifierLandscape;
    }

else {
        self.bannerView.currentContentSizeIdentifier = ADBannerContentSizeIdentifierPortrait;
    }
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
        return YES;
}

- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
                            duration:(NSTimeInterval)duration
{

    if (bannerView) {
        [self changeBannerOrientation:toInterfaceOrientation];
    }
}
2012-06-20 15:55
by blacksoul


0

I have come across the same issue. During the screen orientation change the adview is not fully on the screen, hence the 'banner may be obscured'

To prevent the "error" you can remove or hide the adview before the rotate and add it back in after,

- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {
    [AFAddManager removeFromView];
}
- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation{
    [AFAddManager updateOrientation:self.interfaceOrientation];
    [AFAddManager addToView:self.view];
}

but this does not look so nice. You could replace the adview with a copied image to make it look like it was rotated.

Im going to leave my app with the warning message. I think as long as the add is visible for a set amount of time you get credit for the impression. As long as your app is not constantly being rotated its not an issue. Would be nice to have some confirmation.

2012-06-29 11:24
by Mark Cooper


0

I can confirm the phenomenon, I don't get the error on initial page load in either orientation, but I do get it on rotation.

I did try the hide trick to quieten the 'error', but to no avail. I think I should take that out, as Mark said, it looks ugly unless you go to a lot of effort.

I did some reading up on this and from Apples literature, it seems that new adverts won't be loaded if part of the ad is obscured, which kind of suggests that we get credit for each ad loaded, not for the total display time.

2012-08-08 09:09
by Gordon Dove
Ads