Warning Upgrading to new advertising sdk RRS feed

  • Question

  • If you have any apps using the old sdk that uses ads you will have to rewrite your ads.  For starters you MUST call AdGameComponent.Current.Draw() and AdGameComponent.Update(); If you are testing out your ads in the emulator without using the default test ad perameters the ads will not show. I have been working on this problem for far to long on my apps.
    Friday, May 4, 2012 12:14 AM

All replies

  • That just sounds like the Enabled and Visible properties of the component are set to false if you are having to manually call the Update and Draw.
    Friday, May 4, 2012 1:17 AM
  • They are set to true. I had ads working on my other games before the new sdk rolled out. Also the debugging class for your ads has its very own dll
    Friday, May 4, 2012 3:13 AM
  • Starting with your second point, you are correct--you can no longer receive "real" ads when running in the emulator, only test ads. If you attempt this, the ErrorOccurred event will fire with a message indicating as much. This change is documented in the What's New section:

    Regarding required code changes, the new SDK should be a drop-in replacement for any existing XNA apps with ads (no code change required, though you might need to add a reference to a dll as noted in the What's New page above). This release added support for ads in hybrid Silverlight/XNA solutions, and hybrid does require you to call Draw() and Update(). Ads in hybrid XNA was an unsupported scenario before the recent release. More information on integrating for hybrid is here:

    Note: you could use Update() and Draw() in pure XNA solutions if you choose not to register the AdGameComponent by calling Game.Components.Add. But this is not new and not a requirement.

    Rich Carr (Microsoft)
    Friday, May 4, 2012 5:46 PM
  • hybrid does require you to call Draw() and Update()
    The reason why is that hybrid apps do not have support for GameComponents, so you have to call Update() and Draw() yourself.
    Saturday, May 5, 2012 10:48 AM
  • wierd because my old code(ads) for my game didnt work anymore once i updated to the new sdk. before the sdk i didnt have to manually call the update and draw functions but now i do. Ill upload my old code when i get home from work.
    Sunday, May 6, 2012 5:06 PM
  • DrawableAd bannerAd; 
    protected override void Initialize() 
      //Im hiding my number stuff with "temp" 
    protected void LoadAd() 
      //remember i am hiding my numbers with temp.    
      bannerAd = AdGameComponent.Current.CreateAd("temp"new Rectangle(160, 400, 480, 80), true); 
      AdGameComponent.Current.Enabled = true
      AdGameComponent.Current.Visible = true

    Monday, May 7, 2012 5:15 PM
  • this code did not bring up the ad automatically when i loaded up the new sdk. In order for my to see my ads i had to specifically call the AdGameComponent.Current.Update() and AdGameComponent.Current.Draw();
    Monday, May 7, 2012 5:18 PM