Major issue: not using my data

Jan 25, 2014 at 4:56 PM
I have a major issue with your control.
I've created the defaultAdSettings.xml as explained in the documentation and have it in the root of my project.

When I run the program in any case it uses sample data:
CODE:
        System.Diagnostics.Debug.WriteLine("AdControl : Smaato = " + adControl.SmaatoPublisherId + " - " + adControl.SmaatoAppId);
        System.Diagnostics.Debug.WriteLine("AdControl : AdMob AdUnitID = " + adControl.AdMobAdUnitId);
        System.Diagnostics.Debug.WriteLine("AdControl : Inneractive AppID = " + adControl.InneractiveAppId);
        System.Diagnostics.Debug.WriteLine("AdControl : MobFox AppID = " + adControl.MobFoxAppId);
        System.Diagnostics.Debug.WriteLine("AdControl : PubCenter = " + adControl.PubCenterAppId + " - " + adControl.PubCenterAdUnitId);
        System.Diagnostics.Debug.WriteLine("AdControl : AdDuplex AppID = " + adControl.AdDuplexAppId);

Result:
AdControl : Smaato = 923855310 - 65754722
AdControl : AdMob AdUnitID = a14e5b8669ef367
AdControl : Inneractive AppID = DavideCleopadre_ClockAlarmNightLight_WP7
AdControl : MobFox AppID = 1d59fb0a677336d8cd4cbd5c7c117f9d
AdControl : PubCenter = test_client - Image480_80
AdControl : AdDuplex AppID = 2859

I do not want an online URL only the local URI.

What's going on? It looks the info is hard coded :(


Where is the issue
Coordinator
Jan 25, 2014 at 6:17 PM
Those settings are coming from the xml configuration in your project.

the settings in xaml are only an override for the config xml but it is the config xml that configures the running of the control

you can either just host the xml locally in your project or host the xml online or both.

hope this helps

there is no hard coding in the solution at all
Jan 25, 2014 at 6:39 PM
Darkside,
sorry but there is something weird somewhere.

I added the control via nuget.

I added the xaml:
<adRotator:AdRotatorControl x:Name="adControl"
            DefaultSettingsFileUri="defaultAdSettings.xml" SlidingAdDirection="None"/>
in the whole solution there is ONLY one file defaultAdSettings.xml with all my information that is in the root of the solution as Content / copy if newer.

In this way the information used by the control is the one above (i.e. AdControl : Inneractive AppID = DavideCleopadre_ClockAlarmNightLight_WP7 ): NOT MINE!

I had to change the code to
<adRotator:AdRotatorControl x:Name="adControl"
            DefaultSettingsFileUri="AdData/defaultAdSettings.xml" SlidingAdDirection="None"/>
and create a folder AdData where I just copied the defaultAdSettings.xml

and everything worked.

So there are hardcoded values used as defaults or when the file is not reachable.

If I had not put the printout of the used account info I would have never discovered that my app wha showing the wrong advs

M
Coordinator
Jan 25, 2014 at 8:39 PM
Right what has probably happened is that you ran it at least once with the default ad config file and that got cached in your app.
If you config file has your own settings, try uninstalling it and then running it with just your own config file (also do a clean + remove obj / bin folders just to be sure)

I assure you there is no hardcoding of provider config in the solution, check the source if you wish.
Jan 25, 2014 at 9:13 PM
Darkside,
thank you for your hints, I understood what happened; also I never ment to sound offensive or suggest you were cheating somehow.

My application is divided in a library and a main. In the library I have all core functionalities including the Advs management while in the main app I have the configuration files and some specific windows/data.

I had to install, via nuget, the Ad Rotator to the library, at the same time I created the configuration file in the main application.

What happened is that the nuget installation automatically creates a default defaultAdSettings.xml in the library.
So when the package is compiled and deployed Visual studio does not add the defaultAdSettings.xml from the main application as there already is one (the one from library).

With respects of the "hardcoded" values they are in the defaultAdSettings.xml it is installed from Nuget; I would strongly suggest you remove your values and put some generic like:
<?xml version="1.0" encoding="utf-8"?> 
<AdSettings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> 
    <CultureDescriptors> 
        <AdCultureDescriptor CultureName="en-US"> 
      <Probabilities Probability="16" AdType="Smaato" AppID="<Insert Smaato AppID here>" SecondaryID="<Insert Smaato Publisher ID here>"/> 
      <Probabilities Probability="16" AdType="AdMob" AppID="<insert AdMob App ID here>"/> 
      <Probabilities Probability="15" AdType="InnerActive" AppID="<Insert InnerActive APPID here>" /> 
      <Probabilities Probability="15" AdType="MobFox" AppID="<Insert MobFox APP ID here>" IsTest="false"/> 
      <Probabilities Probability="40" AdType="PubCenter" AppID="<Insert Pubcenter APP ID here>" SecondaryID="<inserrt Pubcenter AD Unit ID here>" /> 
      <Probabilities Probability="10" AdType="AdDuplex" AppID="<insert AdDuplex AD ID here>"/> 
      <Probabilities AdType="DefaultHouseAd"/> 
    </AdCultureDescriptor> 
        <AdCultureDescriptor CultureName="en-GB"> 
      <Probabilities Probability="20" AdType="Smaato" AppID="<Insert Smaato AppID here>" SecondaryID="<Insert Smaato Publisher ID here>"/> 
      <Probabilities Probability="10" AdType="InnerActive" AppID="<Insert InnerActive APPID here>" /> 
      <Probabilities Probability="10" AdType="MobFox" AppID="<Insert MobFox APP ID here>" IsTest="false"/> 
      <Probabilities Probability="10" AdType="AdDuplex" AppID="<insert AdDuplex AD ID here>"/> 
      <Probabilities Probability="20" AdType="AdMob" AppID="<insert AdMob App ID"/> 
      <Probabilities Probability="20" AdType="PubCenter" AppID="<Insert Pubcenter APP ID here>" SecondaryID="<inserrt Pubcenter AD Unit ID here>" /> 
      <Probabilities AdType="DefaultHouseAd"/> 
    </AdCultureDescriptor> 
        <AdCultureDescriptor CultureName="de-DE"> 
      <Probabilities Probability="25" AdType="Smaato" AppID="<Insert Smaato AppID here>" SecondaryID="<Insert Smaato Publisher ID here>"/> 
      <Probabilities Probability="25" AdType="PubCenter" AppID="<Insert Pubcenter APP ID here>" SecondaryID="<inserrt Pubcenter AD Unit ID here>" /> 
      <Probabilities Probability="25" AdType="AdMob" AppID="<insert AdMob App ID here>"/> 
      <Probabilities Probability="25" AdType="AdDuplex" AppID="<insert AdDuplex AD ID here>"/> 
      <Probabilities AdType="DefaultHouseAd"/> 
    </AdCultureDescriptor> 
        <AdCultureDescriptor CultureName="default"> 
      <Probabilities Probability="16" AdType="Smaato" AppID="<Insert Smaato AppID here>" SecondaryID="<Insert Smaato Publisher ID here>"/> 
      <Probabilities Probability="16" AdType="AdMob" AppID="<insert AdMob App ID here>"/> 
      <Probabilities Probability="16" AdType="InnerActive" AppID="<Insert InnerActive APPID here>" /> 
      <Probabilities Probability="16" AdType="MobFox" AppID="<Insert MobFox APP ID here>" IsTest="false"/> 
      <Probabilities Probability="16" AdType="PubCenter" AppID="<Insert Pubcenter APP ID here>" SecondaryID="<inserrt Pubcenter AD Unit ID here>" /> 
      <Probabilities Probability="16" AdType="AdDuplex" AppID="<insert AdDuplex AD ID here>"/> 
      <Probabilities AdType="DefaultHouseAd"/> 
    </AdCultureDescriptor> 
    </CultureDescriptors> 
</AdSettings>
So that Advs will NOT be served if the user will not do the correct work on the file and also will be easier to troubleshoot problems of advs :)

If you want to cross check the issue here are the repro steps: simply create and empty windows phone 7.1 project, save it, Nuget, add package :)
Bingo!