feat(metadata): support pricing tier and territory availability#3594
Draft
feat(metadata): support pricing tier and territory availability#3594
Conversation
EAS metadata previously had no way to set the App Store price tier or
territory availability, so every new app sat at free / worldwide
forever. Add `pricing` and `availability` blocks to the metadata schema
plus a new `PricingTask` that pulls and pushes both via the legacy
`App.updateAsync({ appPriceTier, territories })` endpoint exposed by
@expo/apple-utils.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Subscribed to pull request
Generated by CodeMention |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3594 +/- ##
==========================================
+ Coverage 54.26% 54.47% +0.22%
==========================================
Files 821 822 +1
Lines 35327 35438 +111
Branches 7363 7397 +34
==========================================
+ Hits 19166 19301 +135
+ Misses 16074 16046 -28
- Partials 87 91 +4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…rty#147 Document the new API surface from expo/third-party#147 that will enable schedule push once @expo/apple-utils is bumped: - AppPriceSchedule.createAsync (replaces entire schedule, no merge) - AppPricePoint.getForAppAsync (resolve tiers to price point IDs) - App.getPriceScheduleAsync (read current schedule) Update the schedule-not-pushed warning to reference the tracking PR. Add comments clarifying territory availability uses the legacy path which is separate from pricing in the modern ASC API. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
❌ It looks like a changelog entry is missing for this PR. Add it manually to CHANGELOG.md. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
EAS metadata previously had no surface area for app pricing or territory availability — every new app stayed at free / worldwide forever, even after a
metadata:push. This adds two new declarative blocks (pricingandavailability) and a newPricingTaskthat handles both pull and push via@expo/apple-utils.{ "configVersion": 0, "apple": { "pricing": { "tier": "0", "schedule": [ { "startDate": "2099-01-01T00:00:00Z", "tier": "5" } ] }, "availability": { "territories": ["USA", "GBR", "JPN"] // or: "territories": "all" } } }PricingTask(packages/eas-cli/src/metadata/apple/tasks/pricing.ts) registered alongside the other Apple tasks. Prepares state by refetching theAppwithprices+availableTerritoriesincludes, downloads into the schema, uploads viaApp.updateAsync({ appPriceTier, territories }).availability.territories: "all"is expanded at upload time againstTerritory.getAsyncso we don't drift if Apple adds territories.allterritories, combined pricing+availability calls, and the prepare-fail path.What works now vs what's blocked
Working now (legacy API):
pricing.tier— sets the active price tier viaApp.updateAsync({ appPriceTier })availability.territories— sets territory availability viaApp.updateAsync({ territories })pricing.scheduleon pull — reads future-datedappPricesrecords into the config for visibilityBlocked on
@expo/apple-utilsbump (expo/third-party#147):pricing.scheduleon push — requiresAppPriceSchedule.createAsyncwhich replaces the entire prior schedule (not a diff/merge). Currently logs a warning and skips.AppPricePoint.getForAppAsyncto map tier names toappPricePointIdvalues.App.getPriceScheduleAsync()for the singularappPriceSchedulerelationship.TerritoryAvailability, separate from pricing. The legacyApp.updateAsync({ territories })path works for both old and new pricing-model accounts.Dependencies
AppPriceSchedule,AppPricePoint,AppPriceextensions to@expo/apple-utils. Schedule push will be wired once this is published.Test plan
yarn jest src/metadata/apple/tasks/__tests__/pricing.test.ts(14/14 passing)yarn jest src/metadata(164 tests passing; 4 pre-existing suite failures unrelated to this PR —@expo/eas-jsonworkspace resolution)yarn lint(0 new errors/warnings)yarn fmt --check(clean)metadata:pullagainst a real app to verify round-trippingmetadata:pushagainst a sandbox app to verify both legacy and new pricing accounts@expo/apple-utilsbumpOpen questions
Is
priceTierstill the right concept? Apple migrated to "base territory" pricing in late 2023, where pricing is anchored to one base territory and apricePointid rather than a global tier. The legacyappPrices/App.updateAsync({ appPriceTier })endpoints still work for many existing apps but accounts on the new model may 404 the legacy paths.@expo/apple-utilsonly exposes the legacy endpoint today, so the implementation uses it and gracefully no-ops ifprepareAsyncfails. The schema is intentionally forward-compatible: adding abasePricePointfield later is non-breaking.Territory validation. The runtime resolver normalizes / dedupes the codes but does not validate them against the live
Territorylist (only the'all'path fetches it). We could add a strict validator, but Apple already returns a clean error on bad codes and the upfront fetch costs a round trip.🤖 Generated with Claude Code