I'm working on my app which utilizes auto-renewing subscriptions. I'm trying to understand how everything works, and I'm finding it confusing. To start, the way I'm restoring purchases is running this:
let request = SKReceiptRefreshRequest()
request.delegate = self
request.start()
SKPaymentQueue.default().add(self)
SKPaymentQueue.default().restoreCompletedTransactions()Maybe I'm not looking in the proper places, but I've seen that this is how others do what I'm trying. However, shouldn't it be just check the latest receipt info? Why restoreCompletedTransactions? Isn't that only for consumables?
restoreCompletedTransactions will not work with a consumable IAP - but that's not your question.
You have 2 choices. You can refresh the receipt and then examine the refreshed receipt or you can restoreCompletedTransactions. The advantage of the restore is that when a device does a restore (or a purchase) it is registered with the App Store and subsequently that device receives a new transaction each time there is an auto-renew transaction (and the device adds a transaction observer).