'How to detect a non-consumable in-app item has been refunded in SKPaymentTransactionObserver?
I am testing using local StoreKit, for non consumable in-app item.
If I purchase the non consumable in-app item, I can receive callback in SKPaymentTransactionObserver without issue
extension IAPHelper: SKPaymentTransactionObserver {
public func paymentQueue(_ queue: SKPaymentQueue, updatedTransactions transactions: [SKPaymentTransaction]) {
for transaction in transactions {
switch transaction.transactionState {
case .purchased:
complete(transaction)
...
}
}
private func complete(_ transaction: SKPaymentTransaction) {
print("complete...")
// Save purchase record to disk to indicate user owns this non-consumable item.
persistPurchase(identifier: transaction.payment.productIdentifier)
SKPaymentQueue.default().finishTransaction(transaction)
}
If I go to Debug/ StoreKit/ Manage Transactions... , to perform refund, I do not receive any callback in SKPaymentTransactionObserver.
Even if I close the app and start the app again, there isn't any callback to SKPaymentTransactionObserver, to indicate the non consumable in-app item has been refunded, so that I can block user from accessing the in-app item.
May I know, is it possible to detect a non-consumable in-app item has been refunded, in SKPaymentTransactionObserver? If not, what is the right way to do so?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
