Answering my own question in case someone is interested as I have found zero documentation on this as noted in the original post.
So PaywallView(offering: “StringIdentifier”) does not work. This is because the compiler expects an instance of Offering (Offering? - can be found if digging around a bit). Swift is type safe so it does not work with a string ID immediately matching the offering although that is the natural interpretation of that syntax. For me this just crashed xcode with a general compiler error (“not able to type check the expression in real time...”).
A solution - I’m sure there are plenty - is to load the offerings in the onappear modifier for the view and then call it - PaywallView(offering: selectedOffering).
Definitely approaching a point where doing it native without revenuecat is becoming interesting but the paywall edit is of course nice and handy :)
Hi @dstyp,
Thank you for your post and answer! You are saying that you’ll like to have different paywalls in selected places, have you thought about using Targeting by placement for that? You can define a place and then request the offering for that specific string. In that case, you’ll have already the offering for when presenting the paywall with something like:
let placementOffering = offerings.getCurrentOffering(forPlacement: "onboarding_end")
Offerings should also be cached automatically by the SDK so the call shouldn’t be very long and you can also access the cached data in case you want the offerings inmediatelly.
Let me know if this helps!