diff --git a/Examples/UIKit+RevenueCat/Superwall-UIKit+RevenueCat/RCPurchaseController.swift b/Examples/UIKit+RevenueCat/Superwall-UIKit+RevenueCat/RCPurchaseController.swift index 4733d5ac1..10443a533 100644 --- a/Examples/UIKit+RevenueCat/Superwall-UIKit+RevenueCat/RCPurchaseController.swift +++ b/Examples/UIKit+RevenueCat/Superwall-UIKit+RevenueCat/RCPurchaseController.swift @@ -34,7 +34,7 @@ final class RCPurchaseController: PurchaseController { Task { for await customerInfo in Purchases.shared.customerInfoStream { // Gets called whenever new CustomerInfo is available - let hasActiveSubscription = !customerInfo.entitlements.active.isEmpty // Why? -> https://www.revenuecat.com/docs/entitlements#entitlements + let hasActiveSubscription = !customerInfo.entitlements.activeInCurrentEnvironment.isEmpty // Why? -> https://www.revenuecat.com/docs/entitlements#entitlements if hasActiveSubscription { Superwall.shared.subscriptionStatus = .active } else { diff --git a/Sources/SuperwallKit/Misc/Extensions/PurchaseResult+Internal.swift b/Sources/SuperwallKit/Misc/Extensions/PurchaseResult+Internal.swift index 7d59f7c96..458231a5e 100644 --- a/Sources/SuperwallKit/Misc/Extensions/PurchaseResult+Internal.swift +++ b/Sources/SuperwallKit/Misc/Extensions/PurchaseResult+Internal.swift @@ -19,7 +19,7 @@ extension StoreKit.Product.PurchaseResult { case .verified(let transaction): let transactionDate = transaction.purchaseDate if let purchaseDate = await coordinator.purchaseDate, - transactionDate < purchaseDate { + transactionDate.isAtLeastTwentySecondsBefore(purchaseDate) { return .restored } else { return .purchased diff --git a/Sources/SuperwallKit/StoreKit/Transactions/Purchasing/ProductPurchaserLogic.swift b/Sources/SuperwallKit/StoreKit/Transactions/Purchasing/ProductPurchaserLogic.swift index 525567b33..0eabfd264 100644 --- a/Sources/SuperwallKit/StoreKit/Transactions/Purchasing/ProductPurchaserLogic.swift +++ b/Sources/SuperwallKit/StoreKit/Transactions/Purchasing/ProductPurchaserLogic.swift @@ -56,7 +56,7 @@ enum ProductPurchaserLogic { guard let purchaseDate = purchaseDate else { return false } - // If has a transaction date and that happened at least an hour before purchase + // If has a transaction date and that happened at least 20s before purchase // button was pressed... if let transactionDate = transaction.transactionDate, transactionDate.isAtLeastTwentySecondsBefore(purchaseDate) { diff --git a/Sources/SuperwallKit/StoreKit/Transactions/Purchasing/ProductPurchaserSK1.swift b/Sources/SuperwallKit/StoreKit/Transactions/Purchasing/ProductPurchaserSK1.swift index 1aa95572b..bed1da5b0 100644 --- a/Sources/SuperwallKit/StoreKit/Transactions/Purchasing/ProductPurchaserSK1.swift +++ b/Sources/SuperwallKit/StoreKit/Transactions/Purchasing/ProductPurchaserSK1.swift @@ -289,7 +289,7 @@ extension ProductPurchaserSK1: SKPaymentTransactionObserver { SKPaymentQueue.default().finishTransaction(skTransaction) } - func trackTimeout(paywallViewController: PaywallViewController? = nil) async { + private func trackTimeout(paywallViewController: PaywallViewController? = nil) async { var source: InternalSuperwallEvent.Transaction.TransactionSource = .internal var isObserved = false