Condividi tramite


My Ad control is ad isn’t showing up

I was modifying an app that I built to add an Ad control.  I dropped the control in and initially it didn’t show up.  I figured this was because I didn’t have the size correct.  Add controls display ads with specific sizes and I had the control in a <Viewbox> so I thought that might be it.  I removed the <Viewbox> and it didn’t make a difference.  I didn’t really need the viewbox so that fine.  It occurred to me that up until this point the app had been standalone not having a need for an internet client connection.  Of course Ads need to pull down content to serve from the internet.  I opened the Package.AppManifest and in the capabilities tab I checked Internet Client.  I quick rerun of the app validate my belief this was issue as the ad control now proudly served content. 

I also wondered if I would need to ad a reference to the Advertising SDK, but when I added the ad control that was taken care of by Visual Studio (VS you rock!).  If you don’t see the ad control perhaps you haven’t added the Ad SDK.

 

I had already done the following:

Installed the Ad Center SDK https://adsinapps.microsoft.com

Created my Pub Center Account https://pubcenter.microsoft.com/ (recommended that you use your Microsoft Account)

So I went over to pub center and selected the Setup tab and registered a new app

Next I used setup to create an Application Ad Unit pick the right size ad for my app.

Next I plugged in my Application ID and Ad Unit ID into my apps ad control.

Ready to publish now!