I’m unable to get the onPurchaseCompleted
handler working while testing the purchase. This handler manages the post-purchase UI updates. I am using paywall version 2
PaywallView()
.onPurchaseStarted{ _ in
print("onPurhaseStarted: ")
}
.onPurchaseCompleted{ _ in
print("onPurchaseCompleted: ")
isPaywallPresented = false
}
.onRestoreStarted {
print("onRestoreStarted: ")
}
.onRestoreCompleted{ _ in
print("onRestoreCompleted: ")
isPaywallPresented = false
}
.onPurchaseFailure { error in
print("purchase error \(error)")
isPaywallPresented = false
}
.onRequestedDismissal {
print("onRequestedDismissal: ")
isPaywallPresented = false
}
.onDisappear {
print("ModalView dismissed") // Action when dismissed
}