Переглянути джерело

add entitlement revocation only once

Stefanos Zachariadis 5 роки тому
батько
коміт
3e7d70d9bd
1 змінених файлів з 5 додано та 0 видалено
  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)
     }