I use StoreKit's StoreView to buy in-app purchases. The purchase is working in the simulator, but how can I restore purchases? I did not find a restore handler, there is only a onInAppPurchaseCompletion
but I'm missing a onRestorePurchaseCompletion
or similar.
This is how it looks
This is my code:
StoreView(ids: ["my.product.id"])
.storeButton(.visible, for: .restorePurchases)
.storeButton(.hidden, for: .cancellation)
.onInAppPurchaseCompletion { product, result in
if case .success(.success(let transaction)) = result {
print("Purchased successfully: \(transaction.signedDate)")
isPremium = true
} else {
print("Something went wrong")
}
}