larsacus / LARSAdController

Lightweight ad mediation for iOS to properly manage multiple ad networks dynamically including iAd and Google ads.
http://theonlylars.com/blog/2013/01/10/stupid-easy-ads-with-larsadcontroller-3-dot-0/
MIT License
269 stars 60 forks source link

Landscape Ads Don't Appear with a Tab Bar Controller #15

Open malcolmmurdock opened 11 years ago

malcolmmurdock commented 11 years ago

Easy issue to reproduce:

1) Create a new Tabbed Application in XCode

2) Add LARSAdController and the necessary additional files (AdMob, frameworks, etc)

3) Add LAC code to your view controller:

[[LARSAdController sharedManager] addAdContainerToView:self.view withParentViewController:self];
[[LARSAdController sharedManager] setShouldHandleOrientationChanges:YES];
[[LARSAdController sharedManager] setGoogleAdPublisherId:@"pubID"];

4) Ads will display fine in Portrait Mode, but when you rotate to Landscape they fail to appear.

larsacus commented 11 years ago

Does it occur on a specific version of iOS, or is it multiple versions?

malcolmmurdock commented 11 years ago

Seems to occur with both iOS 4.0 and 5.0. Haven't tested on any versions earlier or later than that (currently developing for iOS 4.0+). I'm running XCode 4.2 on Snow Leopard.

Thanks!

larsacus commented 11 years ago

If possible, please checkout the latest code from the AdapterAbstraction beta branch and see if this issue still persists. This is the new 3.0 development branch I've been working on for awhile that supports way more functionality than what's on master right now.

jengo commented 11 years ago

I am having this issue with the AdapterAbstraction branch when the application only supports landscape mode. Installed the code as of today.

larsacus commented 11 years ago

Is the issue in the AdapterAbstraction branch still specifically with a view controller in a tab view controller, or is it just in landscape in general?

jengo commented 11 years ago

It is with UITableViewController in the AdapterAbstraction branch while in landscape only mode.

larsacus commented 11 years ago

If you could open up a new issue with some sample code, it would be of great help.

Fred10932 commented 11 years ago

I had the same issue (ads out of bounds in landscape) and adding the container view to the navigation controller instead of the view controller solved it: [[LARSAdController sharedManager] addAdContainerToViewInViewController:self.navigationController].

Try [[LARSAdController sharedManager] addAdContainerToViewInViewController:self.tabBarController]?

jengo commented 11 years ago

[[LARSAdController sharedManager] addAdContainerToViewInViewController:self.navigationController]

This worked for me when working inside a UITableViewController.