Hello,
I have previously implemented RevenueCat subscriptions using
Purchases.shared.getOfferings { offerings, error in
if let offer = offerings?.current, error == nil { currentOffering = offer }
}
I am now trying to show a different set of upgraded offerings if the specific user already has our base level subscription. I have reviewed the documentation for displaying packages, but there no examples on how to go from fetching a package and getting to a product for purchase.
I have tried to integrate the following code:
Purchases.shared.getOfferings { (offerings, error) in
if let packages = offerings?.offering(identifier: "not the current offerings")?.package(identifier: "Monthly") {
// Display packages for sale}
}
But I don’t know how to display packages, or select them for purchasing. I’ve tried to create a selectedPackage State variable write to it in the function, but that didn't work for me either.
When I use the offerings.current code I can get my products to show up, but if try to fetch from the current offering using the packages code I can’t get the products to fetch. It seems like there should be a more comprehensive example where packages are shown instead of just using current offerings.