diff --git a/CHANGELOG.md b/CHANGELOG.md index b046446fa..561281329 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ The changelog for `SuperwallKit`. Also see the [releases](https://github.com/superwall/Superwall-iOS/releases) on GitHub. +## 4.0.0-beta.6 + +### Breaking Changes + +- Removes the `restored` result from `PurchaseResult`. + ## 4.0.0-beta.5 ### Breaking Changes diff --git a/Examples/Advanced/Advanced.xcodeproj/project.pbxproj b/Examples/Advanced/Advanced.xcodeproj/project.pbxproj index 8b901ef22..141159b23 100644 --- a/Examples/Advanced/Advanced.xcodeproj/project.pbxproj +++ b/Examples/Advanced/Advanced.xcodeproj/project.pbxproj @@ -486,7 +486,7 @@ repositoryURL = "https://github.com/RevenueCat/purchases-ios.git"; requirement = { kind = upToNextMajorVersion; - minimumVersion = 5.14.2; + minimumVersion = 5.16.0; }; }; /* End XCRemoteSwiftPackageReference section */ diff --git a/Examples/Advanced/Advanced.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Examples/Advanced/Advanced.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 30edb57ab..c6f6637d4 100644 --- a/Examples/Advanced/Advanced.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/Examples/Advanced/Advanced.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -6,8 +6,8 @@ "repositoryURL": "https://github.com/RevenueCat/purchases-ios.git", "state": { "branch": null, - "revision": "5c413f2ad1888c0bf3910c863c85435fa5e4308d", - "version": "5.14.2" + "revision": "adde1eff5f88403a3527d812fccc26a08c7203fe", + "version": "5.16.0" } }, { diff --git a/Sources/SuperwallKit/Misc/Constants.swift b/Sources/SuperwallKit/Misc/Constants.swift index fb808720b..d5bafaa20 100644 --- a/Sources/SuperwallKit/Misc/Constants.swift +++ b/Sources/SuperwallKit/Misc/Constants.swift @@ -18,5 +18,5 @@ let sdkVersion = """ */ let sdkVersion = """ -4.0.0-beta.5 +4.0.0-beta.6 """ diff --git a/Sources/SuperwallKit/Misc/Extensions/PurchaseResult+Internal.swift b/Sources/SuperwallKit/Misc/Extensions/PurchaseResult+Internal.swift index 552d20635..e608e4b7f 100644 --- a/Sources/SuperwallKit/Misc/Extensions/PurchaseResult+Internal.swift +++ b/Sources/SuperwallKit/Misc/Extensions/PurchaseResult+Internal.swift @@ -16,7 +16,7 @@ extension StoreKit.Product.PurchaseResult { switch verificationResult { case .unverified(_, let error): return .failed(error) - case .verified(let transaction): + case .verified: return .purchased } case .userCancelled: diff --git a/Sources/SuperwallKit/Paywall/Presentation/Internal/Operators/WaitForSubsStatusAndConfig.swift b/Sources/SuperwallKit/Paywall/Presentation/Internal/Operators/WaitForSubsStatusAndConfig.swift index adfb0795b..04cb0d7f9 100644 --- a/Sources/SuperwallKit/Paywall/Presentation/Internal/Operators/WaitForSubsStatusAndConfig.swift +++ b/Sources/SuperwallKit/Paywall/Presentation/Internal/Operators/WaitForSubsStatusAndConfig.swift @@ -58,13 +58,18 @@ extension Superwall { .throwableAsync() } + // Capture only the cancel action because the whole task is non-sendable and gives a warning. + let cancelTask = { + subscriptionStatusTask.cancel() + } + // Create a 5 sec timer. If the subscription status is retrieved it'll // get cancelled. Otherwise will log a timeout and fail the request. let timer = Timer( timeInterval: 5, repeats: false ) { _ in - subscriptionStatusTask.cancel() + cancelTask() } RunLoop.main.add(timer, forMode: .default) diff --git a/Sources/SuperwallKit/StoreKit/Purchase Controller/PurchaseControllerObjcAdapter.swift b/Sources/SuperwallKit/StoreKit/Purchase Controller/PurchaseControllerObjcAdapter.swift index 83ce77f3d..aab059b0d 100644 --- a/Sources/SuperwallKit/StoreKit/Purchase Controller/PurchaseControllerObjcAdapter.swift +++ b/Sources/SuperwallKit/StoreKit/Purchase Controller/PurchaseControllerObjcAdapter.swift @@ -24,8 +24,6 @@ final class PurchaseControllerObjcAdapter: PurchaseController { switch result { case .purchased: continuation.resume(returning: .purchased) - case .restored: - continuation.resume(returning: .restored) case .pending: continuation.resume(returning: .pending) case .cancelled: diff --git a/Sources/SuperwallKit/StoreKit/Purchase Controller/PurchaseResult.swift b/Sources/SuperwallKit/StoreKit/Purchase Controller/PurchaseResult.swift index fa308c977..cdb99095f 100644 --- a/Sources/SuperwallKit/StoreKit/Purchase Controller/PurchaseResult.swift +++ b/Sources/SuperwallKit/StoreKit/Purchase Controller/PurchaseResult.swift @@ -31,9 +31,6 @@ public enum PurchaseResult: Sendable, Equatable { /// The product was purchased. case purchased - /// The product was restored. - case restored - /// The purchase is pending and requires action from the developer. /// /// In StoreKit 1, this is the same as the `.deferred` transaction state. @@ -64,7 +61,6 @@ public enum PurchaseResult: Sendable, Equatable { switch self { case .cancelled: return .cancelled case .purchased: return .purchased - case .restored: return .restored case .pending: return .pending case .failed: return .failed } @@ -92,9 +88,6 @@ public enum PurchaseResultObjc: Int, Sendable, Equatable { /// The product was purchased. case purchased - /// The product was restored. - case restored - /// The purchase is pending and requires action from the developer. /// /// In StoreKit 1, this is the same as the `.deferred` transaction state. diff --git a/Sources/SuperwallKit/StoreKit/Transactions/TransactionManager.swift b/Sources/SuperwallKit/StoreKit/Transactions/TransactionManager.swift index dd5e4bf9c..fec943736 100644 --- a/Sources/SuperwallKit/StoreKit/Transactions/TransactionManager.swift +++ b/Sources/SuperwallKit/StoreKit/Transactions/TransactionManager.swift @@ -111,8 +111,6 @@ final class TransactionManager { switch result { case .purchased: await didPurchase() - case .restored: - await didRestore() case .failed(let error): let superwallOptions = factory.makeSuperwallOptions() guard diff --git a/SuperwallKit.podspec b/SuperwallKit.podspec index 993f7b2e5..45ad57068 100644 --- a/SuperwallKit.podspec +++ b/SuperwallKit.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "SuperwallKit" - s.version = "4.0.0-beta.5" + s.version = "4.0.0-beta.6" s.summary = "Superwall: In-App Paywalls Made Easy" s.description = "Paywall infrastructure for mobile apps :) we make things like editing your paywall and running price tests as easy as clicking a few buttons. superwall.com"