locked
7 Day Trial period on app returning a crazy number RRS feed

  • Question

  • Hi all,

    I'm trying to calculate and display the days remaining in a 7 day trial app that I currently have in the store.  I used the sample code:

     if (license.IsTrial)
                    {
                        int remainingTrialTime = (license.ExpirationDate - DateTime.Now).Days;
                        this.NotifyUser($"You can use this app for {remainingTrialTime} more days before the trial period ends.", NotifyType.ErrorMessage);

    license.ExpirationDate returns a 12/30/9999 date and therefore gives me a crazy number for the days remaining.  What am I doing wrong here?

    Thanks

    • Moved by Mattew Wu Monday, December 26, 2016 9:16 AM Store issue
    Saturday, December 24, 2016 3:01 AM

All replies

  • Hi,

    I am creating a UWP app that is currently in store.  I have the option for a 7 day trial and the expiration date always returns 12/30/9999 and TrialTimeRemaining = {10675199.02:48:05.4775807}

    It is coming back with the correct SkuStoreID. How can I get the days remaining on the trial?

    I'm not sure what I am doing wrong but it seems the information that is returned from the store is incorrect.

    Here is snippet:

    StoreAppLicense license = await storeContext.GetAppLicenseAsync();
    
                if (license.IsActive)
                {
                    if (license.IsTrial)
                    {
                        if (App.ShowNagScreen == true)
                        {
                            var dialog = new MessageDialog("This is a Trial Version.\rApp will stop working after " + license.TrialTimeRemaining.Days.ToString() )'
    ....

    • Merged by David_FF Monday, December 26, 2016 6:19 AM same issue
    Friday, December 23, 2016 4:23 AM
  • I am creating a UWP app that is currently in store.  I have the option for a 7 day trial and the expiration date always returns 12/30/9999 and TrialTimeRemaining = {10675199.02:48:05.4775807}

    It is coming back with the correct SkuStoreID. How can I get the days remaining on the trial?

    I'm not sure what I am doing wrong but it seems the information that is returned from the store is incorrect.

    Here is snippet:

    StoreAppLicense license = await storeContext.GetAppLicenseAsync();
    
                if (license.IsActive)
                {
                    if (license.IsTrial)
                    {
                        if (App.ShowNagScreen == true)
                        {
                            var dialog = new MessageDialog("This is a Trial Version.\rApp will stop working after " + license.TrialTimeRemaining.Days.ToString() )'
    ....

    • Edited by Barry Wang Monday, December 26, 2016 5:29 AM title tag
    • Merged by Barry Wang Monday, December 26, 2016 6:06 AM same issue
    Friday, December 23, 2016 10:43 PM
  • Hi 7VN,

    After looking through your code, I find it without problem.

    I will report this issue to related team to internally confirm if there's any problem in Store side. I will update here once I have the response.

    You may create a support request here first: http://aka.ms/storesupport.

    Appreciate your patience.

    Best regards,

    Mattew Wu


    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.


    • Edited by Mattew Wu Monday, December 26, 2016 10:02 AM
    Monday, December 26, 2016 8:39 AM
  • Hi all,

    I'm trying to calculate and display the days remaining in a 7 day trial app that I currently have in the store.  I used the sample code:

     if (license.IsTrial)
                    {
                        int remainingTrialTime = (license.ExpirationDate - DateTime.Now).Days;
                        this.NotifyUser($"You can use this app for {remainingTrialTime} more days before the trial period ends.", NotifyType.ErrorMessage);

    license.ExpirationDate returns a 12/30/9999 date and therefore gives me a crazy number for the days remaining.  What am I doing wrong here?

    Thanks

    Wednesday, January 4, 2017 3:41 AM
  • Hi,

    Do you know if this is resolved as of yet?  It is still coming out with a crazy number.

    Thank you

    Wednesday, January 4, 2017 3:29 PM
  • Hi 7VN,

    Thanks for reporting this issue.

    What is your OS version for testing this app?

    I will report it to the related team. Once there is any update, I will post it here.

    Updated:
    This has been a logged issue in our system, the related team is investigating this issue.

    Best Regards,
    Amy Peng


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.



    Friday, January 6, 2017 6:57 AM
  • Hi 7VN,

    When you have the full license of an app, the license.ExpirationDate will return a 12/30/9999 date.

    Could you please run WSCOLLECT and provide logs in here?

    Besides, I wonder if you already have a user on this device which has the full license of this app, it seems that you have a device entitlement/lease that gives you the “full copy” of the app, so the other user on this device will show as the full license.

    Best Regards,
    Amy Peng


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, January 17, 2017 9:38 AM
  • Hi 7vn,

    I'm pretty new to coding & developing so my suggestion may not help, but perhaps you could use moment.js to assist in getting your code to work.


    Newbie enough to get myself into trouble. :0) Eyes are crossed and growth is pain ... but working on it.

    Friday, January 27, 2017 4:05 PM
  • 7VN,

    I am having the same issue with my app (also 7 day trial). I tested it on a device with only one account using it and who downloaded the app for the first time from the Store. It is showing 10675199 days, which happen to be TimeSpan.MAXVALUE.Days.

    Ronald

    Sunday, February 19, 2017 2:28 PM