Thursday, December 20, 2012

Windows Phone Test Ad not displaying on VS2012

Windows Phone Test Ad not displaying on VS2012

I'm trying to display a Test Ad on my app running the emulator and on device, it only displays a black space with no test ad image, am I missing something? Does my XAML.CS file need any code? It seems previous information found on Google is deprecated from this VS version...

EDIT:Dragging and dropping the AdControl from the toolbox onto a simple app template shows the Test Ad image when loading the emulator but it doesn't when placing it on an HTML5 VS2012 template... limitation?

Here's my XAML:

    <Grid x:Name="LayoutRoot" Grid.Row="1" Background="Transparent">          <Grid x:Name="Grid1">          <phone:WebBrowser x:Name="Browser"                       Loaded="Browser_Loaded"                       NavigationFailed="Browser_NavigationFailed" Margin="0,0,0,80" />     </Grid>     <Grid x:Name="Grid2">         <UI:AdControl ApplicationId="test_add" Foreground="White" AdUnitId="Image480_80" Height="80" Margin="0,616,0,0" Width="480"/>     </Grid>   </Grid> 

Answers & Comments...

Answer: 1

According to the documentation you need to change your ApplicationId:

Live ads are not available in the emulator. You must use test values for the ApplicationId and AdUnitId when running in the emulator. To verify live ads, you will have to run the app on a device. If the ApplicationId is NOT set to the value test_client when the app is running in the emulator, the app will throw an error. The error message will tell you that "you cannot use pubCenter IDs for testing from the emulator. If you want to test with these IDs, please deploy your application to a device. Otherwise, please change your ApplicationId to test_client, and AdUnitId to one of the supported ad types as outlined in the documentation."

That said, I can't seem to get the test image to show up in the designer in Blend or VS 2012 for a Windows Phone 8 project. However, it does seem to work in Windows Phone 7 projects (which reference a different dll).

Do you need to see the image in order to develop your app? You should just assume that it will work and then test it by deploying it to a test phone to make sure you get ads.

by : Bryanthttp://stackoverflow.com/users/10893




No comments:

Post a Comment

Send us your comment related to the topic mentioned on the blog