0

I am using Native Ads for my UWP app. The app works well with the test ad ids. However, when I put in real values for publishing (note the problem I am describing is for published app, and I downloaded the app from the Windows Store), it always returns NoAdAvailable error:

    private void LoadNativeAd(string adUnit, FrameworkElement adContainer)
    {
        var adsManager = new NativeAdsManagerV2(NativeAdAppId, adUnit);
        adsManager.ErrorOccurred += this.AdsManager_ErrorOccurred;

        adsManager.AdReady += (sender, e) =>
        {
            this.AdsManager_AdReady(adContainer, e);
        };

        adsManager.RequestAd();
    }

    private async void AdsManager_ErrorOccurred(object sender, NativeAdErrorEventArgs e)
    {
        var appFolder = ApplicationData.Current.LocalFolder;
        var file = await appFolder.CreateFileAsync("ad.log", CreationCollisionOption.OpenIfExists);

        using (var logStream = await file.OpenAsync(FileAccessMode.ReadWrite))
        {
            using (var streamWriter = new StreamWriter(logStream.AsStreamForWrite()))
            {
                streamWriter.WriteLine($"{e.ErrorCode}: {e.ErrorMessage} ({e.RequestId})");
            }
        }
    }

For testing value, AdsManager_AdReady works well but with real value (either on local testing or real published app) it is never called. The content of the ad.log file looks like this:

NoAdAvailable: No Ad Available (2ce6c6c3f848475f8dea0cc3cf2dba97)

The app/ad code is published for many weeks already. What's wrong with it?

Luke Vo
  • 17,859
  • 21
  • 105
  • 181
  • You could make a [support ticket](http://aka.ms/storesupport) to ask for help, please click 'contact us' , select 'Dashboard issue' as the support ticket and the proper issue type to 'submit an incident'. – DasiyTian_1203 Sep 04 '18 at 09:33
  • @DasiyTianMSFT that button (Submit an Incident) does not work, it immediately redirects me to https://support.microsoft.com/en-us/contactus/ – Luke Vo Sep 04 '18 at 10:01
  • 1
    I encounter same issue as you.I had reported this issue to the related team, I will update here if I get the response. – DasiyTian_1203 Sep 13 '18 at 07:33

0 Answers0