I'm running into an issue when using the PaywallViewControllerDelegate
with the RevenueCat iOS SDK version 5.22.2.
I’m presenting the paywall manually using the following code:
extension AppPaywallBuilder {
func build() -> UIViewController {
let viewController = PaywallViewController(offering: subscriptionManager.offering)
viewController.delegate = self
viewController.modalPresentationStyle = .fullScreen
return viewController
}
}
extension AppPaywallBuilder: PaywallViewControllerDelegate {
func paywallViewController(_ controller: PaywallViewController, didStartPurchaseWith package: Package) {
print("aaaa")
}
func paywallViewController(_ controller: PaywallViewController,
didFinishPurchasingWith customerInfo: CustomerInfo) {
print("aaaa")
}
func paywallViewController(_ controller: PaywallViewController,
didFinishRestoringWith customerInfo: CustomerInfo) {
print("aaaa")
}
}
The issue is that none of the delegate methods are being called — not even when I trigger a purchase or tap the "Restore Purchases" button on the default RevenueCat paywall.
I’m using UIKit and presenting the view controller with .present(viewController, animated: true)
as usual.
I’d like to confirm:
-
Should the
PaywallViewController(offering:)
correctly trigger thePaywallViewControllerDelegate
callbacks? -
Is there any additional configuration needed to get these delegate methods to work?
-
If this approach is no longer supported, what is the recommended way to programmatically present a paywall with full delegate support (including restore callbacks)?
Thanks in advance for your help!