0

I'm using Google ads in our application. It worked fine up until their latest update of the library (libAdapteriAd).

Long story short, when it chooses iAds, we get a full screen ad that decides to rotate our views regardless of setting YES/NO to the shouldAutoRotate callback. It also doesn't rotate them back, and very often we end up with skewed views.

The best we have is to lock rotation, then unlock it, but because iAds overwrites our stuff, it ends up stuck in the sideways view, and we can't find a way to force the orientation callback again to "rotate" it, setting it back to normal.

I've created a separate view controller, hooked up its window to the app window instead of the view controller, and set the GADBannerViewDelegate to it instead of my app's controllers, and it still messes up.

iOS Guides say to do it like that, but I don't know if Google has some more overrides that are messing up the views or not following apple's docs under their structure.

Cœur
  • 37,241
  • 25
  • 195
  • 267
Stephen J
  • 2,367
  • 2
  • 25
  • 31
  • It's not crashing anymore, though we have to keep it retained all the time, never deallocating. We move the ad around after rotations, manually. I don't know why they're so buggy, I don't know why it's working vs crashing now, and we literally lock/unlock rotation abilities and set every frame manually now after it goes away. The valid answer so far appears to be submitting a bug report to google or apple, but I am unsure. Will sandbox this and tinker later to see what's responsible for its behavior – Stephen J Oct 29 '12 at 18:00

1 Answers1

0

What orientation are you trying to support? A mistake that's often made is that people try to support a certain orientation but set shouldAutorotate to NO. This means that on initial view controller launch your vc will not initialize in that orientation.

For example, if you want your app to only support landscape right, you'd have something along the lines of the following code:

- (NSUInteger)supportedInterfaceOrientations {
  return UIInterfaceOrientationMaskLandscapeRight;
}

- (BOOL)shouldAutorotate {
  return YES;
}

Of course this is on top of also having your UIInterfaceOrientation set in your Info.plist file.

RajPara
  • 2,281
  • 1
  • 16
  • 9
  • I'll check the supported flags in the app, it's already in the app store, featured, running around all the orientations. Although I did manage to "free" its initial display, we "lock" the rotation properly, but now the pointer says "I'm a custom class" instead of "I'm an ad" after clicking on it, nothing modifies it that I can see. At least the debugger stays – Stephen J Oct 21 '12 at 04:08