How to handle that the user did not make any purchases when restoring purchases?
I have function that handle purchased products
func paymentQueue(_ queue: SKPaymentQueue, updatedTransactions transactions: [SKPaymentTransaction]){
for transaction in transactions {
switch transaction.transactionState
{
...
transactionState = .purchased
case .restored:
//HANDLE purchased here
queue.finishTransaction(transaction)
transactionState = .restored
...
}
}
}
Next
func paymentQueueRestoreCompletedTransactionsFinished(_ queue: SKPaymentQueue){
for transaction in queue.transactions
{
//do something
}
}
And
func paymentQueue(_ queue: SKPaymentQueue, restoreCompletedTransactionsFailedWithError error: Error) {
//HANDLE error here
}
And call restoring with
func restoreProducts(){
SKPaymentQueue.default().restoreCompletedTransactions()
}
If the user made a purchase before, I can perfectly track this in the first function
If there were no purchases, none of the three processing functions are called.
Q: How to track in this case?
Thanks