Our iOS app uses in-app purchases, both one-time and an auto-renewing subscription. Both these are non-consumable.
iOS offers two APIs: refresh receipt, and restore completed transactions.
It seems that the latter works for all cases, while the former works in only some cases. Specifically, when we restore an auto-renewable purchase to a new device, restore purchased transactions will cause future renewals to generate a transaction that will be sent in the background to the new device, where as refreshing the receipt will not cause a transaction to be sent to this device the next time there is a renewal.
Given this, is there any reason to use refresh receipt?
Apple seems to say we can use either:
Retrieve information about past purchases by either refreshing the app
receipt using the SKReceiptRefreshRequest class or restoring completed
transactions using the restoreCompletedTransactions method of the
SKPaymentQueue class.
Best Answer
You need to read this Restoring Purchased Products to understand the purposes between the 2.
From iOS 7, every app downloaded from the store has a receipt (for downloading/buying the app) at
appStoreReceiptURL
. When users purchases something via In App Purchase, the content atappStoreReceiptURL
is updated with purchases information. Most of the cases, you just need to refresh the receipt (atappStoreReceiptURL
) so that you know which transactions users have made.More about receipt, from WWDC 2017, What's new in StoreKit session https://developer.apple.com/videos/play/wwdc2017/303/
You can also watch WWDC 2017, session Advanced StoreKit for more detail https://developer.apple.com/videos/play/wwdc2017/305/