locked
In-App-Purchase. Products expire. RRS feed

  • Question

  • Hello!

    I want to create some count of Products which will open 1 app feature for some time.

    All of this products must have expiration date.

    So, free product will have 30 days expiration time.

    1st paid feature will have says 30 days and 3$.

    2nd paid will have 60d and 5$.

    ...
    etc.

    If some of paid feature has expired, user can buy this feature again.

    The issue in Free Product. I don't know how to block it after it first time expired.

    So I need to hide Free Product when it expired and be able to buy paid features if they are expired.

    Also, can anyone explain what is Product.LicenseDuration and what difference with Product.ExpiredDate.

    Thanks.

    Wednesday, October 23, 2013 1:41 PM

Answers

  • I'll use CurrentAppSimulator.GetAppReceiptAsync for check my free product receipt and take purchase date from it.

    Thanks for help.


    • Edited by Oleg Kurzov Friday, October 25, 2013 10:01 AM
    • Marked as answer by Oleg Kurzov Friday, October 25, 2013 10:01 AM
    Friday, October 25, 2013 10:01 AM

All replies

  • You need to prevent this in your app before calling the in-app purchase system. Keep track of when the user bought the free product and then don't offer it again for purchase later.

    The ExpirationDate will tell when the product will expire. The LicenseDuration attribute will say how long a new license will last.

    --Rob

    Wednesday, October 23, 2013 9:23 PM
    Moderator
  • Thanks for reply, Rob.

    Yes, I know that I can store some info when user activate this free product at first time. But I hope that there are any API for check it after product will expire.

    But user can re-install app and stored information will broke. Now I'm think I need to create web-service for store user deviceID when user activate this free product at first time.

    Maybe you have any suggestions how to track it without creating web-

    UPD: also, I can store this in Roaming folder, but I think user can drop all from it and activate my feature again :(

    UPD2: why Microsoft didn't implement CurrentAppSimulator.GetProductReceiptAsync. There are stored information of first bought:

    <?xml version="1.0" encoding="utf-8"?>
    <Receipt Version="1.0" ReceiptDate="2013-10-24T08:30:31Z" CertificateId="" ReceiptDeviceId="603f83d3-4d37-464a-9a46-11d48841de24">
    	<ProductReceipt Id="6cb0d91c-863e-4cf3-b656-01ecc14f87de" 
    					AppId="Microsoft.SDKSamples.Store.CS_8wekyb3d8bbwe" 			 
    					ProductId="product2" 
    					PurchaseDate="2013-10-24T08:30:31Z"
    					ProductType="Durable"   />
    </Receipt>

    With "receipt" I can set "forever" time expire for product and check it in app by getting receipt from CurrentAppSimulator.GetProductReceiptAsync.



    • Edited by Oleg Kurzov Thursday, October 24, 2013 11:23 AM
    Thursday, October 24, 2013 10:44 AM
  • I'll use CurrentAppSimulator.GetAppReceiptAsync for check my free product receipt and take purchase date from it.

    Thanks for help.


    • Edited by Oleg Kurzov Friday, October 25, 2013 10:01 AM
    • Marked as answer by Oleg Kurzov Friday, October 25, 2013 10:01 AM
    Friday, October 25, 2013 10:01 AM