Hi friends, i am working on project using swift revenuecat as the purchasing library,
now i want to detect from my code if the paywall was not set for the offering, but i cant find any way to do that,
the problem is the return value from offerings.current.paywall is always nil, ofcourse i already setup in the dashboard, event the paywall can be shown in app
if there is some one who have any experience with this, please help?
here is my code to make more clean,
Purchases.shared.getOfferings { offerings, error in
guard let offering = offerings?.current, error == nil else {
print("❌ Failed to fetch offerings:", error?.localizedDescription ?? "")
// fallback to custom popup if failed
presentCustomSubscription(on: visibleController)
return
}
print("Current offering:", offerings?.current?.identifier ?? "none")
print(offering.paywall?.templateName ?? "none");
// Check if paywall is set
if let paywall = offering.paywall {
print("✅ Paywall is set: \(paywall)")
} else {
print("⚠️ No paywall set for this offering.")//<-always go here because curent paywall is always nil
return
}
}
thank you
