locked
Verify In-App Purchase

    Question

  • Hello,

    I am slightly confused about how to verify if the user has purchased my in-app product. 

    Looking at the in-app purchasing sample, to verify if the user has purchased a product they use 

    licenseInformation.productLicenses.lookup("product").isActive

    I was then reading on-line and saw this article about in-app purchase receipts: http://msdn.microsoft.com/en-us/library/jj649137.aspx

    I am not sure what I need to do to verify if the user has purchased my product? 

    Thank you


    • Edited by r.c.byrne Sunday, January 11, 2015 7:44 PM
    Sunday, January 11, 2015 7:44 PM

Answers

  • Hi r.c.byrne,

    Great, a good question. If you do the purchase on the same machine, the isActive is fine.

    But let's imagine if a user buy the product on one machine but use the app in another machine, we should ask the store to provide some receipt so that we know the current user already brought the product, that's the purpose of the validate receipt.

    --James


    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.

    Monday, January 12, 2015 6:17 AM
    Moderator
  • You're right.  The license will be in effect for all users using the same Live-ID (for up to some limit of machines)

    I think a better situation for verifying purchases is in terms of an app downloading or unlocking special server-side content. 

    You'd want to ensure on the server that the user actually bought the item, because anyone could find the URL if they sniffed the traffic. 

    The server would be passed the purchase details and could then validate the purchase on it's side.  Since the server can't have access to the internal isActive flag, you'd use that code to do it.


    Darin R.

    Thursday, January 15, 2015 8:02 PM

All replies

  • Hi r.c.byrne,

    Great, a good question. If you do the purchase on the same machine, the isActive is fine.

    But let's imagine if a user buy the product on one machine but use the app in another machine, we should ask the store to provide some receipt so that we know the current user already brought the product, that's the purpose of the validate receipt.

    --James


    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.

    Monday, January 12, 2015 6:17 AM
    Moderator
  • Hello James,

    I dont think the documentation explains this very well, I thought the purpose of "isActive" was to check the store to see if the user owns the item?

    I currently have an app and I am only using isActive to check if the user has the inapp item (just like the in-app sample), it seems to work across devices, people who have bought the product on one device have access to it on others? 

    When you say "other devices" do you mean cross platform, or cross windows?

    Thank you.

    Monday, January 12, 2015 10:22 AM
  • You're right.  The license will be in effect for all users using the same Live-ID (for up to some limit of machines)

    I think a better situation for verifying purchases is in terms of an app downloading or unlocking special server-side content. 

    You'd want to ensure on the server that the user actually bought the item, because anyone could find the URL if they sniffed the traffic. 

    The server would be passed the purchase details and could then validate the purchase on it's side.  Since the server can't have access to the internal isActive flag, you'd use that code to do it.


    Darin R.

    Thursday, January 15, 2015 8:02 PM