Jelajahi Sumber

add entitlement revocation only once

Stefanos Zachariadis 5 tahun lalu
induk
melakukan
3e7d70d9bd
1 mengubah file dengan 5 tambahan dan 0 penghapusan
  1. 5 0
      Sources/SwiftyStoreKit/PaymentQueueController.swift

+ 5 - 0
Sources/SwiftyStoreKit/PaymentQueueController.swift

@@ -248,6 +248,11 @@ class PaymentQueueController: NSObject, SKPaymentTransactionObserver {
     }
     
     func paymentQueue(_ queue: SKPaymentQueue, didRevokeEntitlementsForProductIdentifiers productIdentifiers: [String]) {
+        guard entitlementRevocation == nil else {
+            print("SwiftyStoreKit.onEntitlementRevocation() should only be called once when the app launches. Ignoring this call")
+            return
+        }
+
         self.entitlementRevocation?.callback(productIdentifiers)
     }