This commit is contained in:
Trey t
2022-12-23 11:51:22 -06:00
parent 2c8772f79a
commit 87865571c1
4 changed files with 43 additions and 9 deletions

View File

@@ -143,6 +143,11 @@ class IAPManager: ObservableObject {
public func updateEverything() {
Task {
DispatchQueue.main.async {
self.subscriptions.removeAll()
self.purchasedProductIDs.removeAll()
}
// get current sub from local cache
await updatePurchasedProducts()
@@ -365,6 +370,14 @@ class IAPManager: ObservableObject {
}
}
public func restore() async {
do {
try await AppStore.sync()
} catch {
print(error)
}
}
func checkVerified<T>(_ result: VerificationResult<T>) throws -> T {
//Check whether the JWS passes StoreKit verification.
switch result {