Manikanta
Manikanta

Reputation: 223

Adding google ads to windows phone 8.1 apps

I developed a windows phone 8.1 app and I want to add Google ad mob adds to it. I followed the instructions in this link I added GoogleAds.dll to my Windows phone 8.1 references but in tools I dint find AdView control. I am using VS2013 express.

I tried through C# code too.

{
     AdView bannerAd = new AdView
      {
            Format = AdFormats.BANNER,
            AdUnitID = "MY_AD_UNIT_ID"
      };

          AdRequest adRequest = new AdRequest();
         _mygrid.Children.Add(bannerAd);
         bannerAd.LoadAd(adRequest);
    }

where _mygrid is a grid. can I add the Adview controller to Grid ?

When I try to build the solution I am getting following errors

Error 1 The type 'System.Windows.Controls.UserControl' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Windows, Version=2.0.6.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'. c:\users\makot\documents\visual studio 2013\Projects\WC\WC\MainPage.xaml.cs

Error 2 The best overloaded method match for 'Windows.UI.Xaml.Controls.UIElementCollection.Add(Windows.UI.Xaml.UIElement)' has some invalid arguments c:\users\makot\documents\visual studio 2013\Projects\WC\WC\MainPage.xaml.cs

Error 3 Argument 1: cannot convert from 'GoogleAds.AdView' to 'Windows.UI.Xaml.UIElement' c:\users\makot\documents\visual studio 2013\Projects\WC\WC\MainPage.xaml.cs

Upvotes: 3

Views: 1055

Answers (1)

Heshan
Heshan

Reputation: 985

Google Ad mob SDK currently supports Silverlight (WP8/WP8.1 Silverlight) only. Although you can reference the mentioned dll to a WP8.1 RT project, it doesn't work.

Upvotes: 2

Related Questions