Git Product home page Git Product logo

Comments (10)

larsacus avatar larsacus commented on August 29, 2024

The code path looks correct and the root view controller is getting set properly on the google ads when it is getting created. The only thing I can think of is that the reference to the root view controller in all contexts is a weak reference. This means that if the view controller that the ads are currently hosted in gets deallocated by the system and cleaned up, this warning could result.

As of now, I can find nothing wrong with the code-path relating to setting the root view controller.

from larsadcontroller.

larsacus avatar larsacus commented on August 29, 2024

After looking at this further, it looks like this may have been possible when adding an ad to a new view controller. Check out commit e7ff542 to see if this resolves the issue.

from larsadcontroller.

walsht avatar walsht commented on August 29, 2024

Still getting the warning. The problem is that it never recovers and shows a ad.

I am only showing Google Ads, may have something to do with it? Or, it looks like I am only getting this in the ipad simulator.

Thanks.

Here are the logs:
2013-01-29 05:43:20.734 MyApp[57559:c07] -[AppDelegate application:didFinishLaunchingWithOptions:] line 25 $
2013-01-29 05:43:20.943 MyApp[57559:c07] LARSAdController [line 184]: View is portrait
2013-01-29 05:43:20.944 MyApp[57559:c07] LARSAdController [line 207]: Container frame: {{0, 914}, {768, 90}}
2013-01-29 05:43:20.944 MyApp[57559:c07] LARSAdController [line 520]: Creating new instance of adapter class "TOLAdAdapterGoogleAds"
2013-01-29 05:43:20.974 MyApp[57559:c07] LARSAdController [line 560]: Successfully created instance of "TOLAdAdapterGoogleAds"
2013-01-29 05:43:20.974 MyApp[57559:c07] LARSAdController [line 471]: Initial banner frame : {{0, 90}, {768, 90}}
2013-01-29 05:43:20.975 MyApp[57559:c07] LARSAdController [line 496]: Final banner frame : {{0, 0}, {768, 90}}
2013-01-29 05:43:20.975 MyApp[57559:c07] LARSAdController [line 701]: Registering for orientation notifications
2013-01-29 05:43:20.976 MyApp[57559:c07] LARSAdController [line 184]: View is portrait
2013-01-29 05:43:21.012 MyApp[57559:c07] LARSAdController [line 207]: Container frame: {{0, 914}, {768, 90}}
2013-01-29 05:43:21.013 MyApp[57559:c07] LARSAdController [line 496]: Final banner frame : {{0, 0}, {768, 90}}
2013-01-29 05:43:21.026 MyApp[57559:c07] LARSAdController [line 727]: Handling orientation change
2013-01-29 05:43:21.137 MyApp[57559:c07] LARSAdController [line 727]: Handling orientation change
2013-01-29 05:43:21.138 MyApp[57559:c07] LARSAdController [line 184]: View is portrait
2013-01-29 05:43:21.138 MyApp[57559:c07] LARSAdController [line 207]: Container frame: {{0, 914}, {768, 90}}
2013-01-29 05:43:21.139 MyApp[57559:c07] LARSAdController [line 496]: Final banner frame : {{0, 0}, {768, 90}}
2013-01-29 05:43:21.139 MyApp[57559:c07] LARSAdController [line 184]: View is portrait
2013-01-29 05:43:21.139 MyApp[57559:c07] LARSAdController [line 207]: Container frame: {{0, 914}, {768, 90}}
2013-01-29 05:43:21.140 MyApp[57559:c07] LARSAdController [line 496]: Final banner frame : {{0, 0}, {768, 90}}
2013-01-29 05:43:22.460 MyApp[57559:c07] LARSAdController [line 727]: Handling orientation change
2013-01-29 05:43:22.469 MyApp[57559:c07] LARSAdController [line 175]: View is landscape
2013-01-29 05:43:22.469 MyApp[57559:c07] LARSAdController [line 207]: Container frame: {{0, 658}, {1024, 90}}
2013-01-29 05:43:22.480 MyApp[57559:c07] LARSAdController [line 496]: Final banner frame : {{0, 0}, {1024, 90}}
2013-01-29 05:43:24.305 MyApp[57559:c07] Must set the rootViewController property of GADBannerView before calling loadRequest:

from larsadcontroller.

larsacus avatar larsacus commented on August 29, 2024

Are you changing view controllers when this happens? It looks like you're changing orientations, does this always happen only when you change orientations? If you could do some debugging and find out exactly if the parentViewController property is actually nil, or is simply never getting assigned to the bannerView.

from larsadcontroller.

walsht avatar walsht commented on August 29, 2024

Just doing some testing on the AdMob banner example and found that it looks like it has to do with
[self.bannerView setNeedsLayout];

If I call this before
[_bannerView loadRequest:request];

It is fine, but after it gives me the warning.

Hope this helps.

from larsadcontroller.

larsacus avatar larsacus commented on August 29, 2024

The admob banner example as in the vanilla Google AdMob example code from Google's site? Or my sample project?

There is absolutely no reason why setNeedsLayout would affect the rootViewController's property unless it's a bug within Google's framework.

from larsadcontroller.

walsht avatar walsht commented on August 29, 2024

I was testing using the Google AdMob example code, when I mess with the setNeedsLayout I was getting the issue. Looks like your code is working fine on the devices, just a simulator issue.

I have decided to build my own add display. If you could add the ability to have iAd display if successful over Admob, I may add that into future projects. I just get better revenue from iAD if it is available.

Thanks,
TIm

from larsadcontroller.

larsacus avatar larsacus commented on August 29, 2024

The framework as it is will support whatever ad network priority you would like to define. If you would like to have iAd always display first, then simply register the ad adapters in this order:

[[LARSAdController sharedManager] registerAdapterClass:[TOLAdAdapteriAds class]];
[[LARSAdController sharedManager] registerAdapterClass:[TOLAdAdapterGoogleAds class]];

This tells the ad controller that you always want iAds to display when they are available and to display AdMob ads when there are no iAds. It will fill the gaps in depending on what priority you register them in.

from larsadcontroller.

walsht avatar walsht commented on August 29, 2024

I see, and didn't know that. Few other things that would be helpful:

  • Ability to close the ad without killing it
  • Launch a view to in app purchases to remove the ads
  • Does this work with UITableView's? Maybe have it as a container like the iAds sample code.

Thanks,
Tim

from larsadcontroller.

larsacus avatar larsacus commented on August 29, 2024

I'd be happy to entertain a pull request with this functionality added.

from larsadcontroller.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.