Skip to main content
Question

Detecting Configured Paywalls in Offerings – Built-in Flag or Recommended Approach?


Forum|alt.badge.img

Hi RevenueCat Community,

I’m currently developing a React Native app and using a custom paywall implementation. We’re now considering switching to the SDK’s paywall if one is configured for the user's current offering. However, we’ve encountered a challenge: the RevenueCat API response doesn’t seem to include an explicit flag or property indicating whether a paywall is configured for an offering. If showing the UI Paywall without a paywall configured, a default, rather bland screen is shown.

At the moment, we rely on naming conventions (e.g., identifiers like "sandbox_no_paywall" vs. "sandbox_offer") and occasionally custom metadata fields, but this approach feels hacky and a bit fragile.

I’m curious:

  • Is there a built-in or recommended way within RevenueCat to detect whether a paywall is configured for an offering?
  • Are there any best practices or plans to support a native flag (e.g., "hasPaywall": true) in the API response?
  • If not, what do you recommend as the best approach to distinguish between offerings with and without a paywall, especially in a React Native environment?

Any insights or recommendations would be greatly appreciated!

Thanks in advance,
fishbrain

This post has been closed for comments

2 replies

joan-cardona
RevenueCat Staff
Forum|alt.badge.img+6
  • RevenueCat Staff
  • 315 replies
  • February 7, 2025

Hi ​@fishbrain,

It’s not very documented but inside every `offering` you’ll be able to find paywall configuration, if the paywall is configured. For offerings without paywall, this data will be `null` so you can use that logic to know if you have a paywall attached to that offering.

 

Let me know if this helps!


Forum|alt.badge.img
  • Author
  • New Member
  • 1 reply
  • February 18, 2025

Hey,
thank you for replying. I tried finding any configuration related to the paywall but was unable. Am I blind or maybe the React Native SDK doesn’t have it? 
I’m querying the current offering like this:

const offerings = await Purchases.getOfferings();
setCurrentOffering(offerings.current);

Here is the response (the response for an offering with a paywall has the same structure, no paywall config):

{
  "serverDescription": "A Sandbox Offering without a Paywall",
  "metadata": {},
  "identifier": "sandbox_no_paywall",
  "availablePackages": [
    {
      "packageType": "ANNUAL",
      "offeringIdentifier": "sandbox_no_paywall",
      "presentedOfferingContext": {
        "placementIdentifier": null,
        "targetingContext": null,
        "offeringIdentifier": "sandbox_no_paywall"
      },
      "identifier": "$rc_annual",
      "product": {
        "productType": "AUTO_RENEWABLE_SUBSCRIPTION",
        "productCategory": "SUBSCRIPTION",
        "pricePerYear": 37.9,
        "currencyCode": "EUR",
        "introPrice": {
          "cycles": 1,
          "price": 0,
          "priceString": "€0.00",
          "periodNumberOfUnits": 2,
          "period": "P2W",
          "periodUnit": "WEEK"
        },
        "pricePerWeek": 0.73,
        "identifier": "g_2999_1y_2w0",
        "price": 37.9,
        "pricePerMonth": 3.16,
        "priceString": "€37.90",
        "subscriptionPeriod": "P1Y",
        "pricePerWeekString": "€0.73",
        "discounts": [],
        "pricePerYearString": "€37.90",
        "description": "Discounted Annual Subscription",
        "title": "Discounted Annual Subscription",
        "pricePerMonthString": "€3.16"
      }
    }
  ],
  "annual": {
    "identifier": "$rc_annual",
    "presentedOfferingContext": {
      "placementIdentifier": null,
      "targetingContext": null,
      "offeringIdentifier": "sandbox_no_paywall"
    },
    "packageType": "ANNUAL",
    "product": {
      "productCategory": "SUBSCRIPTION",
      "pricePerYearString": "€37.90",
      "description": "Discounted Annual Subscription",
      "pricePerMonth": 3.16,
      "priceString": "€37.90",
      "identifier": "g_2999_1y_2w0",
      "discounts": [],
      "productType": "AUTO_RENEWABLE_SUBSCRIPTION",
      "title": "Discounted Annual Subscription",
      "pricePerMonthString": "€3.16",
      "currencyCode": "EUR",
      "pricePerWeek": 0.73,
      "introPrice": {
        "price": 0,
        "periodNumberOfUnits": 2,
        "period": "P2W",
        "priceString": "€0.00",
        "cycles": 1,
        "periodUnit": "WEEK"
      },
      "pricePerYear": 37.9,
      "subscriptionPeriod": "P1Y",
      "pricePerWeekString": "€0.73",
      "price": 37.9
    },
    "offeringIdentifier": "sandbox_no_paywall"
  }
}

 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings