Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

iad disappears after a while - just me?

I have iad s working in my app, it's in the app store and all seems ok with it. One strange thing I just noticed with it is that after a few minutes of program use the ads seem to disappear and never return.

The only way to get the ads back is to force the app to close and reopen it - something I'm sure my users aren't doing.

Has anyone else experienced this?

My app is pretty simple: it has 3 tabs and an iad at the top of each window then a tableview on the rest of the window. The two views do not overlap. Also I have since noticed that this ad hiding behavior is present in the test ads as well, which is good so I should be able to test any fixes.

Any help or thoughts are much appreciated. Thanks!

— asked August 29th 2010 by Steve Perlow
  • iad
  • iphone
  • os4
0 Comments

6 Answers

  • Just to follow up. I am definitely seeing this happen. With the following code the test iAd will load.. and load another and another (every 20 secs or so) and then after a while it disappears (normal testing behaviour I believe)… But on the next attempted load this error on screen:

    2011-03-07 21:55:44.013 APP NAME[26588:207] ADBannerView: WARNING A 
    banner view (0x69418f0) has an ad but may be obscured. This message is only 
    printed once per banner view.
    

    here is my code:

    var adwin = Titanium.UI.createWindow({
            width:320,
            height:50,
            top:44,
            left:0,
            backgroundImage:"images/upgrade.png"
        });
    
        var iads = Ti.UI.iOS.createAdView({
            width: 'auto',
            height: 'auto',
            top:-50,
            height:50
        }); 
    
        t1 = Titanium.UI.createAnimation({top:0, duration:750}); 
    
        iads.addEventListener('load', function(){
            Ti.API.info("LOADED");
        });
    
        iads.addEventListener('error', function(){
            Ti.API.info("ERROR LOADING iAd");
        }); 
    
        adwin.add(iads);
        adwin.open();
    

    And my full output window:

    [INFO] LOADED
    [INFO] LOADED
    [INFO] LOADED
    [INFO] LOADED
    [INFO] LOADED
    [INFO] LOADED
    [INFO] LOADED
    [INFO] ERROR LOADING iAd
    [INFO] LOADED
    2011-03-07 21:55:44.013 App Name [26588:207] ADBannerView: WARNING 
    A banner view (0x69418f0) has an ad but may be obscured. This 
    message is only printed once per banner view.
    

    And it never loads anything again after this.

    Anyone have any ideas why this is happening? I'd hate for the app to fail to reload the next successful banner fill. With the apps going to paused state when the user hits the home button, they will never restart the app and never see the ads again.

    — answered March 8th 2011 by Dave F
    permalink
    3 Comments
    • I'm also seeing this behavior. (Ti SDK 1.6.1 & iPhone SDK 4.3)
      I have 4 tabs in a tabgroup. I create the iad at the app start and add it to each window before adding it to the tab.

      The iad will appear in each tab, but then may disappear from a tab and not reappear.

      I tried checking the visible property of the iad in the focus event for each window, but it comes back undefined. UNLESS the first iad event is an error and it reports that the view visibility is false. (Which is somewhat good since I do not show the ad until the load event.)

      — commented April 7th 2011 by Bart McPherson
    • Any luck with this, I'm having a similar issue (found this thread after posting my own).

      — commented April 20th 2011 by Frank A
    • Try setting iads.visible = true in your load listener.

      — commented April 28th 2011 by Charles Daniel
  • That's part of requirement from Apple. When No Ad, hide it. 100% Normal.

    — answered August 29th 2010 by Daniel Lim
    permalink
    0 Comments
  • I don't know if it's any use for you guys any more but I dug through the iPhone code TiUIiOSAdView.m and they seem to do a visible=NO for the banner when they receive a didFailToReceiveAdWithError() call but I'm not seeing it ever bringing it back from invisible on successful loads. So I did this (as per your example above)

        iads.addEventListener('load', function(){
            Ti.API.info("LOADED");
            iads.visible = true;        // Force the AdView to be visible again when we get a load message
        });
    

    Well something to that effect atleast (I haven't tried the code above explicitly but I think it should work).
    Hope it helps.

    — answered April 28th 2011 by Charles Daniel
    permalink
    1 Comment
    • This is EXACTLY the fix I was looking for. I'd call the need to do this a bug in Titanium, does anyone know if it's been reported?

      Thanks,

      Peter Janett

      — commented August 8th 2011 by Peter janett
  • Thanks Daniel - I was kind of hoping you'd respond after seeing your other post on iad.

    It does seem strange though that the ads disappear and never again shows up. Then if I close (not suspend) the app and reload it, all the ads populate.

    If I just leave the app as is and use it, after they go away, they will never repopulate.

    It's that part that seems strange to me. It's not acting like an ad inventory issue.

    I don't know. You certainly could be correct, and maybe that is most likely. It's just strange to think that's the expected behavior - to have days go by and the ads never reload.

    My best solution so far (still testing) is to disable the app suspend and have it reopen each time. Not ideal, but for this particular app, not the end of the world.

    — answered August 29th 2010 by Steve Perlow
    permalink
    0 Comments
  • I realize this is an old thread, but I see the same thing occurring. I am testing iAds in my app. Similar set up. 4 tab app. An iAd window at the top and a table view below.

    On first load. a test ad may or may not show up. If it doesnt' it NEVER shows up later on while the app is open. If I go to home screen and return to the app, still no ad no matter what.

    if the test iAd does show up. It may fade out and come back or it sometimes never comes back.

    If I go to a different tab, that tabs test iAd may or may not load. If it doesn't, it NEVER will appear. If I go back to that other tab. I'd hope a focus of some sort would maybe load the ad that was not there. but it doesn't.

    the only way to maybe get them back is to force quit the app and reload it again. And even then they don't always show up

    Anyone else experiencing this?

    fish

    — answered March 6th 2011 by Dave F
    permalink
    0 Comments
  • This is the normal iAd behavior…

    But one thing I really would love to know: Is there a way to set a fallback image? We want to promote our paid App if no Ad is loaded.

    — answered May 29th 2011 by Florian Bergmann
    permalink
    1 Comment
    • Put a view with your image in it below the adview!

      — commented February 8th 2012 by Kristof Gruber
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.