AppContinuity
Book a fit check

Articles

Why a Stripe subscriber hits a paywall in your Capacitor iPhone app

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.

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.

For the identity wiring itself — logIn with Supabase user.id, logOut on sign-out, and alias rules — see mapping Supabase Auth user IDs to RevenueCat.

Three answers to “is this person paid?”

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 appUserID has an active entitlement,” and that ID may have been created before anyone signed in.

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.

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.

A printable Capacitor + RevenueCat + Stripe entitlement checklist covers the cases in this article, as a free PDF.

Identify the Supabase user before you trust entitlements

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 (https://www.revenuecat.com/docs/customers/identifying-customers):

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 });
}

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 configure — RevenueCat’s docs warn that every install then looks like the same customer and shares purchases.

Two details that bite Capacitor apps in particular:

  1. Configure once. Calling configure again when the user signs in is the wrong move. Switch identities with logIn. RevenueCat’s own guidance is that you do not need to logOut first when moving from one custom ID to another; call logIn with the new id.
  2. 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.

When an anonymous ID is later logged in to a custom ID, webhook payloads can show both: original_app_user_id as the anonymous id and app_user_id 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.

Stripe on the web is not an App Store purchase

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.

Until that attachment exists, this sequence is normal and confusing:

  • The customer pays in your web app, signed in with Supabase.
  • Stripe shows an active subscription for that customer.
  • The Capacitor app opens, perhaps still on an anonymous RevenueCat ID, and CustomerInfo has no active entitlement.
  • Your paywall appears. Support hears about it before you do.

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.

Do not let the client award access

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.

The same rule applies once the stores are real. Cached CustomerInfo 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.

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.

Refunds, transfers, and the webhook you actually handle

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 refunds, transfers, and which webhook actually updates access.

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.

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.

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.

What to run in sandbox before you trust it

A single successful purchase is not an acceptance suite. The cases we write down and run with a founder in sandbox are:

  • Purchase on iPhone or iPad sandbox, then confirm the same entitlement on web.
  • Subscribe on the web through Stripe, then confirm the Capacitor app unlocks for that signed-in user.
  • Renewal and cancellation, from the store sandbox and from the Stripe side.
  • Refund, and the access revocation that should follow.
  • Restore purchases on a new install of the same account.
  • Sign out and sign in as a different Supabase user, and confirm premium does not leak.

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.

A short checklist

  • Configure RevenueCat once, with the public SDK key, when the Capacitor app is ready.
  • After Supabase Auth has a user, call Purchases.logIn with user.id.
  • Call Purchases.logOut when the Supabase session ends.
  • Attach Stripe web subscriptions to that same RevenueCat customer; do not expect the App Store to know about a website payment.
  • Decide access on the server from the entitlement, not from a client-side premium flag.
  • Handle purchase, renewal, cancellation, refund, restore, and transfer in one reconciliation path, and make that path safe to retry.
  • Run the sandbox suite on a real device — we used an iPad for the purchase path — not only in a simulated fixture.

If paid access already drifts between your web app and your Capacitor app, start with the free entitlement checklist, or use the fit check on https://appcontinuity.com to describe where it shows up.

Sources

Book a fit check

If this is the drift you are seeing, tell us about your app. If the stack matches, we will email you to confirm scope. Or work through the free Capacitor + RevenueCat entitlement checklist first. Related reading: testing subscriptions in App Store sandbox and Play internal testing, refunds, transfers, and which webhook actually updates access, and why Play review says the item you were attempting to purchase could not be found. Prices for the Continuity Audit, Integration, and Continuity Care are on the site.