Repository navigation
fix(mobile): accept global Apple creator discount tiers - #2995
Merged
Merged
Conversation
- Require 20% to 30% off: a deeper discount is a catalog typo (7.1 for 71), and the paywall would advertise it while Apple charges the real price. - Compare against 80% of the regular price instead of the rounded amount, matching the API so a server-accepted price is never rejected on device. - Send `priceTiers: true` so the API serves tier prices only to builds that accept them; older builds keep getting exact rows and never burn a code.
Chadpiha
approved these changes
Oct 28, 2026
Chadpiha
left a comment
Collaborator
There was a problem hiding this comment.
Approving with follow-up fixes pushed in f1a9f91, matching the API companion (OpenWhispr/openwhispr-api#342, a2b6248e):
- Discount floor: offers must now be 20% to 30% off. Before, a catalog typo (DKK 7.1 for 71) would show on the paywall while Apple charged the real price.
- Strict 20%: the limit is now 80% of the regular price, not the rounded amount, so any price the API accepts is also accepted on device.
priceTiers: true: the app sends this with the offer request, so the API serves tier prices only to builds that accept them. Older builds keep getting exact rows and never burn a code.
Verified on Node 24: 12 affiliate/paywall/Superwall/PaywallStep suites pass (218/218); tsc, ESLint and prettier clean.
Release notes:
- Ship only after the API deploys. The current API returns 400 for the new field, which fails safe: no offer and no code allocated.
- The branch is 5 commits behind main (#2875 touches mobile). Merge main if Mobile static's expo doctor fails.
- Please refresh the PR description.
3 of 5 tasks
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.
Global creator discounts fail when an Apple price tier gives more than exactly 20% off. For example, Denmark's DKK 89 monthly subscription can offer DKK 71, but the client rejects it because it expects DKK 71.20.
Accept positive, currency-valid offer prices at or below the rounded 20%-off threshold. Preserve the actual StoreKit product/price, storefront, account, consent, expiry and Apple redemption URL checks. Requires the matching API validator change and a mobile release before global creator offers can work on existing devices.
Validation: 50 offer/paywall tests pass, including tier regression cases; mobile typecheck and changed-file ESLint pass. No new UI or native dependency changes. Packaged live redemption remains a release verification step.
Companion API change: https://github.com/OpenWhispr/openwhispr-api/pull/342. Chad review requested. Mobile CI (static checks, tests, bundles and native Swift tests) passes.
Production launch preparation: 5,000 Apple codes are imported; a verified 174-storefront catalog is staged in Vercel with the offer disabled. Campaign
creator-global-20pct-3months-20261028expires 2027-04-27 07:00 UTC. China mainland is excluded from the backend catalog because the subscription is not currently sold there.Release this validator with the API companion before activating global offers. TestFlight 1.2.6 (44) still rejects prices below its exact rounded 20%-off calculation. A real redemption on the compatible App Store build and payment/attribution verification remain outstanding. This PR does not activate production settings, create a release or run a migration.