3

I have implemented the IAP for Consumable Products in my app. I have couple of queries regarding validating the receipt. I am going to use my own server which will communicate with apple server.

1.) Does the below url will contain the most recent receipt or all the receipts (even the old ones)?

NSBundle.mainBundle().appStoreReceiptURL

2.) If the above url stores all the receipts then do i need to verify all the receipts whenever user purchase a new product?

3.) Does the user will have access to these receipts if he chooses to reinstall the application?

Sourav Gupta
  • 762
  • 11
  • 13

1 Answers1

4

Refer: In-App Purchase Programming Guide https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/StoreKitGuide/Chapters/DeliverProduct.html#//apple_ref/doc/uid/TP40008267-CH5-SW16

Information about consumable products and non-renewing subscriptions is added to the receipt when they’re paid for and remains in the receipt until you finish the transaction. After you finish the transaction, this information is removed the next time the receipt is updated—for example, the next time the user makes a purchase.

Information about all other kinds of purchases is added to the receipt when they’re paid for and remains in the receipt indefinitely.

Raunak
  • 3,314
  • 1
  • 22
  • 28
  • In case of server-side validation with consumable products, what happens if a network operation fails while verifying the receipt? Should the transaction be finished only when the receipt is correctly validated by the server? If the server fails in validating the receipt and the transaction is not finished, will StoreKit call the transaction queue observer again? In this case when the transaction queue observer is called again? – Andrea Gorrieri Jun 19 '18 at 10:33
  • Yes, you should complete ('finish') the transaction ONLY after you have delivered the required product/service to the user. Which means that you inform the user (popup or otherwise) that the item could not be delivered because of a network error. When the user tries to purchase the same item again, you will get a callback to restore the transaction. – Raunak Jun 21 '18 at 11:05