Better purchase flow

This commit is contained in:
Thomas Ricouard 2023-01-07 14:06:40 +01:00
parent 42a43ad659
commit 75cd23df5d
1 changed files with 4 additions and 3 deletions

View File

@ -82,10 +82,11 @@ struct SupportAppView: View {
Spacer()
Button {
isProcessingPurchase = true
Purchases.shared.purchase(product: product) { _, _, _, success in
if success {
Task {
do {
_ = try await Purchases.shared.purchase(product: product)
purchaseSuccessDisplayed = true
} else {
} catch {
purchaseErrorDisplayed = true
}
isProcessingPurchase = false