iap work
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user