locked
Using hous ads as backup with Micorosft AdControl (UWP) RRS feed

  • Question

  • 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!

    I hope Micorosoft team ( occasionally ) reads this forum. They should agree that a 30-sec minimum timeout between ads should not apply if unit id changes! How else can I achieve the goal then ?

    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?



    • Edited by pcyanide Thursday, April 6, 2017 5:58 AM
    Thursday, April 6, 2017 5:56 AM

All replies

  • Hi pcyanide,

    Have you tried using manual refresh (it is needed to set IsAutoRefreshEnabled property to False)?

    And for more details ,you could refer to this document.

    Best Regards,

    Annievia Chen


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Friday, April 7, 2017 10:11 AM
  • Setting "IsAutoRefreshEnabled" to False didn't help.

    Actually it makes sense. Otherwise is would possible to make refresh happen more often that in 30 seconds, and this is exactly what AdControl is designed to prevent.


    • Edited by pcyanide Saturday, April 15, 2017 8:55 AM
    Friday, April 14, 2017 3:28 AM
  • Hi pcyanide,

    sorry for the delay reply.

    I think perhaps you could submit your platform capability request at https://wpdev.uservoice.com/ to let it can be reviewed by the feature teams. 

    Best Regards,

    Annievia Chen


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Tuesday, April 25, 2017 6:42 AM