<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[AppContinuity]]></title><description><![CDATA[AppContinuity]]></description><link>https://appcontinuity.hashnode.dev</link><image><url>https://cdn.hashnode.com/uploads/logos/6b0cf125c028ae7e8f02d9a9/1856918a-2e6b-4706-82a5-affc4daa73c6.png</url><title>AppContinuity</title><link>https://appcontinuity.hashnode.dev</link></image><generator>RSS for Node</generator><lastBuildDate>Fri, 04 Dec 2026 21:39:47 GMT</lastBuildDate><atom:link href="https://appcontinuity.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Testing subscriptions end to end in App Store sandbox and Play internal testing]]></title><description><![CDATA[This article was first published on AppContinuity. Official Apple, Google, and RevenueCat docs already cover sandbox testers and renewal timers. This piece…]]></description><link>https://appcontinuity.hashnode.dev/testing-subscriptions-end-to-end-in-app-store-sandbox-and-play-internal-testing</link><guid isPermaLink="true">https://appcontinuity.hashnode.dev/testing-subscriptions-end-to-end-in-app-store-sandbox-and-play-internal-testing</guid><category><![CDATA[capacitor]]></category><category><![CDATA[RevenueCat]]></category><category><![CDATA[stripe]]></category><category><![CDATA[supabase]]></category><dc:creator><![CDATA[AppContinuity]]></dc:creator><pubDate>Thu, 03 Dec 2026 17:55:50 GMT</pubDate><content:encoded><![CDATA[<p>This article was first published on <a href="https://appcontinuity.com/articles/testing-subscriptions-in-sandbox-and-play-internal/">AppContinuity</a>.</p>
<p>Official Apple, Google, and RevenueCat docs already cover sandbox testers and renewal timers. This piece is about the exact stack — React + Capacitor, Supabase Auth, Stripe on the web, RevenueCat on iPhone and Android — and the test founders skip after the first successful <code>purchase()</code> call: proving the store path on a real device, watching an accelerated renewal, and confirming the same App User ID in the RevenueCat dashboard before you trust production.</p>
<p>It follows <a href="https://appcontinuity.com/articles/why-a-stripe-subscriber-hits-a-paywall/">why a Stripe subscriber hits a Capacitor paywall</a>, <a href="https://appcontinuity.com/articles/mapping-supabase-auth-to-revenuecat/">mapping Supabase Auth user IDs to RevenueCat</a>, and <a href="https://appcontinuity.com/articles/refunds-transfers-and-which-webhook-updates-access/">refunds, transfers, and which webhook actually updates access</a>. Those cover attaching the web subscription, identifying the signed-in user, and the webhook file. This one is the device session that proves those pieces still agree after a real store purchase.</p>
<h2>The failure mode</h2>
<p>You bought a monthly product in RevenueCat’s Test Store, or in the iOS Simulator with a StoreKit configuration file, and the paywall unlocked. That is useful during development. It is not the same as a store purchase:</p>
<ul>
<li>Test Store never talks to App Store or Play Billing. Shipping with the Test Store API key means production purchases will not be tracked.</li>
<li>StoreKit Testing in Xcode is a local environment. RevenueCat documents that cancel and refund actions you trigger there are not stored in the receipt and will not appear in the dashboard, even if the SDK later drops the entitlement after a restart.</li>
<li>TestFlight uses a production Apple Account and sandbox purchases, but Apple currently renews every TestFlight subscription once per day, up to six times in a week, regardless of duration. That is the wrong clock if you want to watch a monthly renewal in the next five minutes.</li>
<li>A Play internal test track purchase will charge a real payment method unless that Google account is also a license tester. Google is explicit: testers incur actual charges on a test track unless they are license testers.</li>
<li>The Capacitor app can show “entitlement active” from cached <code>CustomerInfo</code> while RevenueCat never received the receipt — or received it under an anonymous App User ID instead of your Supabase <code>user.id</code>.</li>
</ul>
<p>Each of those can look like a passing test. None of them is the pre-launch check.</p>
<blockquote>
<p>A printable <a href="https://appcontinuity.com/checklist/">Capacitor + RevenueCat + Stripe entitlement checklist</a> covers the cases in this article, as a free PDF.</p>
</blockquote>
<h2>What this test is</h2>
<p>Use the platform sandbox, on a physical device, with the platform RevenueCat API keys (Apple and Google), after <code>Purchases.logIn</code> with the Supabase Auth user id. RevenueCat detects sandbox versus production automatically; you do not flip a project setting to “test mode.” You do turn on <strong>View Sandbox Data</strong> in the dashboard, or the transaction will look missing.</p>
<p>The goal is narrow: initiate a purchase, complete it, confirm the entitlement unlocks in the app, then confirm the same customer in RevenueCat. After that, wait through at least one accelerated renewal and, if your webhook file is already in place, confirm the server row still matches.</p>
<h2>App Store sandbox on a real iPhone or iPad</h2>
<p>Create a Sandbox Apple Account in App Store Connect under Users and Access → Sandbox. Use an email address that is not already an Apple Account. Enable Developer Mode on the device. Sign in with that sandbox account in the sandbox slot, not as the device’s personal Apple Account:</p>
<ul>
<li>On current iOS, Settings → Developer → Sandbox Apple Account.</li>
<li>On earlier iOS, Settings → App Store → Sandbox Account.</li>
</ul>
<p>If the field is missing, start a purchase in a development-signed build; Apple will prompt, and the sandbox account then appears in Settings. You do not sign out of your personal Apple Account to buy in sandbox.</p>
<p>Install a development-signed Capacitor iOS build — not an App Store production build, and not a TestFlight build if you want the minutes-scale renewal schedule. Apple’s sandbox can be slow; RevenueCat notes that a sandbox purchase may take upwards of 15 seconds. That is normal. In production, the same flow is usually a few seconds.</p>
<p>By default, a sandbox account uses a speed of <strong>1 month = 5 minutes</strong>. You can change that rate per tester in App Store Connect or in the on-device sandbox settings. Subscriptions automatically renew up to 12 times, and auto-renewal turns off on the thirteenth renewal attempt. After that you can test expiration and a lapse without waiting a real month.</p>
<p><em>Default App Store sandbox renewal speed (1 month = 5 minutes)</em></p>
<table>
<thead>
<tr>
<th>Production duration</th>
<th>Sandbox renewal</th>
</tr>
</thead>
<tbody><tr>
<td>1 week</td>
<td>3 minutes</td>
</tr>
<tr>
<td>1 month</td>
<td>5 minutes</td>
</tr>
<tr>
<td>2 months</td>
<td>10 minutes</td>
</tr>
<tr>
<td>3 months</td>
<td>15 minutes</td>
</tr>
<tr>
<td>6 months</td>
<td>30 minutes</td>
</tr>
<tr>
<td>1 year</td>
<td>1 hour</td>
</tr>
</tbody></table>
<p>Treat store metadata in sandbox as untrustworthy. Prices and currencies in <code>getOfferings()</code> are often wrong here and in TestFlight, even when the purchase sheet is right and the buy succeeds. Test the flow, not the label.</p>
<p>We ran this path on a real iPad with a development-signed Capacitor build and a Sandbox Apple Account. Before the buy, the monthly Pro product loaded a store price and the <code>pro</code> entitlement was not active. After the buy, the app showed the entitlement active and marked the purchase as sandbox. The on-device card only reported whether the entitlement was active — not the expiration — so the five-minute renewals were not something you could watch in the UI alone. That is a useful design constraint: if your paywall only prints “pro is active,” you still have to open RevenueCat (and your webhook log) to prove renewals. A missing URL for our own API did not block the store entitlement from becoming active. That is expected, and it is also the trap: a device flag is not proof that the Supabase row updated.</p>
<h2>Play internal testing, plus license testers</h2>
<p>Google’s test has two lists, and founders often complete only one.</p>
<ol>
<li><strong>License testers</strong> — in Play Console, under license testing. License testers get test payment methods (“always approves,” “always declines,” and slower cards) and the accelerated renewal schedule. Google also lets license testers sideload a build whose package name matches the Play app. Your publishing account is already a license tester. Changes can take a while to propagate.</li>
<li><strong>A testing track</strong> — Google recommends publishing the app to a test track and having each tester open the opt-in URL. Internal testing is the usual first track for a new Capacitor app. A closed track also works; RevenueCat’s own walkthrough uses one. Products and subscriptions must be published before you can buy them. The package name of the build must match the Play application id. After you publish to a track, the release can take a few hours to become available.</li>
</ol>
<p>Both matter. RevenueCat’s matrix is blunt: a tester who opted into the track but is not a license tester is offered a real card. Google says the same: users incur actual charges for test-track purchases unless they are license testers. Draft apps and internal-test releases also have spend limits.</p>
<p>While you are testing, use one Google account on the device — the license tester that opted in. RevenueCat warns that multiple accounts on the device are a sandbox-only source of failed purchases. Google notes that if several accounts are present, the purchase is made with the account that downloaded the app. If products do not load, the usual causes are a skipped opt-in URL, a mismatched application id, or a release that is not available in the tester’s country yet. Some devices also need a PIN before subscriptions will complete.</p>
<p>Play test subscriptions renew faster than production, and they renew a maximum of six times (not counting free trials and introductory periods). Times are approximate; Google tells you to re-read subscription state after each expected expiration.</p>
<p><em>Google Play license-tester subscription renewal periods</em></p>
<table>
<thead>
<tr>
<th>Production period</th>
<th>Test renewal</th>
</tr>
</thead>
<tbody><tr>
<td>1 week</td>
<td>5 minutes</td>
</tr>
<tr>
<td>1 month</td>
<td>5 minutes</td>
</tr>
<tr>
<td>3 months</td>
<td>10 minutes</td>
</tr>
<tr>
<td>6 months</td>
<td>15 minutes</td>
</tr>
<tr>
<td>1 year</td>
<td>30 minutes</td>
</tr>
</tbody></table>
<p>A personal Play developer account must still complete identity checks, and public production has a closed-testing requirement (a group of testers for a stretch of days) before you can sell to everyone. That rule is about launching, not about whether an internal test purchase can go through. You can — and should — run license-tester purchases on an internal track before that production gate.</p>
<h2>What to verify in RevenueCat</h2>
<p>After a successful purchase, the transaction should appear immediately in the dashboard. If it does not, RevenueCat is not tracking it. Before you conclude that, turn on <strong>View Sandbox Data</strong>. There is no separate “sandbox customer” in RevenueCat; the same App User ID can hold sandbox and production receipts, and the toggle only changes which purchases the overview shows.</p>
<p>Check, in order:</p>
<ul>
<li>The App User ID is the Supabase Auth <code>user.id</code> you passed to <code>Purchases.logIn</code>, not a still-anonymous <code>$RCAnonymousID</code>. If it is anonymous, the buy worked for this install and will drift the first time someone signs in — the subject of the <a href="https://appcontinuity.com/articles/mapping-supabase-auth-to-revenuecat/">mapping article</a>.</li>
<li>The purchase is marked sandbox, from App Store or Play, for the product you bought.</li>
<li>The entitlement you gate on is active, with an expiration consistent with the accelerated period (about five minutes for a monthly product on the default Apple rate, or on Play).</li>
<li>After a renewal window: the entitlement is still active. RevenueCat and Apple both warn that, because renewals are so fast, not every renewal is guaranteed to show in the customer dashboard. If you have webhooks, look for <code>RENEWAL</code> in the event log as well.</li>
<li>After you cancel in the device subscription settings: you should see <code>CANCELLATION</code>, but access should remain until <code>EXPIRATION</code> at the end of the current (short) period — the same rule as production, described in the <a href="https://appcontinuity.com/articles/refunds-transfers-and-which-webhook-updates-access/">webhooks article</a>.</li>
<li>After Apple’s twelfth renewal, or Play’s sixth, auto-renew stops. The next expiry should drop the entitlement in the app and in RevenueCat, and your Supabase row should follow if the webhook handler re-fetches the subscriber.</li>
</ul>
<p>Do not use this session as a metadata test. Do not treat a deleted RevenueCat customer as a fresh store buyer: deleting the customer removes RevenueCat’s copy of the receipts, not the App Store or Play purchase history. Restoring will bring those purchases back. To reuse an Apple sandbox tester, clear that tester’s purchase history in App Store Connect. RevenueCat also caps App Store subscription receipts on one customer at 100, which is easy to hit in sandbox and will not happen in production; deleting the RevenueCat customer clears the cap.</p>
<h2>A sequence that actually proves the path</h2>
<p>Run this on iOS first, then the same checks on a real Android device.</p>
<ol>
<li>Sign in to the Capacitor app with Supabase Auth. Call <code>Purchases.logIn</code> with <code>user.id</code> before you show the paywall.</li>
<li>Confirm offerings load from the store (a price appears). Do not fail the test because the currency looks wrong in sandbox.</li>
<li>Buy the monthly product. Wait through a slow Apple sandbox sheet if needed.</li>
<li>In the app, the entitlement is active.</li>
<li>In RevenueCat, with sandbox data visible, the same App User ID has a sandbox transaction and an active entitlement.</li>
<li>Wait one renewal period. Confirm the entitlement is still active, and that a renewal appears in the dashboard or the webhook log.</li>
<li>Cancel from the device subscription settings. Confirm <code>CANCELLATION</code> and that access remains until the short period ends.</li>
<li>After expiration — or after the last automatic renewal — the entitlement is gone in the app, in RevenueCat, and in the Supabase row.</li>
<li>Restore as the same user and confirm the current state (active or expired) comes back under the same App User ID.</li>
<li>Sign out, sign in as a second Supabase user on the same device, and confirm that user does not inherit premium.</li>
</ol>
<p>If step 4 passes and step 5 fails, the store worked and RevenueCat did not see the receipt — usually the wrong API key, or a purchase that never reached the SDK. If step 5 shows an anonymous id, fix identity before you debug webhooks. If the device is entitled and RevenueCat is entitled but Supabase is not, the webhook file is the gap, not Capacitor.</p>
<p>A printable list of these cases lives on the <a href="https://appcontinuity.com/checklist/">free entitlement checklist</a>.</p>
<h2>Short checklist</h2>
<ul>
<li>Use platform API keys, not the Test Store key, for this test.</li>
<li>Identify the Supabase user before the purchase.</li>
<li>Test on a real device: Sandbox Apple Account in the sandbox slot for iOS; license tester plus test-track opt-in for Android.</li>
<li>Do not use TestFlight when you need five-minute monthly renewals; TestFlight currently renews once a day, up to six times.</li>
<li>On Play, being on the internal track is not enough to avoid a real charge. Add the same account as a license tester.</li>
<li>Turn on View Sandbox Data and confirm the transaction, the App User ID, the entitlement, and a renewal — not only a device flag.</li>
<li>Cancel does not revoke early. Expiration does.</li>
<li>Clearing a RevenueCat customer does not clear App Store or Play history.</li>
<li>Stripe web attach is a different path; this test does not replace it. See <a href="https://appcontinuity.com/articles/why-a-stripe-subscriber-hits-a-paywall/">why a Stripe subscriber hits a paywall</a>.</li>
</ul>
<h2>Sources</h2>
<ul>
<li>Apple, overview of testing in sandbox: <a href="https://developer.apple.com/help/app-store-connect/test-in-app-purchases/overview-of-testing-in-sandbox/">https://developer.apple.com/help/app-store-connect/test-in-app-purchases/overview-of-testing-in-sandbox/</a></li>
<li>Apple, create a Sandbox Apple Account: <a href="https://developer.apple.com/help/app-store-connect/test-in-app-purchases/create-a-sandbox-apple-account/">https://developer.apple.com/help/app-store-connect/test-in-app-purchases/create-a-sandbox-apple-account/</a></li>
<li>Apple, manage Sandbox Apple Account settings (renewal rates): <a href="https://developer.apple.com/help/app-store-connect/test-in-app-purchases/manage-sandbox-apple-account-settings/">https://developer.apple.com/help/app-store-connect/test-in-app-purchases/manage-sandbox-apple-account-settings/</a></li>
<li>Apple, testing an auto-renewable subscription: <a href="https://developer.apple.com/documentation/storekit/testing-an-auto-renewable-subscription">https://developer.apple.com/documentation/storekit/testing-an-auto-renewable-subscription</a></li>
<li>Apple, testing subscriptions in TestFlight: <a href="https://developer.apple.com/help/app-store-connect/test-a-beta-version/testing-subscriptions-and-in-app-purchases-in-testflight/">https://developer.apple.com/help/app-store-connect/test-a-beta-version/testing-subscriptions-and-in-app-purchases-in-testflight/</a></li>
<li>RevenueCat sandbox testing: <a href="https://www.revenuecat.com/docs/test-and-launch/sandbox">https://www.revenuecat.com/docs/test-and-launch/sandbox</a></li>
<li>RevenueCat Apple App Store and TestFlight: <a href="https://www.revenuecat.com/docs/test-and-launch/sandbox/apple-app-store">https://www.revenuecat.com/docs/test-and-launch/sandbox/apple-app-store</a></li>
<li>RevenueCat Google Play Store: <a href="https://www.revenuecat.com/docs/test-and-launch/sandbox/google-play-store">https://www.revenuecat.com/docs/test-and-launch/sandbox/google-play-store</a></li>
<li>Google, test Play Billing: <a href="https://developer.android.com/google/play/billing/test">https://developer.android.com/google/play/billing/test</a></li>
<li>Google, license testers: <a href="https://support.google.com/googleplay/android-developer/answer/6062777">https://support.google.com/googleplay/android-developer/answer/6062777</a></li>
</ul>
<p>If you are wiring this stack yourself, the free <a href="https://appcontinuity.com/checklist/">Capacitor + RevenueCat + Stripe entitlement checklist</a> is a printable PDF of the cases above. The canonical version of this article lives at <a href="https://appcontinuity.com/articles/testing-subscriptions-in-sandbox-and-play-internal/">https://appcontinuity.com/articles/testing-subscriptions-in-sandbox-and-play-internal/</a>.</p>
]]></content:encoded></item><item><title><![CDATA[Refunds, transfers, and which webhook actually updates access]]></title><description><![CDATA[This article was first published on AppContinuity. Official RevenueCat docs already list every webhook event type. This piece is about the exact stack…]]></description><link>https://appcontinuity.hashnode.dev/refunds-transfers-and-which-webhook-actually-updates-access</link><guid isPermaLink="true">https://appcontinuity.hashnode.dev/refunds-transfers-and-which-webhook-actually-updates-access</guid><category><![CDATA[supabase]]></category><category><![CDATA[capacitor]]></category><category><![CDATA[RevenueCat]]></category><category><![CDATA[stripe]]></category><dc:creator><![CDATA[AppContinuity]]></dc:creator><pubDate>Tue, 01 Dec 2026 18:05:45 GMT</pubDate><content:encoded><![CDATA[<p>This article was first published on <a href="https://appcontinuity.com/articles/refunds-transfers-and-which-webhook-updates-access/">AppContinuity</a>.</p>
<p>Official RevenueCat docs already list every webhook event type. This piece is about the exact stack — React + Capacitor, Supabase Auth, Stripe on the web, RevenueCat on iPhone and Android — and the narrow question founders hit after the first successful purchase: <strong>which event should change “is this person paid?” in your database</strong>, especially when money moves backward (a refund) or sideways (a transfer or alias).</p>
<p>It follows <a href="https://appcontinuity.com/articles/why-a-stripe-subscriber-hits-a-paywall/">why a Stripe subscriber hits a Capacitor paywall</a> and <a href="https://appcontinuity.com/articles/mapping-supabase-auth-to-revenuecat/">mapping Supabase Auth user IDs to RevenueCat</a>. Those cover attaching the web subscription and identifying the signed-in user. This one is the webhook file you write after that.</p>
<h2>The failure mode</h2>
<p>You handled <code>INITIAL_PURCHASE</code> and maybe <code>RENEWAL</code>. Production looks fine for a week. Then one of these shows up:</p>
<ul>
<li><p>A customer is refunded through Apple, Google, or Stripe. Your admin UI still says premium.</p>
</li>
<li><p>User A buys on a phone. User B logs into the same phone and suddenly has premium. Or A loses it without a cancellation email.</p>
</li>
<li><p>Someone buys while anonymous, then creates a Supabase account. Your webhook log is quiet. Support asks why the new user id has no row.</p>
</li>
<li><p>A Stripe subscription is canceled in the Customer Portal. RevenueCat still shows an active entitlement until the period ends — or, if the Stripe attach is missing, it never updates at all.</p>
</li>
</ul>
<p>Each case is a different event (or a non-event). Treating “any webhook → set paid=true” is how access drifts.</p>
<blockquote>
<p>A printable <a href="https://appcontinuity.com/checklist/">Capacitor + RevenueCat + Stripe entitlement checklist</a> covers the cases in this article, as a free PDF.</p>
</blockquote>
<h2>One entitlement, three writers</h2>
<p>On this stack, three systems can honestly disagree for a few seconds:</p>
<ol>
<li><p><strong>Store / Stripe</strong> — Apple, Google, or Stripe’s own subscription state.</p>
</li>
<li><p><strong>RevenueCat</strong> — <code>CustomerInfo</code> / <code>GET /subscribers</code> for an App User ID.</p>
</li>
<li><p><strong>Your Supabase row</strong> — whatever you wrote last from a webhook or a client flag.</p>
</li>
</ol>
<p>AppContinuity’s rule: <strong>(3) may only change because of (2), and (2) is refreshed after the webhook, not guessed from the event name alone.</strong> RevenueCat’s own webhook guide says the same thing: call <code>GET /subscribers</code> after receiving any webhook, because event payloads are not a uniform snapshot. The Capacitor app reads entitlements for UX; the API trusts the server row (or a server-side RevenueCat check), never a client boolean.</p>
<h2>Alias vs transfer (why your TRANSFER handler never runs)</h2>
<p>Two different identity moves get confused constantly.</p>
<p><strong>Alias (anonymous → <code>logIn(customId)</code>).</strong> Purchase on <code>$RCAnonymousID:…</code>, then <code>Purchases.logIn({ appUserID: supabaseUser.id })</code>. RevenueCat merges those ids onto <strong>one customer</strong>. You will <strong>not</strong> get a <code>TRANSFER</code> webhook. Both ids appear as aliases on the same subscriber. New projects also will not get the legacy <code>SUBSCRIBER_ALIAS</code> event — that type is deprecated. If your backend only inserts rows keyed by the custom id when it sees <code>INITIAL_PURCHASE</code>, the anonymous purchase already fired that event under the anonymous id. After <code>logIn</code>, sync from the app to your API and run <code>GET /subscribers</code>, and resolve aliases on every later webhook.</p>
<p><strong>Transfer (receipt moves between customers).</strong> Typical case: restore (or certain login paths) while project restore behavior is “Transfer to new App User ID.” RevenueCat sends <code>TRANSFER</code> with <code>transferred_from</code> and <code>transferred_to</code>. Current docs are explicit: the webhook is delivered only for the destination user, the event body is identical, and it still lists both sides. There is <strong>no</strong> separate <code>EXPIRATION</code> for the loser and <code>RENEWAL</code> for the winner in that moment. Handle <code>TRANSFER</code> itself, then re-fetch subscriber state for every id in <code>transferred_from</code> and <code>transferred_to</code>.</p>
<p>If you require Supabase login before purchase and you do not want shared-phone entitlement theft, set restore behavior to <strong>Keep with original App User ID</strong> and teach support / <code>RECEIPT_ALREADY_IN_USE</code>. That choice belongs next to your Auth wiring, not only in a webhook file.</p>
<h2>Which webhook should flip access</h2>
<p>Use this as a working map for an entitlement-gated Capacitor app. Always confirm against current <a href="https://www.revenuecat.com/docs/integrations/webhooks/event-types-and-fields">RevenueCat event types and fields</a> — names are stable, but fields evolve. There is <strong>no <code>REFUND</code> event type</strong> in current webhooks. Refunds arrive as <code>CANCELLATION</code>.</p>
<p><em>Which RevenueCat webhook should change the Supabase entitlement row</em></p>
<table>
<thead>
<tr>
<th>Situation</th>
<th>Event(s) you must handle</th>
<th>What to write in Supabase</th>
</tr>
</thead>
<tbody><tr>
<td>First store or RevenueCat-tracked purchase</td>
<td><code>INITIAL_PURCHASE</code> (sometimes <code>NON_RENEWING_PURCHASE</code> for lifetime or promo)</td>
<td>Mark entitled <strong>after</strong> <code>GET /subscribers</code> shows the entitlement active for that app user id</td>
</tr>
<tr>
<td>Subscription continued</td>
<td><code>RENEWAL</code></td>
<td>Refresh expiration / still entitled</td>
</tr>
<tr>
<td>User canceled but the period is not over</td>
<td><code>CANCELLATION</code> with <code>cancel_reason</code> such as <code>UNSUBSCRIBE</code></td>
<td>Store “won’t renew”; do <strong>not</strong> revoke early. Access stays until <code>EXPIRATION</code></td>
</tr>
<tr>
<td>Refund or revoke</td>
<td><code>CANCELLATION</code>, typically with <code>cancel_reason: CUSTOMER_SUPPORT</code>. <code>price</code> may be negative. Fires only when the <strong>latest</strong> subscription period is refunded. App Store only: <code>REFUND_REVERSED</code> if a refund is later reversed</td>
<td><strong>Re-fetch, then write what RevenueCat says.</strong> A refund does not always turn auto-renew off, so do not revoke from the event name alone</td>
</tr>
<tr>
<td>Period ended, or billing failed and any grace period ended</td>
<td><code>EXPIRATION</code></td>
<td>Revoke the entitlement</td>
</tr>
<tr>
<td>Charge failed</td>
<td><code>BILLING_ISSUE</code> (often paired with <code>CANCELLATION</code> / <code>cancel_reason=BILLING_ERROR</code>)</td>
<td>Do not treat this as expired. Keep access through a grace period if you have one; revoke on <code>EXPIRATION</code></td>
</tr>
<tr>
<td>Pause (Google Play)</td>
<td><code>SUBSCRIPTION_PAUSED</code> means the pause is <strong>scheduled</strong> for the end of the current period</td>
<td>Do <strong>not</strong> revoke on this event. Revoke only on <code>EXPIRATION</code> with <code>expiration_reason: SUBSCRIPTION_PAUSED</code></td>
</tr>
<tr>
<td>Product change</td>
<td><code>PRODUCT_CHANGE</code></td>
<td>Re-read entitlements. A period-end downgrade is not in effect immediately</td>
</tr>
<tr>
<td>Receipt moved across app user ids</td>
<td><code>TRANSFER</code> (one delivery, for the destination user, with both id lists in the body)</td>
<td>Revoke <code>transferred_from</code>, grant <code>transferred_to</code> after <code>GET /subscribers</code> on both</td>
</tr>
<tr>
<td>Anonymous aliased into a Supabase user</td>
<td>No <code>TRANSFER</code> (and no <code>SUBSCRIBER_ALIAS</code> on new projects)</td>
<td>Sync on <code>logIn</code>, and use aliases on any later webhook</td>
</tr>
</tbody></table>
<p><strong>Stripe-specific:</strong> attaching a web subscription is not a StoreKit restore. Your server sends the Stripe subscription to RevenueCat (<code>POST /receipts</code> / track external purchases) with the <strong>same</strong> <code>app_user_id</code> you use in <code>Purchases.logIn</code>. Stripe’s own webhooks update <em>your</em> billing tables; <strong>RevenueCat</strong> still needs the attach (and then RevenueCat webhooks / subscriber reads) before the Capacitor app should unlock. A Customer Portal cancel should show up as <code>CANCELLATION</code> (usually <code>UNSUBSCRIBE</code>) and, at period end, <code>EXPIRATION</code>. A Stripe or RevenueCat Billing refund is the <code>CUSTOMER_SUPPORT</code> cancellation path. If a portal cancel never appears in RevenueCat, you have an integration gap, not a Capacitor bug.</p>
<h2>Recommended handler shape</h2>
<p>Pseudo-flow that survives retries:</p>
<pre><code>on webhook(event):
  verify authorization header (and HMAC signature if enabled)
  idempotency_key = event.id   # retries reuse the same id
  ids = affected_app_user_ids(event)  # transferred_from/to and aliases when present
  for id in ids:
    subscriber = GET /v1/subscribers/{id}
    entitled = entitlement_active(subscriber, "your_entitlement_id")
    upsert supabase entitlements for supabase_user = map_rc_id_to_supabase(id, subscriber.aliases)
         set entitled, source_event=event.type, checked_at=now()
  return 200 quickly
</code></pre>
<p>Notes that prevent support tickets:</p>
<ul>
<li><p><strong>Idempotency:</strong> RevenueCat retries, and retries reuse the same <code>event.id</code> and <code>event_timestamp_ms</code>. Processing <code>INITIAL_PURCHASE</code> twice must not double-grant side effects (emails, credits).</p>
</li>
<li><p><strong>Re-fetch:</strong> Event payloads differ by type. <code>GET /subscribers</code> makes every handler the same shape (<a href="https://www.revenuecat.com/docs/integrations/webhooks">webhooks overview</a>).</p>
</li>
<li><p><strong>Alias map:</strong> Store every alias you see so anonymous ids and custom ids resolve to one Supabase user. Search both <code>original_app_user_id</code> and <code>aliases</code>.</p>
</li>
<li><p><strong>Client cache:</strong> Capacitor <code>CustomerInfo</code> can look premium offline for a grace period; <code>logOut</code> clears it. UX can use cache; your API should not.</p>
</li>
</ul>
<h2>Refunds without theater</h2>
<p>A refund is not “set a flag from the App Store email.” Sequence that works:</p>
<ol>
<li><p>The store or Stripe reports a refund. RevenueCat records it as <code>CANCELLATION</code> (typically <code>CUSTOMER_SUPPORT</code>) when it is the latest period — not as a <code>REFUND</code> event, and not for refunds of earlier periods.</p>
</li>
<li><p>Your handler re-fetches subscriber state. If the entitlement is gone, clear it for the mapped Supabase user. If auto-renew is still on, keep what RevenueCat reports.</p>
</li>
<li><p>The next app launch (or customer-info listener) shows the paywall.</p>
</li>
</ol>
<p>If you only listen to Stripe <code>charge.refunded</code> and forget RevenueCat, the iPhone build can stay unlocked until a stale cache dies. If you only listen to RevenueCat and never reconcile Stripe seats, your web app drifts the other way. Same entitlement id on both paths.</p>
<h2>Sandbox cases that prove the webhook file</h2>
<p>Before you trust production (a mirror of the Integration acceptance suite):</p>
<ol>
<li><p>Purchase → row entitled.</p>
</li>
<li><p>Refund (sandbox) → row revoked without reinstalling, once RevenueCat shows the entitlement gone.</p>
</li>
<li><p>Anonymous purchase → <code>logIn(supabase id)</code> → <strong>no</strong> <code>TRANSFER</code>, but the server row exists for the Supabase user after your sync.</p>
</li>
<li><p>User A entitled → <code>logOut</code> → User B login → B not entitled (with keep-with-original, or after you handle <code>TRANSFER</code> correctly).</p>
</li>
<li><p>Stripe attach for user A → Capacitor for A unlocks; B does not.</p>
</li>
<li><p>Replay the same webhook delivery twice → one idempotent write.</p>
</li>
</ol>
<p>A printable list of these cases: <a href="https://appcontinuity.com/checklist/">the free entitlement checklist</a>.</p>
<h2>Short checklist</h2>
<ul>
<li><p>Decide restore behavior before you write webhook code.</p>
</li>
<li><p>Handle <code>TRANSFER</code> explicitly; do not expect a paired expiration and renewal. Update both id lists from the one destination delivery.</p>
</li>
<li><p>Do not expect <code>TRANSFER</code> (or <code>SUBSCRIBER_ALIAS</code>) on an anonymous alias; sync on <code>logIn</code>.</p>
</li>
<li><p>After every webhook, <code>GET /subscribers</code> and write entitlements from that.</p>
</li>
<li><p>Idempotent on <code>event.id</code>.</p>
</li>
<li><p>Map aliases to one Supabase user.</p>
</li>
<li><p>There is no <code>REFUND</code> webhook; refunds arrive as <code>CANCELLATION</code>. Revoke when RevenueCat says the entitlement is gone, on web and mobile together.</p>
</li>
<li><p>Do not revoke on <code>SUBSCRIPTION_PAUSED</code> or on a normal cancel before <code>EXPIRATION</code>.</p>
</li>
<li><p>Stripe cancel and attach are part of the same entitlement story, not a second premium boolean.</p>
</li>
</ul>
<h2>Sources</h2>
<ul>
<li><p>RevenueCat webhooks: <a href="https://www.revenuecat.com/docs/integrations/webhooks">https://www.revenuecat.com/docs/integrations/webhooks</a></p>
</li>
<li><p>RevenueCat event types and fields (including cancellation reasons): <a href="https://www.revenuecat.com/docs/integrations/webhooks/event-types-and-fields">https://www.revenuecat.com/docs/integrations/webhooks/event-types-and-fields</a></p>
</li>
<li><p>RevenueCat common webhook flows: <a href="https://www.revenuecat.com/docs/integrations/webhooks/event-flows">https://www.revenuecat.com/docs/integrations/webhooks/event-flows</a></p>
</li>
<li><p>RevenueCat restore behavior: <a href="https://www.revenuecat.com/docs/projects/restore-behavior">https://www.revenuecat.com/docs/projects/restore-behavior</a></p>
</li>
<li><p>RevenueCat identifying customers: <a href="https://www.revenuecat.com/docs/customers/identifying-customers">https://www.revenuecat.com/docs/customers/identifying-customers</a></p>
</li>
<li><p>RevenueCat Stripe external purchases: <a href="https://www.revenuecat.com/docs/web/integrations/stripe/track-external-purchases">https://www.revenuecat.com/docs/web/integrations/stripe/track-external-purchases</a></p>
</li>
<li><p>RevenueCat Stripe server notifications: <a href="https://www.revenuecat.com/docs/platform-resources/server-notifications/stripe-server-notifications">https://www.revenuecat.com/docs/platform-resources/server-notifications/stripe-server-notifications</a></p>
</li>
</ul>
<p>If you are wiring this stack yourself, the free <a href="https://appcontinuity.com/checklist/">Capacitor + RevenueCat + Stripe entitlement checklist</a> is a printable PDF of the cases above. The canonical version of this article lives at <a href="https://appcontinuity.com/articles/refunds-transfers-and-which-webhook-updates-access/">https://appcontinuity.com/articles/refunds-transfers-and-which-webhook-updates-access/</a>.</p>
]]></content:encoded></item><item><title><![CDATA[Mapping Supabase Auth user IDs to RevenueCat without granting the wrong person’s access]]></title><description><![CDATA[This article was first published on AppContinuity. Official RevenueCat docs already cover generic identifying customers. This piece is about the exact…]]></description><link>https://appcontinuity.hashnode.dev/mapping-supabase-auth-user-ids-to-revenuecat-without-granting-the-wrong-person-s-access</link><guid isPermaLink="true">https://appcontinuity.hashnode.dev/mapping-supabase-auth-user-ids-to-revenuecat-without-granting-the-wrong-person-s-access</guid><category><![CDATA[capacitor]]></category><category><![CDATA[RevenueCat]]></category><category><![CDATA[stripe]]></category><category><![CDATA[supabase]]></category><dc:creator><![CDATA[AppContinuity]]></dc:creator><pubDate>Mon, 30 Nov 2026 03:51:50 GMT</pubDate><content:encoded><![CDATA[<p>This article was first published on <a href="https://appcontinuity.com/articles/mapping-supabase-auth-to-revenuecat/">AppContinuity</a>.</p>
<p>Official RevenueCat docs already cover generic identifying customers. This piece is about the exact stack: a React app wrapped with Capacitor, people signing in with Supabase Auth, subscriptions already on Stripe for the web, and RevenueCat deciding the same entitlement on iPhone and Android — without handing the next person on the phone someone else’s premium.</p>
<p>It pairs with <a href="https://appcontinuity.com/articles/why-a-stripe-subscriber-hits-a-paywall/">why a Stripe subscriber hits a Capacitor paywall</a>: that article is the web-to-app mismatch; this one is the identity wiring that has to be correct first.</p>
<h2>The failure mode</h2>
<p>You configure RevenueCat early. A <code>$RCAnonymousID:…</code> appears. Someone buys, or a Stripe subscription is later attached to the wrong id. Or you call <code>logIn</code> with an email. Or you sign out of Supabase and leave RevenueCat identified. The next session still looks “paid.” Support hears about it before your dashboards agree.</p>
<p>Paid access is only safe when three identifiers line up on purpose:</p>
<ol>
<li><p>Supabase <code>user.id</code> (stable UUID from Auth)</p>
</li>
<li><p>RevenueCat App User ID (custom id after <code>logIn</code>, not email)</p>
</li>
<li><p>Whatever you use to attach Stripe to that same RevenueCat customer</p>
</li>
</ol>
<p>Until they do, web, store, and app each answer “is this person paid?” alone.</p>
<blockquote>
<p>A printable <a href="https://appcontinuity.com/checklist/">Capacitor + RevenueCat + Stripe entitlement checklist</a> covers the cases in this article, as a free PDF.</p>
</blockquote>
<h2>Configure once, identify after Auth</h2>
<p>RevenueCat’s Capacitor flow for “I get my user id later” is: configure without a custom id, then <code>logIn</code> when Auth has a session (<a href="https://www.revenuecat.com/docs/customers/identifying-customers">Identifying Customers</a>):</p>
<pre><code>import { Purchases } from '@revenuecat/purchases-capacitor';
import { supabase } from './supabase';

await Purchases.configure({ apiKey: publicSdkKey });

const { data: { user } } = await supabase.auth.getUser();
if (user) {
  await Purchases.logIn({ appUserID: user.id });
}

supabase.auth.onAuthStateChange(async (event, session) =&gt; {
  if (event === 'SIGNED_IN' &amp;&amp; session?.user) {
    await Purchases.logIn({ appUserID: session.user.id });
  }
  if (event === 'SIGNED_OUT') {
    await Purchases.logOut();
  }
});
</code></pre>
<p>Rules that matter on this stack:</p>
<ul>
<li><p>Use <strong><code>user.id</code></strong>, not email. RevenueCat explicitly advises against emails as App User IDs (guessability and compliance). Supabase emails can change; the user id does not.</p>
</li>
<li><p><strong>Do not hard-code</strong> an App User ID into <code>configure</code>. Every install would share purchases.</p>
</li>
<li><p><strong>Configure once.</strong> Switching identity is <code>logIn</code>, not a second <code>configure</code>.</p>
</li>
<li><p>On <strong>SIGNED_OUT</strong>, call <strong><code>logOut()</code></strong> so RevenueCat creates a fresh anonymous id. If you only clear the Supabase session, the SDK can still report the previous customer’s entitlements.</p>
</li>
</ul>
<p>Supabase’s client exposes <code>onAuthStateChange</code> for exactly this kind of side effect (<a href="https://supabase.com/docs/guides/auth">Supabase Auth docs</a>). Wire RevenueCat there (or in one shared auth helper), not ad hoc in every screen.</p>
<h2>What aliasing does — and does not — merge</h2>
<p>When the current id is anonymous and you <code>logIn</code> with a custom id, RevenueCat may <strong>merge</strong> (alias) that anonymous customer into the custom id. Webhook fields then often show <code>original_app_user_id</code> as the anonymous id and <code>app_user_id</code> as the custom id, with both in <code>aliases</code>.</p>
<p>When the current id is <strong>already a custom id</strong> and you <code>logIn</code> with a different custom id, RevenueCat’s documented behavior is: log out the current custom id and log in the new one — <strong>no merge</strong>. That is the intended account switch. You do not need to call <code>logOut</code> first for that switch, but you <strong>should</strong> call <code>logOut</code> when the user signs out of your app so the logged-out device is not still identified as them.</p>
<p>If your backend keys premium only on <code>app_user_id</code> and ignores aliases / <code>original_app_user_id</code>, restores and “bought while anonymous, then signed in” flows look like missing subscribers. Resolve any of the merged ids to the same Supabase row.</p>
<h2>Gate on entitlements, not on “we saw a login”</h2>
<p>After identity is correct, access is still <code>customerInfo.entitlements.active['your_entitlement_id']</code> (or the same fact from <code>GET /subscribers/{id}</code> on the server) — not “Supabase session exists” and not a boolean you wrote to <code>AsyncStorage</code>.</p>
<p>Client-side <code>CustomerInfo</code> is cached so premium can work offline for a grace period after it was known active; <code>logOut</code> clears that cache. Treat cache as UX, not as the authority your API trusts.</p>
<h2>Stripe must use the same App User ID</h2>
<p>Importing a Stripe subscription into RevenueCat only unlocks the Capacitor app if the Purchases SDK is identified with the <strong>same</strong> App User ID you attached the Stripe purchase to (<a href="https://www.revenuecat.com/docs/web/integrations/stripe/track-external-purchases">Track External Purchases</a>). Practical pattern:</p>
<ol>
<li><p>Checkout completes while the user is signed in with Supabase.</p>
</li>
<li><p>Your backend posts the Stripe <code>sub_…</code> (or Checkout Session id) to RevenueCat with <code>app_user_id: &lt;supabase user.id&gt;</code> and <code>X-Platform: stripe</code>.</p>
</li>
<li><p>The Capacitor app, after <code>logIn</code> with that same id, sees the entitlement.</p>
</li>
</ol>
<p>If Stripe was attached to an anonymous id, or to an email string, the signed-in Supabase user will still hit a paywall. That is the story in the <a href="https://appcontinuity.com/articles/why-a-stripe-subscriber-hits-a-paywall/">first article</a>; identity is the prerequisite.</p>
<h2>Sandbox cases that catch the wrong person</h2>
<p>Before you trust production:</p>
<ol>
<li><p>User A purchases (or gets a Stripe attach) while identified as A → entitlement active.</p>
</li>
<li><p>Sign out (Supabase <strong>and</strong> <code>Purchases.logOut</code>) → paywall for anonymous / empty session.</p>
</li>
<li><p>Sign in as User B → no A entitlement.</p>
</li>
<li><p>Sign back in as A on a fresh install → <code>logIn(A)</code> then restore if needed → entitlement returns for A only.</p>
</li>
<li><p>Purchase while anonymous, then <code>logIn(A)</code> → purchase still on A (alias path); backend accepts alias ids.</p>
</li>
</ol>
<p>A printable checklist that includes these cases: <a href="https://appcontinuity.com/checklist/">the free entitlement checklist</a>.</p>
<h2>Short checklist</h2>
<ul>
<li><p>Configure RevenueCat once with the public SDK key.</p>
</li>
<li><p>After Supabase Auth has a user, <code>Purchases.logIn({ appUserID: user.id })</code>.</p>
</li>
<li><p>On Supabase sign-out, <code>Purchases.logOut()</code>.</p>
</li>
<li><p>Never use email as the App User ID.</p>
</li>
<li><p>Attach Stripe to that same custom id.</p>
</li>
<li><p>Server gates on RevenueCat entitlements for that user, not a client flag.</p>
</li>
<li><p>Webhook / alias handling resolves anonymous and custom ids to one Supabase user.</p>
</li>
<li><p>Run account-switch and anonymous-then-login cases in sandbox.</p>
</li>
</ul>
<h2>Sources</h2>
<ul>
<li><p>RevenueCat, Identifying Customers: <a href="https://www.revenuecat.com/docs/customers/identifying-customers">https://www.revenuecat.com/docs/customers/identifying-customers</a></p>
</li>
<li><p>RevenueCat, Getting Subscription Status: <a href="https://www.revenuecat.com/docs/customers/customer-info">https://www.revenuecat.com/docs/customers/customer-info</a></p>
</li>
<li><p>RevenueCat, Track External Purchases (Stripe): <a href="https://www.revenuecat.com/docs/web/integrations/stripe/track-external-purchases">https://www.revenuecat.com/docs/web/integrations/stripe/track-external-purchases</a></p>
</li>
<li><p>RevenueCat, Caching: <a href="https://www.revenuecat.com/docs/test-and-launch/debugging/caching">https://www.revenuecat.com/docs/test-and-launch/debugging/caching</a></p>
</li>
<li><p>RevenueCat Capacitor SDK <code>logIn</code> / <code>logOut</code>: <a href="https://github.com/revenuecat/purchases-capacitor">https://github.com/revenuecat/purchases-capacitor</a></p>
</li>
<li><p>Supabase Auth (sessions / <code>onAuthStateChange</code>): <a href="https://supabase.com/docs/guides/auth">https://supabase.com/docs/guides/auth</a></p>
</li>
</ul>
<p>If you are wiring this stack yourself, the free <a href="https://appcontinuity.com/checklist/">Capacitor + RevenueCat + Stripe entitlement checklist</a> is a printable PDF of the cases above. The canonical version of this article lives at <a href="https://appcontinuity.com/articles/mapping-supabase-auth-to-revenuecat/">https://appcontinuity.com/articles/mapping-supabase-auth-to-revenuecat/</a>.</p>
]]></content:encoded></item><item><title><![CDATA[Why a Stripe subscriber hits a paywall in your Capacitor iPhone app]]></title><description><![CDATA[This article was first published on AppContinuity. The most common continuity failure we see in this stack is also the one founders describe first: someone…]]></description><link>https://appcontinuity.hashnode.dev/why-a-stripe-subscriber-hits-a-paywall-in-your-capacitor-iphone-app</link><guid isPermaLink="true">https://appcontinuity.hashnode.dev/why-a-stripe-subscriber-hits-a-paywall-in-your-capacitor-iphone-app</guid><category><![CDATA[capacitor]]></category><category><![CDATA[RevenueCat]]></category><category><![CDATA[stripe]]></category><category><![CDATA[supabase]]></category><dc:creator><![CDATA[AppContinuity]]></dc:creator><pubDate>Mon, 30 Nov 2026 03:50:26 GMT</pubDate><content:encoded><![CDATA[<p>This article was first published on <a href="https://appcontinuity.com/articles/why-a-stripe-subscriber-hits-a-paywall/">AppContinuity</a>.</p>
<p>The most common continuity failure we see in this stack is also the one founders describe first: someone pays on the web, opens the iPhone app, and meets a paywall. The web app is sure they are subscribed. The store, RevenueCat, and your Supabase session each have a different idea of who “they” are.</p>
<p>This piece is about that mismatch in a React app wrapped with Capacitor, signed in through Supabase Auth, and billed on the web through Stripe — and what we learned wiring the same entitlement through RevenueCat, including a sandbox purchase run end to end on an iPad.</p>
<p>For the identity wiring itself — <code>logIn</code> with Supabase <code>user.id</code>, <code>logOut</code> on sign-out, and alias rules — see <a href="https://appcontinuity.com/articles/mapping-supabase-auth-to-revenuecat/">mapping Supabase Auth user IDs to RevenueCat</a>.</p>
<h2>Three answers to “is this person paid?”</h2>
<p>On the web, paid access usually means “this Supabase user has an active Stripe subscription.” In the Capacitor app, paid access often starts as “RevenueCat says this <code>appUserID</code> has an active entitlement,” and that ID may have been created before anyone signed in.</p>
<p>RevenueCat will happily create an anonymous app user the first time the SDK is configured without an ID. Purchases made in that anonymous state belong to that anonymous ID. Your Supabase user is a different identifier. Stripe’s customer is a third. Until those three are attached to one RevenueCat customer, each platform is answering the question on its own.</p>
<p>That is why a perfectly valid Stripe subscription does not unlock an iPhone paywall by itself. The App Store never saw that payment, and RevenueCat has not been told that the signed-in Supabase user is the same person who paid on the web.</p>
<blockquote>
<p>A printable <a href="https://appcontinuity.com/checklist/">Capacitor + RevenueCat + Stripe entitlement checklist</a> covers the cases in this article, as a free PDF.</p>
</blockquote>
<h2>Identify the Supabase user before you trust entitlements</h2>
<p>RevenueCat’s Capacitor SDK is configured once, early in the app lifecycle, with the public SDK key. If you do not yet have a signed-in user, you configure without an app user ID. After Supabase Auth has a session, you log that user’s ID in. The method names below are from RevenueCat’s identifying-customers guide (<a href="https://www.revenuecat.com/docs/customers/identifying-customers">https://www.revenuecat.com/docs/customers/identifying-customers</a>):</p>
<pre><code>import { Purchases } from '@revenuecat/purchases-capacitor';

await Purchases.configure({ apiKey: publicSdkKey });

const { data: { user } } = await supabase.auth.getUser();
if (user) {
  await Purchases.logIn({ appUserID: user.id });
}
</code></pre>
<p>Use the stable Supabase user id, not an email address. Emails change; the user id does not. Do not hard-code an app user ID into <code>configure</code> — RevenueCat’s docs warn that every install then looks like the same customer and shares purchases.</p>
<p>Two details that bite Capacitor apps in particular:</p>
<ol>
<li><p>Configure once. Calling <code>configure</code> again when the user signs in is the wrong move. Switch identities with <code>logIn</code>. RevenueCat’s own guidance is that you do not need to <code>logOut</code> first when moving from one custom ID to another; call <code>logIn</code> with the new id.</p>
</li>
<li><p>Log out of RevenueCat when the Supabase session ends. If you only sign out of Supabase and leave the SDK identified, the next person on the phone can inherit the previous entitlement. Account switching is one of the sandbox cases we run for exactly this reason.</p>
</li>
</ol>
<p>When an anonymous ID is later logged in to a custom ID, webhook payloads can show both: <code>original_app_user_id</code> as the anonymous id and <code>app_user_id</code> as the custom id. If your backend keys entitlements only on one of those fields and ignores the other, restores and transfers look like missing subscribers.</p>
<h2>Stripe on the web is not an App Store purchase</h2>
<p>Connecting Stripe web subscriptions to RevenueCat is a separate step from wiring StoreKit or Play Billing. A checkout on your website does not create an App Store transaction. RevenueCat can still grant the same entitlement to the same app user — but only after the Stripe subscription is attached to that user in RevenueCat.</p>
<p>Until that attachment exists, this sequence is normal and confusing:</p>
<ul>
<li><p>The customer pays in your web app, signed in with Supabase.</p>
</li>
<li><p>Stripe shows an active subscription for that customer.</p>
</li>
<li><p>The Capacitor app opens, perhaps still on an anonymous RevenueCat ID, and <code>CustomerInfo</code> has no active entitlement.</p>
</li>
<li><p>Your paywall appears. Support hears about it before you do.</p>
</li>
</ul>
<p>The fix is not “also check Stripe from the iPhone app.” It is: map the Supabase user to a RevenueCat customer, attach the Stripe subscription to that customer, and let one entitlement decide access on web, iPhone, and Android. That is the entitlement-sync deliverable, not an extra SDK call on the paywall screen.</p>
<h2>Do not let the client award access</h2>
<p>Early in our own build we used a sandbox proof whose whole point was that access is decided on the server. The client could send a local “premium” flag along with a request. The server ignored it. Switching identities cleared the previous identity’s premium note immediately. That fixture did not talk to RevenueCat, Apple, Google, or a hosted Supabase project — it was there to make the rule visible: a flag stored on the device cannot be the source of truth.</p>
<p>The same rule applies once the stores are real. Cached <code>CustomerInfo</code> is useful for showing the right UI quickly. It is not a substitute for a server decision keyed to the signed-in Supabase user. If the app can flip a boolean and unlock features, account switching and refunds will drift, and you will not be able to say which dashboard is right.</p>
<p>We later ran a sandbox purchase end to end on an iPad, through the real store sandbox and RevenueCat, so the purchase, the identified user, and the entitlement could be checked together rather than simulated.</p>
<h2>Refunds, transfers, and the webhook you actually handle</h2>
<p>Purchase is only the first event. Refunds, billing-portal cancellations, store transfers, and account switches each update a different record if you treat them as optional cleanup. The follow-up article is <a href="https://appcontinuity.com/articles/refunds-transfers-and-which-webhook-updates-access/">refunds, transfers, and which webhook actually updates access</a>.</p>
<p>A webhook that only handles the initial purchase will leave a web cancellation or an App Store refund sitting in Stripe or App Store Connect while your Supabase user remains marked premium. A webhook that updates “the latest event’s user” without checking a transfer can move access the wrong way when RevenueCat aliases an anonymous ID onto a custom ID.</p>
<p>The reconciliation work is unglamorous and necessary: for each event, identify the RevenueCat app user, map that to the Supabase user, write the entitlement that event implies, and make the write idempotent so a retry does not grant twice or revoke the wrong person. We treated refunds, transfers, and replayed webhooks as part of the same problem, not as follow-up tickets.</p>
<p>That write path also has to survive a crash. If a worker dies after seeing a webhook and before committing the entitlement, the next attempt should finish the same logical event rather than skip it or apply it twice. We exercised abandoned-lease recovery with separate Postgres sessions so one session could take over a lease another session had left behind. We did not independently verify recovery by killing a live OS process, so that remaining case should not be claimed as proven.</p>
<h2>What to run in sandbox before you trust it</h2>
<p>A single successful purchase is not an acceptance suite. The cases we write down and run with a founder in sandbox are:</p>
<ul>
<li><p>Purchase on iPhone or iPad sandbox, then confirm the same entitlement on web.</p>
</li>
<li><p>Subscribe on the web through Stripe, then confirm the Capacitor app unlocks for that signed-in user.</p>
</li>
<li><p>Renewal and cancellation, from the store sandbox and from the Stripe side.</p>
</li>
<li><p>Refund, and the access revocation that should follow.</p>
</li>
<li><p>Restore purchases on a new install of the same account.</p>
</li>
<li><p>Sign out and sign in as a different Supabase user, and confirm premium does not leak.</p>
</li>
</ul>
<p>Those are also the cases that catch the paywall bug this article started with. If you only test “I tapped Subscribe in the iOS sandbox while already logged in,” you will ship the web-to-app hole.</p>
<h2>A short checklist</h2>
<ul>
<li><p>Configure RevenueCat once, with the public SDK key, when the Capacitor app is ready.</p>
</li>
<li><p>After Supabase Auth has a user, call <code>Purchases.logIn</code> with <code>user.id</code>.</p>
</li>
<li><p>Call <code>Purchases.logOut</code> when the Supabase session ends.</p>
</li>
<li><p>Attach Stripe web subscriptions to that same RevenueCat customer; do not expect the App Store to know about a website payment.</p>
</li>
<li><p>Decide access on the server from the entitlement, not from a client-side premium flag.</p>
</li>
<li><p>Handle purchase, renewal, cancellation, refund, restore, and transfer in one reconciliation path, and make that path safe to retry.</p>
</li>
<li><p>Run the sandbox suite on a real device — we used an iPad for the purchase path — not only in a simulated fixture.</p>
</li>
</ul>
<p>If paid access already drifts between your web app and your Capacitor app, start with the free <a href="https://appcontinuity.com/checklist/">entitlement checklist</a>, or use the fit check on <a href="https://appcontinuity.com/">https://appcontinuity.com</a> to describe where it shows up.</p>
<h2>Sources</h2>
<ul>
<li><p>RevenueCat, Identifying Customers: <a href="https://www.revenuecat.com/docs/customers/identifying-customers">https://www.revenuecat.com/docs/customers/identifying-customers</a></p>
</li>
<li><p>RevenueCat, Configuring the SDK: <a href="https://www.revenuecat.com/docs/getting-started/configuring-sdk">https://www.revenuecat.com/docs/getting-started/configuring-sdk</a></p>
</li>
<li><p>RevenueCat, Capacitor installation: <a href="https://www.revenuecat.com/docs/getting-started/installation/capacitor">https://www.revenuecat.com/docs/getting-started/installation/capacitor</a></p>
</li>
</ul>
<p>If you are wiring this stack yourself, the free <a href="https://appcontinuity.com/checklist/">Capacitor + RevenueCat + Stripe entitlement checklist</a> is a printable PDF of the cases above. The canonical version of this article lives at <a href="https://appcontinuity.com/articles/why-a-stripe-subscriber-hits-a-paywall/">https://appcontinuity.com/articles/why-a-stripe-subscriber-hits-a-paywall/</a>.</p>
]]></content:encoded></item></channel></rss>