Using CurrentApp.GetAppReceiptAsync() to determine if app previously paid for

    General discussion

  • I am trying to shift my app from a free trial / purchase model, to a free / in-app purchase model. I am thinking about using CurrentApp.GetAppReceiptAsync() to get an XML based receipt, indicating the purchase date for the app for a user. The receipt should look something like the following:

    <Receipt Version="1.0" ReceiptDate="2012-08-30T23:10:05Z" CertificateId="b809e47cd0110a4db043b3f73e83acd917fe1336" ReceiptDeviceId="4e362949-acc3-fe3a-e71b-89893eb4f528">
     <AppReceipt Id="8ffa256d-eca8-712a-7cf8-cbf5522df24b" AppId="55428GreenlakeApps.CurrentAppSimulatorEventTest_z7q3q7z11crfr" PurchaseDate="2012-06-04T23:07:24Z" LicenseType="Full" />
     <ProductReceipt Id="6bbf4366-6fb2-8be8-7947-92fd5f683530" ProductId="Product1" PurchaseDate="2012-08-30T23:08:52Z" ExpirationDate="2012-09-02T23:08:49Z" ProductType="Durable" AppId="55428GreenlakeApps.CurrentAppSimulatorEventTest_z7q3q7z11crfr" />
     <Signature xmlns="">
       <CanonicalizationMethod Algorithm="" />
       <SignatureMethod Algorithm="" />
       <Reference URI="">
         <Transform Algorithm="" />
        <DigestMethod Algorithm="" />

    The above receipt was taken from here. I have a number of questions.

    1) Does the version number at the top of the receipt refer to the version of my app, when the app was bought?

    2) When a user receives the upgrade of my app with the new free / in-app purchase model, will the store generate an app receipt for the new version of the app, if the app was not previously purchased?

    What I'd like my app to essentially do, is check to see if the in-app product I'm selling is active. If it is not, check the app's receipt to see if the app was purchased in a previous version. If both are not true, require the user to purchase the in-app product, otherwise grant the user access to the in-app product.

    Note: assuming the answers to my questions above are true, all I'll have to do is check the version number in the receipt for my app, to see if my app was paid for by a user, prior to switching over to the new free / in-app purchase model.

    • Edited by PDoug Thursday, March 27, 2014 3:51 PM
    Thursday, March 27, 2014 3:34 PM