Skip to main content
.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?

Hi ​@HenadziR - have you tried the presentPaywall or presentPaywallIfNeeded methods? These ways of triggering the paywall should automatically close the paywall, while the manual view needs to be closed when the callbacks are executed (I understand you’ve been having issues with the callbacks). Regarding the callbacks, is this only happening in your testing, or also in production? 

Also, is this for Paywalls V1 or V2?


Frankly speaking I don’t understand these methods presentPaywall or presentPaywallIfNeeded. They are not convenient for me. This is for v2 the latest beta RevenueCat 5.16.0


@jeffrey_bunn I just want to show at the end of onboarding my paywall fullscreen but seems like this is not a use case with Revenue Cat, it is so basic I am surprised that it doesn’t work. Also delegates worked before the update, seems like a regression bug


Ok I found a way how to catch a completion by listening to .onRequestedDismissal callback and checking is any entitlements where activated or not. This should be stated somewhere in your documentation as I spent a decent amount of time on looking up in your codebase a correct callback to use.


Reply