From 4d00dd02700366b5011ba76177426de212e9adf5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Kordal?= Date: Mon, 31 Aug 2020 14:35:18 +0200 Subject: [PATCH] In iOS14 comparing payment itself fails as object of payment is not always the same. In case of success for purchasing product, transaction is SKMutablePayment which is not equal to SKPayment. --- Sources/SKPayment+Promise.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/SKPayment+Promise.swift b/Sources/SKPayment+Promise.swift index be3e1f7..63ae4a9 100644 --- a/Sources/SKPayment+Promise.swift +++ b/Sources/SKPayment+Promise.swift @@ -23,7 +23,7 @@ private class PaymentObserver: NSObject, SKPaymentTransactionObserver { } func paymentQueue(_ queue: SKPaymentQueue, updatedTransactions transactions: [SKPaymentTransaction]) { - guard let transaction = transactions.first(where: { $0.payment == payment }) else { + guard let transaction = transactions.first(where: { $0.payment.productIdentifier == payment.productIdentifier }) else { return } switch transaction.transactionState {