Is there an issue with displaying Paywalls specifically with an offering and or in the sandbox environment with Xcode builds?
If I use this is shows the paywall instantly
PaywallView()however if I use an offering its blank (as if offering is nil). If I swipe app up to open the app switcher on iOS the paywall is actually loaded and is showing when app re-enters foreground. So wondering if this is a known Xcode sandbox debug issue.
.fullScreenCover(isPresented: $hasToShowPayWall) {
if let offering = offering {
PaywallView(offering: offering, displayCloseButton: true)
}
else{
Text("offerings is somehow nil")
}
}offerings a awaited and fetched before triggering the fullScreenCover. so offering passed in cannot be nil yet it claims it is
@State private var offering: Offering? = nil
if let offering = await availableOfferingWithIdentifier("default") {
await MainActor.run {
offering = offering
withAnimation {
hasToShowPayWall = true
print("💰 Standard paywall needed")
}
}
}
@MainActor
static func availableOfferingWithIdentifier(_ id: String) async -> Offering? {
do {
let offerings = try await Purchases.shared.offerings()
if let matched = offerings.offering(identifier: id) {
if matched.paywall != nil {
print("✅ Offering \(id) ready with paywall.")
return matched
} else {
print("⚠️ Offering \(id) found but no paywall attached yet.")
return nil
}
} else {
print("❌ Offering \(id) not found.")
return nil
}
} catch {
print("💥 Failed to fetch offerings:", error)
return nil
}
}prints “"✅ Offering default ready with paywall."
So every check and await for values is correct but why am I seeing "offerings are nil " in your sheet and not the Paywall with offering?
