Skip to main content

Hello RevenueCat Community,

I’ve been using RevenueCat SDK 7.28.1 for several months with a single "Pro" plan, and everything worked fine. Recently, I added a new "Collaborator" plan within the same offering (premium_access). However, adding this new plan has introduced numerous issues, and I’m now struggling to get everything working as intended.

Offering Structure

Here’s the structure of my offerings:

Each plan includes three products, and they are all grouped within the same premium_access offering, as users cannot be subscribed to both plans at the same time.

JSON Structure Returned by RevenueCat

After extensive testing, I’ve identified the JSON structure RevenueCat is returning when I fetch offerings. Here’s a simplified version that includes the full detail of colab_monthly:

{ "offerings": { "serverDescription": "Unlimited access to all premium features for a monthly/annual price", "metadata": {}, "monthly": { "offeringIdentifier": "premium_access", "product": { "identifier": "com.myapp.pro.monthly", "title": "Trocalia Pro Monthly", "priceString": "5,99 €", "subscriptionPeriod": "P1M", "productCategory": "SUBSCRIPTION", "price": 5.99 }, "identifier": "$rc_monthly", "packageType": "MONTHLY" }, "annual": { "offeringIdentifier": "premium_access", "product": { "title": "Trocalia Pro Annual", "identifier": "com.trocalia.pro.annual", "priceString": "39,99 €", "subscriptionPeriod": "P1Y", "productCategory": "SUBSCRIPTION", "price": 39.99 }, "identifier": "$rc_annual", "packageType": "ANNUAL" }, "availablePackages": b { "identifier": "$rc_monthly", "product": { /* JSON structure for Pro Monthly Product */ } }, { "identifier": "$rc_annual", "product": { /* JSON structure for Pro Annual Product */ } }, { "identifier": "colab_monthly", "product": { "identifier": "com.myapp.colab.mensual", "title": "Trocalia Collaborator Monthly", "currencyCode": "EUR", "priceString": "1,00 €", "subscriptionPeriod": "P1M", "productCategory": "SUBSCRIPTION", "price": 1, "description": "Exclusive access to the Collaborator plan", "productType": "NON_CONSUMABLE", "discounts": "] }, "offeringIdentifier": "premium_access", "packageType": "CUSTOM" }, { "identifier": "colab_annual", "product": { /* JSON structure for Collaborator Annual Product */ } } ], "identifier": "premium_access" } }

 

Difficulties in Retrieving Packages

The main challenge lies in correctly retrieving the new colab plans. With the current configuration, the only way the "Pro" plans work is by using:

 

monthlyOffering = offerings.monthly; annualOffering = offerings.annual;

Any other method to fetch the offerings for "Colab" returns undefined. For example, attempts like:

 

monthlyOffering = offerings.getPackage("colab_monthly"); annualOffering = offerings.getPackage("colab_annual");

or using .find():

 

monthlyOffering = offerings.availablePackages.find( (pkg) => pkg.product.identifier === "com.trocalia.colab.mensual" ); annualOffering = offerings.availablePackages.find( (pkg) => pkg.product.identifier === "com.trocalia.colab.annual" );

all fail and return undefined, causing the app to crash.

Challenges with Testing and Configuration

Testing has also been a real challenge. Since I can only test via TestFlight, every change requires me to build a new preview, which is incredibly time-consuming.

Any guidance or examples from others who have successfully implemented multiple plans would be greatly appreciated.

Thank you in advance for your help!

Albert

Hi,

For getting the package, please see our docs for the recommended methods: https://www.revenuecat.com/docs/getting-started/displaying-products

We also have an example in our GitHub here: https://github.com/RevenueCat/react-native-purchases/blob/80cae4352b6031af1766260868976f9701f4af0d/examples/MagicWeather/src/screens/PaywallScreen/index.js#L24

 

In regards to testing, you can test via XCode for an easier time testing, see our guide here: https://www.revenuecat.com/docs/test-and-launch/sandbox/apple-app-store