**Edit: I've narrowed down the cause to a purchase having Apple Hosted Content. Regular purchases that aren't hosted content are restored properly.
I can't seem to restore purchases on my app. Purchases work completely fine. However when I use a function that calls:
SKPaymentQueue.default().restoreCompletedTransactions()
The payment queue is never called
func paymentQueue(_ queue: SKPaymentQueue, updatedTransactions transactions: [SKPaymentTransaction]) {
//Not called!
}
The paymentQueue has no problems for regular purchases.
It looks like the restore is completing properly because after running the above .restoredCompletedTransactions I immediately get this function called.
func paymentQueueRestoreCompletedTransactionsFinished(_ queue: SKPaymentQueue) {
print ("This works")
}
I also checked with the following and get no error:
func paymentQueue(_ queue: SKPaymentQueue, restoreCompletedTransactionsFailedWithError error: Error)
The SKPaymentQueue.add(self) is called way before the restoredCompletedTransactions, so this also shouldn't be an issue.
What could cause IAP working perfectly fine, but not the restore? I am testing it from a physical device, and using a sandbox account.
This recent question had a similar problem, but never got an answer. Also, I'm not sure if it matters, but the purchases are using Apple Hosted Content.
Any help would be super appreciated! It's killing me here.