Sean Ryan Sean Ryan - 1 month ago 26
C# Question

UWP Store Services SDK Advertising

So a few months ago my UWP app was successfully displaying test banner ads with AdMediator and Advertising SDK for XAML.
Then MSFT went ahead and wrapped Advertising up into the Store Services SDK and even though I followed the setup instructions and can successfully build, ad's never show up. Anyone?

The frame shows in the XAML file the ad does not get filled however, I have not changed anything on the Microsoft Developer Portal from when things worked. My control tag is:

<Universal:AdControl Name="XXXXXX" ApplicationId="XXXXXXXXXXXXX" AdUnitId="XXXXXXXX" HorizontalAlignment="Center" Width="{Binding ElementName=gridMain, Path=ActualWidth}" Margin="0,265,0,5" />


I have the advertising namespace at the top of the XAML file:

xmlns:Universal="using:Microsoft.Advertising.WinRT.UI"

Answer

Since you're using Universal:AdControl, then you want to create a banner ad, banner ad must have a fixed size, you can refer to the supported banner ad size .

By the way, ActualWidth property is not a dependency property, it cannot be used for data binding. So it could be the problem that you didn't actually give the Universal:AdControl any size. Please try to set the size of this control to 300x250 and see if it works. If not, please provide more details for this issue and leave a comment.