AdMediator allows specify 0 weight (backup mode) for House Ads, in which case (as far as I understand it), house ads appear only if other ads are unavailable. In my place it happens so often, that it really makes sence to see something instead of blank spot.
I wanted to implement the idea using Microsoft AdMeditor from Store Services SDK. This is how I was going to do that:
using MsAdControl = Microsoft.Advertising.WinRT.UI.AdControl;
......
private MsAdControl createMicrosoftAdControl() {
MsAdControl msAdControl = new MsAdControl();
msAdControl.AdRefreshed += OnMsAdRefreshed;
msAdControl.ErrorOccurred += OnMsBannerError;
msAdControl.ApplicationId = msBannerAppId;
msAdControl.AdUnitId = msBannerUintId;
msAdControl.AutoRefreshIntervalInSeconds = 30;
msAdControl.IsAutoRefreshEnabled = true;
......
return msAdControl;
}
// Callbacks
private void OnMsAdRefreshed(object sender, RoutedEventArgs e) {
var adControl = (MsAdControl)sender;
adControl.AdUnitId = msBannerUintId; // Revert to other ads
.......
}
private void OnMsBannerError(object sender, AdErrorEventArgs e) {
var adControl = (MsAdControl)sender;
if (adControl.AdUnitId != msBannerUintId)
adControl.AdUnitId = msBannerUintId; // Revert to other ads
else
if (e.ErrorCode == MsErrCode.NoAdAvailable) {
adControl.AdUnitId = msBannerHouseUintId; // Use house ads
adControl.Refresh();
}
.............
}
I get error code RefereshNotAllowed!
Indeed, a 30-sec minimum timeout between ads makes sense. However, if unit id changes it should be reset!
I tried to re-create control in hope this may reset the timeout. No way - it looks like timeout is processed statically!
Any other ideas?