TheBlueSky TheBlueSky - 1 year ago 78
C# Question

AdDuplex Ad Control keeps showing despite collapsing it

I’m creating a WinRT (Windows 8.1 and Windows Phone 8.1) app in which I placed an AdDuplex ad control in one of its pages.

The user of the app can choose to remove the ad (with an IAP). When they do, I set the

of the AdDuplex ad control to
, from the page ViewModel.

This part works fine; however, after some time, while the user is still on the page, AdDuplex ad control suddenly becomes visible again and starts showing ads.

At the beginning, I thought this is the behavior of IAP when using
, although it didn’t make sense to me, since I have nothing in the code that reacts to license changes and hence setting the control back to
. Yet, I tested
for my " NoAd” product and got
, indicating that the license is valid.

The following is a simplified part of my code:


AdUnitId="{StaticResource AdUnitId}"
AppKey="{StaticResource AdAppKey}"
Visibility="{Binding IsNoAdPurchased, Converter={StaticResource BooleanToVisibilityInvertedConverter}}"/>


private async void RemoveAd()
this.IsNoAdPurchased = await this.storeService.PurchaseProductAsync(Products.NoAd);


using StoreCurrentApp = Windows.ApplicationModel.Store.CurrentAppSimulator;
using StoreCurrentApp = Windows.ApplicationModel.Store.CurrentApp;

public sealed class StoreService
public async Task<bool> PurchaseProductAsync(string productId)
var purchase = await StoreCurrentApp.RequestProductPurchaseAsync(productId);
return purchase.Status == ProductPurchaseStatus.Succeeded || purchase.Status == ProductPurchaseStatus.AlreadyPurchased;
catch (Exception)
// The purchase did not complete because an error occurred.
return false;

Answer Source

This was an issue with AdDuplex Ad Control and was fixed in version

Note: don't forget to set IsTest to false to see the "production" behaviour.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download