.sheet(isPresented: $paywall.displayPaywall) {
PaywallView(
offering: paywall.selectedOffering ?? Offering(identifier: "default", serverDescription: "default", availablePackages: []),
displayCloseButton: true)
.onPurchaseCompleted({ customerInfo in
analyseFood()
})
.onRestoreCompleted({ customerInfo in
analyseFood()
})
.ignoresSafeArea()
}
iOS 16.7.10
RevenueCat 5.16.0
The iOS version is a bit old but I use a separate phone with a sandbox account for testing purchases though.
These callbacks are never called onPurchaseCompleted and onRestoreCompleted, also after test/sandbox purchase the Paywall doesn’t dismiss itself and stays on the screen. I have another screen written with UIKit and everything is OK with the Paywall UI invocation but SwiftUI version has weird problems.
Also its strange that I cannot pass offering as an optional value into Paywall.init as your SDK returns offerings as optional values.
------------------------------------------------------------------------------------------------
Am I doing in the sample something wrong, could you direct me please?