SKReceiptRefreshRequest vs restoreCompletedTransactions SKReceiptRefreshRequest vs restoreCompletedTransactions ios ios

SKReceiptRefreshRequest vs restoreCompletedTransactions


It is very simple difference between SKReceiptRefreshRequest vs RestoreCompletedTransactions:

SKReceiptRefreshRequest

Refreshing the receipt asks the App Store for the latest copy of the receipt. Refreshing a receipt does not create any new transactions. Although you should avoid refreshing multiple times in a row, this action would have same result as refreshing it just once.

RestoreCompletedTransactions

Restoring completed transactions creates a new transaction for every completed transaction the user made, essentially replaying history for your transaction queue observer. While transactions are being restored, your app maintains its own state to keep track of why it’s restoring completed transactions and how it needs to handle them. Restoring multiple times creates multiple restored transactions for each completed transaction.

We can use both SKReceiptRefreshRequest & Restore completed transactions for validating user subscription, But here in below cases we must used to Restore completed transaction instead refreshing receipt:

  • If you use Apple-hosted content, restoring completed transactions gives your app the transaction objects it uses to download the content.

  • If you need to support versions of iOS earlier than iOS 7, where the app receipt isn’t available, restore completed transactions instead.

  • If your app uses non-renewing subscriptions, your app is responsible for the restoration process.

Reference: https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/StoreKitGuide/Chapters/Restoring.html#//apple_ref/doc/uid/TP40008267-CH8-SW9