Hi,
Certainly a naive question, sorry...
Is a receipt updated with the bundle version when a user update an application ?
To be valid a receipt should contain the same bundle version than the associated application... Considering, for example, an in-App purchase that contains a product to unlock specific features of an application... How can we manage the validity of the in-App purchase according to the receipt ?
Say, that I want an inApp purchase to be valid for the major version 1 of my application, and to need a new purchase for the second major version, and so on. Could you tell me what is the correct process for such a model ?
Thanks !
Cyril.
You cannot be certain that there will be a receipt at all. If there is no receipt you can inform the user and referesh the receipt. If you need the latest receipt you can refresh the receipt.
>How can we manage the validity of the in-App purchase according to the receipt
You decode the receipt and examine it to see what rights the user has. If the user does not have those rights then you ask the user if they want to update their receipt to see if they have the rights they might want.
You can examine the receipt for the original_application_version. Knowing that, you look at the version number of the version being used (hard code it into each version). Based on the version originally purchased and the version being run, you know what IAPs are needed to do anything. You examine the receipt to see if they purchased those IAPs. If it looks like they didn;t you ask the user if they want to update their receipt to determine if they purchased the IAPs (or you ask if they want to restore their IAPs and you do a restoreCompletedTransactions).