Skip to content

Improve Storefront: add change listener and richer storefront data - #5

Merged
charleschen merged 3 commits into
12.16.3-discordfrom
improve-store-front
Mar 10, 2026
Merged

Improve Storefront: add change listener and richer storefront data#5
charleschen merged 3 commits into
12.16.3-discordfrom
improve-store-front

Conversation

@charleschen

@charleschen charleschen commented Mar 3, 2026

Copy link
Copy Markdown

Priority P1

What

  • Add a new Storefront.updates listener that emits "storefront-updated" events when the user's App Store storefront changes
  • Change getStorefront to return a serialized object ({ countryCode, currency }) instead of just a country code string

Why

  • Apps need to react to storefront changes (e.g. user changes their App Store region) so they can refresh pricing or product availability
  • note: currency is only available for iOS 17.0+, so in our client code we still need to handle if it's missing. I think it's still worth while to pass currency so that if there were currency change for a country (without us being aware), the impact is much smaller.

Tests

  • Manual testing of storefront change events and getStorefront return value

Task

  • Complexity or size of the PR is reasonable for efficient review
  • All new code is typed
  • All new code has been unit tested as much as possible
  • Areas for refactoring or improvement are pointed out for follow-up tasks (can be done as a comment on the area)

@charleschen
charleschen marked this pull request as ready for review March 4, 2026 18:35
@charleschen
charleschen requested review from stafa3 and tjmabey March 4, 2026 18:51
Comment thread plugin/build/withIAP.js
const paymentProvider = props?.paymentProvider ?? 'Play Store';
if (!hasPaymentProviderProperValue(paymentProvider)) {
config_plugins_2.WarningAggregator.addWarningAndroid('react-native-iap', `The payment provider '${paymentProvider}' is not supported. Please update your app.json file with one of the following supported values: 'Play Store', 'Amazon AppStore', or 'both'.`);
config_plugins_1.WarningAggregator.addWarningAndroid('react-native-iap', `The payment provider '${paymentProvider}' is not supported. Please update your app.json file with one of the following supported values: 'Play Store', 'Amazon AppStore', or 'both'.`);

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

oh i did not notice this change. i think this is from claude code. i need to see what this is doing

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

oh it's not claude, it's an auto generated file

Comment thread src/iap.ts
@charleschen
charleschen requested a review from tjmabey March 9, 2026 21:28
@charleschen
charleschen merged commit 8ea6a16 into 12.16.3-discord Mar 10, 2026
2 of 3 checks passed
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