locked
Trial code doesn't seem to be working

    Question

  • Am I doing something wrong? I am trying to make a HubSection Visible if the app is in trial mode.

                LicenseInformation license = CurrentApp.LicenseInformation;
    
                if (license.IsTrial == true)
                {
                    AdvertisementSection.Visibility = Visibility.Visible;
                }

    I have this code in MainPage.xaml.cs. I have two different configurations in the configuration manager. One is Debug which should be simulating a full license as the Conditional Compilation Symbols box looks like this NETFX_CORE;WINDOWS_APP; and I have another one called DebugTrial which should be simulating the trial because I added TRIAL to the Conditional Compilation Symbols so it looks like NETFX_CORE;WINDOWS_APP;TRIAL. The problem is that advertisements are displayed when I run the app in either configuration. I tried changing CurrentApp to CurrentAppSimulator and I also double checked to make sure the configurations were set properly. I can't figure out what I did wrong. Please help.

    The app is a Universal App.
    Tuesday, November 04, 2014 8:26 PM

Answers

  • It seems that the conditional statements don't work in universal apps. I had to find the file WindowsStoreProxy.xml and change <IsTrial>true</IsTrial> to <IsTrial>false</IsTrial> while using CurrentAppSimulator. This file is found under %userprofile%\AppData\local\packages\<package name>\LocalState\Microsoft\Windows Store\ApiData

    This whole Universal thing confused me but I think I am getting the hang of it.

    Tuesday, November 04, 2014 9:21 PM

All replies

  • It seems that the conditional statements don't work in universal apps. I had to find the file WindowsStoreProxy.xml and change <IsTrial>true</IsTrial> to <IsTrial>false</IsTrial> while using CurrentAppSimulator. This file is found under %userprofile%\AppData\local\packages\<package name>\LocalState\Microsoft\Windows Store\ApiData

    This whole Universal thing confused me but I think I am getting the hang of it.

    Tuesday, November 04, 2014 9:21 PM
  • Alright, at least you find out a solution.

    However when you want to know if the app is on trial, please test IsActive as well, IsTrial returns true even after the trial period  ends. IsActive, however, will return false after the trial period ends.

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Wednesday, November 05, 2014 5:52 AM
    Moderator