Skip to content

docs(offerings): clarify when PurchasesStoreProduct.description can be empty#1642

Open
SamAkinosun wants to merge 1 commit into
RevenueCat:mainfrom
SamAkinosun:clarify-description-jsdoc
Open

docs(offerings): clarify when PurchasesStoreProduct.description can be empty#1642
SamAkinosun wants to merge 1 commit into
RevenueCat:mainfrom
SamAkinosun:clarify-description-jsdoc

Conversation

@SamAkinosun

Copy link
Copy Markdown

Why

PurchasesStoreProduct.description is documented as * Description of the product. with no further detail. Users who see an empty string have no way to know whether that's expected, an SDK bug, or misconfiguration on their end.

This came up in RevenueCat/react-native-purchases#1753, where the reporter saw an empty string on web (RC Test Store) and on Android Play products without a description configured.

What this changes

Expands the JSDoc on PurchasesStoreProduct.description to:

  1. Name the underlying source per platform (verified against purchases-ios and purchases-android source).
  2. Call out the cases where an empty string is expected (Web Test Store, Android products with no Play Console description).
  3. Tell consumers to treat the field as effectively optional even though the type is string.

Verification of platform claims

  • iOS (StoreKit 1): SK1StoreProduct.swift exposes localizedDescription from SKProduct.localizedDescription.
  • iOS (StoreKit 2): SK2StoreProduct.swift exposes localizedDescription from Product.description. Both reflect the App Store Connect description field.
  • Android: storeProductConversions.kt (ProductDetails.toStoreProduct(...)) populates description from ProductDetails.description (Java getDescription()). Returns \"\" when no description is set in Play Console.
  • Web: confirmed in #1753 that the RC Test Store can return empty.

What this does NOT change

No code or behavior changes. Pure JSDoc improvement on a single field.

@SamAkinosun SamAkinosun requested a review from a team as a code owner May 11, 2026 03:37

@tonidero tonidero left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @SamAkinosun, thanks for the contribution! Agreed that the documentation for this property is lacking. I gave a suggestion to what you had to handle more the cases. Right now, description will indeed always be empty for RC Test Store, which is something we should improve. Thanks for the feedback! Once we address the feedback, I think we can get this merged

Comment on lines +95 to +99
* - **Web (RevenueCat Test Store):** may be empty even for live products.
*
* Treat this as effectively optional even though the type is `string`:
* in some store configurations it can be empty even for live products.
* See https://github.com/RevenueCat/react-native-purchases/issues/1753.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this:

Suggested change
* - **Web (RevenueCat Test Store):** may be empty even for live products.
*
* Treat this as effectively optional even though the type is `string`:
* in some store configurations it can be empty even for live products.
* See https://github.com/RevenueCat/react-native-purchases/issues/1753.
* - ** RevenueCat Test Store:** will be an empty string.
* - ** Web (RC Billing): It will be the description of the product which may be empty.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants