locked
LicenseInformation IsTrial is always true, even after buying the app RRS feed

  • Question

  • I have published an app in Windows store, but it's hidden for the moment, so I could test.

    There is a Trial in the app, giving you access to some level. I didn't put any time limit. When you buy the game, you should have access to all the levels. But the "IsTrial" is always true.

    private static LicenseInformation _licenseInformation = CurrentApp.LicenseInformation;
    
    public static bool IsLevelEnabled(LevelViewModel level)
    {
    #if DEBUG
      return true;
    #else
      if (_licenseInformation.IsActive)
      {
        if (_licenseInformation.IsTrial) //Problem, always true
        {
          if ([...])//some logic to check is level is enabled in Trial.
          {
            return true;
          }
          else
          {
            return false;
          }
        }
        else //Should go here when you buy the app.
        {
          return true;
        }
      }
      else
      {
        return false;
      }
    #endif
    }

    My code is base on https://msdn.microsoft.com/en-us/library/windows/apps/xaml/Dn532253(v=win.10).aspx.

    Someone else bought my app on the store, he didn't tried the trial. Everything is fine for him. He had access to all levels.

    I tried with an other account, I downloaded the trial, open the app. I want back to the store and bought the app. It restarted my app, it's was still in trial. So I reinstalled the app and everything was fine.

    My personnal account is still stuck on Trial.

    Thanks

    Friday, October 2, 2015 4:56 PM

All replies

  • Hi,

    I think you should manually check and update current app state. I don't think that everytime app is launched it checks the store for changes automatically.

    Try call CurrentApp.GetProductRecieptAsync method which returns XML and in there is AppReceipt element and in there is LicenseType element with possible values Trial and Full.

    Mayby after that call LicenceInformation.LicenseChanged event will be fired if any change happened and the IsTrial property will start to return false.

    Hope it helps


    Microsoft Platform Developer Cloudikka blog

    Sunday, December 27, 2015 1:30 AM