Skip to content
SaaS Development30 November 2026 · 11 min read

Design Offline Subscription Access in Flutter

A cached isActive flag should decide what your Flutter app shows offline, not what your server allows. Add an unconfirmed state, a per-feature policy and five launch tests.

Design Offline Subscription Access in Flutter

What you'll learn

  • What RevenueCat keeps on the device
  • Why one boolean fails in both directions
  • Model three access states per user
Article contents

A subscriber opens your Flutter app on a train with no signal and gets a paywall, even though they paid last week. Or the opposite happens: someone cancels, keeps the phone in airplane mode, and the app goes on treating a cached premium flag as permission for everything, including the server features that cost you money to run. Both bugs come from the same shortcut. The app reads one boolean, isActive, and uses it for presentation and for authorization at once.

The fix is to split those jobs. Let the cached RevenueCat state decide what the app shows and which local features open. Let a server you control decide every operation that runs on your backend. Between "paid" and "free", add a third state, "unconfirmed", for the times the device cannot know, and write down what each feature does in each state.

What RevenueCat keeps on the device

RevenueCat caches the customer's subscription data so the app does not need the network for every check. The caching documentation and the CustomerInfo guide describe the behavior this design depends on. Both pages were checked on 30 November 2026; recheck them against the SDK version you ship.

Documented behaviorWhat it means for your policy
The cache refreshes when it is older than 5 minutes in the foreground or 25 hours in the background, but only when you call getCustomerInfo(), or after a purchase or restoreCall Purchases.getCustomerInfo() when the user reaches a premium screen and when the app resumes
Cached CustomerInfo "will be returned while offline forever if the user never goes online"An offline launch still gets an answer, which may be old
An entitlement that was active when the user went offline stays active "for up to three days" without reconnectingA long offline period can turn a paying user into an inactive result
Updates are not pushed from RevenueCat; they arrive only after an outbound request from the appA cancellation or refund becomes visible only after the app asks again
logOut clears the cacheAccount switching starts from fresh data for the next user
requestDate "is affected by the cache on device"Do not use it as the current time

RevenueCat also has Offline Entitlements, which starts when the SDK cannot reach RevenueCat's servers. The same page says it does not cover one-time purchases and does not recognize purchases across platforms while it is active. Treat it as outage resilience for purchases, not as your offline policy.

The Flutter API is small. In purchases_flutter 12.0.0, getCustomerInfo() takes no arguments, so the Flutter SDK does not expose a fetch policy. None of the documented CustomerInfo fields says whether a result came from the cache or the network. Your code has to work without knowing that. If the purchase flow itself is not in place yet, start with setting up a Flutter subscription paywall with RevenueCat.

Why one boolean fails in both directions

isActive == false can mean three different things. The customer never paid. The customer cancelled and the period ended. Or the customer paid and the device has not been able to confirm it, for example after a long offline stretch or on the first launch after a reinstall. RevenueCat's own guide says CustomerInfo is empty when no purchases have been made and no transactions have been synced, so a device that has never synced looks like a free user.

isActive == true also has limits. It describes the last state the device saw. It does not prove that the subscription is still valid now, and the client cannot prove it to anyone, because the device and everything on it belongs to the user.

So keep the boolean, but stop treating it as the final answer. Map it to an access state that includes what the app has confirmed for this user.

Model three access states per user

Store the last state your app confirmed for each RevenueCat App User ID, then resolve the current state from that record and the latest CustomerInfo.

Access stateWhen the app uses it
PaidThe latest CustomerInfo has the entitlement active
FreeThe entitlement is inactive and your server confirmed "not entitled" for this user
UnconfirmedThe entitlement is inactive but the app has never confirmed "free" for this user, or reading CustomerInfo failed

Here is a minimal reference implementation. It uses shared_preferences for the per-user record and a placeholder pro entitlement. It is a sketch for this article and has not been compiled or run against a store sandbox.

import 'package:purchases_flutter/purchases_flutter.dart';
import 'package:shared_preferences/shared_preferences.dart';

enum Access { paid, free, unconfirmed }

const entitlementId = 'pro'; // Your RevenueCat entitlement identifier.

String _key(String appUserId) => 'confirmedAccess:$appUserId';

Future<Access> resolveAccess(SharedPreferences prefs) async {
  final appUserId = await Purchases.appUserID;
  try {
    final info = await Purchases.getCustomerInfo();
    if (info.entitlements.active.containsKey(entitlementId)) {
      await prefs.setString(_key(appUserId), 'paid');
      return Access.paid;
    }
  } catch (_) {
    return Access.unconfirmed;
  }
  return prefs.getString(_key(appUserId)) == 'free'
      ? Access.free
      : Access.unconfirmed;
}

// Call only with a result from your own server, never from a cached value.
Future<void> recordServerAnswer(
    SharedPreferences prefs, String appUserId, bool entitled) {
  return prefs.setString(_key(appUserId), entitled ? 'paid' : 'free');
}

Two details matter. The record is keyed by App User ID, so one account's confirmed state never leaks into another account on the same phone. And "free" is written only from a server answer, so a stale or empty cache cannot downgrade a paying user to "free" on its own. If you enable Trusted Entitlements, also treat a failed verification result as unconfirmed. That feature reports signature checks against tampered network responses, and RevenueCat says that enabling it "does not automatically protect your app": your code decides what to do with the result.

Decide what each feature does in each state

Write the policy as a table before you write UI code. The example below uses a synthetic note-taking app with downloadable premium templates and a server-side "summarize" feature. Your rows will differ.

A matrix with three columns, paid, unconfirmed and free, and four rows: your own notes, downloaded premium templates, new premium downloads and server summaries. Own notes stay open in every state, downloaded templates open while paid or unconfirmed, and new downloads and summaries are decided by the server for paid and unconfirmed users and show an upgrade screen for free users.

The matrix shows the main rule. Work the user created never depends on the subscription state, so a downgrade or a dead network never locks someone out of their own notes. Premium items already on the device open while the state is paid or unconfirmed, because blocking a paying customer who is offline is the failure you are trying to remove. Anything that runs on your backend asks your backend, in every state.

FeaturePaidUnconfirmedFree
Read and edit your own notesOpenOpenOpen
Open premium templates already downloadedOpenOpen, with a "reconnect to confirm" noticeShow upgrade screen
Download a new premium templateServer decidesServer decidesShow upgrade screen
Run a server summaryServer decidesServer decidesShow upgrade screen

Keeping downloaded premium items open while unconfirmed is a product choice. A person who cancels and never reconnects can keep reading what is already on the device. No client-only rule can prevent that, because the files and the check both live on hardware the user controls. If that exposure is too large for your content, you can limit the number of unconfirmed launches. A launch counter does not read the clock, but it is still client-side state that a determined user can reset.

Write the notice for the unconfirmed state carefully. "Your subscription has ended" is wrong when the app simply cannot check. Something like "We can't confirm your subscription offline. Your downloaded templates are still available." tells the user what works and what to do.

The device clock is not a security boundary

A hand turns back the hands of a brass desk clock with a blank dial, next to a smartphone lying face-up on a dark wooden desk

If your own code compares an expirationDate with DateTime.now() to decide access, it reads a clock the user can change in system settings. Moving the clock back can make an expired period look current to that comparison. RevenueCat's guide also warns against using requestDate as the current time.

That is why the policy above has no client-side expiry rule for server work. The server compares dates with its own clock and its own record of the subscription. On the device, an expiry date is useful for display, such as "renews on" text, and not for authorization.

Let the server authorize online work

Every backend operation behind the paywall should check entitlement on the server for the authenticated user. Two documented patterns fit:

  1. Look up the user on demand. RevenueCat's REST API has GET /v1/subscribers/{app_user_id}, which returns the customer's entitlements, including expired ones with their expires_date. Call it from your backend only. RevenueCat's API overview says secret keys must stay out of client-side code.
  2. Keep a server-side mirror updated by webhooks and check that record. If web subscriptions are billed through Stripe, follow the Stripe webhook guide: verify the Stripe-Signature header, record event IDs to ignore duplicates, and do not depend on events arriving in order.

Either way, the server must map the signed-in user to the same App User ID the app passes to Purchases.logIn. If the app uses anonymous RevenueCat IDs, the server has no signed-in identity to look up, so give signed-in users your own stable user ID.

The server record can carry more than paid or free. Trials, grace periods and past-due payments are described in SaaS subscription lifecycle states; map each one to paid or free for the device before you send it.

When the server answers, return the decision to the app and store it with recordServerAnswer. That one call does two useful jobs: it unlocks the action the user asked for, and it gives the device a confirmed "free" or "paid" for later offline launches.

Refresh on reconnect, switch accounts and show downgrades

RevenueCat does not push changes to the device, so plan the moments when your app asks again.

  1. On app resume and when connectivity returns, call Purchases.getCustomerInfo() and then your server's entitlement check. Recompute Access.
  2. Register Purchases.addCustomerInfoUpdateListener to recompute Access whenever the SDK receives changed CustomerInfo. RevenueCat documents that these updates come only from outbound network requests.
  3. On sign-out, call Purchases.logOut(), which clears the SDK cache. If your app only uses your own user IDs, RevenueCat's identity guide recommends switching with Purchases.logIn() directly instead, because logOut() creates an anonymous ID.
  4. On sign-in, use the customerInfo returned in LogInResult and load only the new user's access record and downloads. Store downloaded premium files under a per-user directory so a second account never sees the first account's content.
  5. When Access changes from paid to free, show what changed and what still works. Keep the user's own notes open and offer the upgrade screen on premium actions.

Where FlutterFlow stops and custom code starts

FlutterFlow's RevenueCat integration provides Paywall, Purchase and Restore Purchases actions. The Paywall action checks whether the user has purchased an item and can open the paywall. The page does not describe offline behavior, a per-user confirmed state or server authorization, and it notes that RevenueCat purchases are not available on the web.

Use the built-in actions for buying and restoring. Put resolveAccess and recordServerAnswer in a custom action, store the result in app state, and drive conditional visibility from that value. The server check belongs in a Cloud Function or your own API, not in a FlutterFlow action.

Test five launches before you ship

These are the acceptance checks for the policy. They were not run for this article. Use store sandbox accounts, and give every test user a real App User ID through Purchases.logIn.

  1. Paid user, known online: launch online, confirm the state is paid, enable airplane mode, force-quit and relaunch. Expected: paid, downloaded templates open, the summary button explains that it needs a connection.
  2. Free user, known online: launch online so your server confirms "not entitled", go offline and relaunch. Expected: free, own notes editable, premium items show the upgrade screen.
  3. Unknown: sign in a user with no purchases while your entitlement endpoint is unreachable, for example through a debug flag that points it at a closed port. Expected: unconfirmed, with the reconnect notice instead of "subscription ended".
  4. Account switch: sign out the paid user, sign in the free user and open the templates screen. Expected: the paid user's downloads are not listed and the state comes from the new user's record.
  5. Entitlement change and reconnect: let a sandbox subscription expire while the app is offline, reconnect and resume the app. Expected: the server reports not entitled, Access becomes free, the downgrade message appears and own notes stay editable.

Limits of this design

The client never enforces anything tamper-proof. Cached state, downloaded files and local counters all sit on a device the user controls, and Trusted Entitlements reports tampered network responses rather than locking down the device. The three-day offline window comes from RevenueCat's caching documentation, so read it again when you upgrade the SDK. Offline Entitlements has its own platform and purchase-type limits. The Dart code here is a reference sketch, not a tested package.

Start with the table. List every premium feature in your app, mark whether it runs on the device or on your server, and fill in the paid, unconfirmed and free columns before you change any code.

Free resource

Free SaaS MVP Scope Template

A Notion document with the full feature checklist, MVP vs. nice-to-have table, pre-build questions, and cost signals — so you walk into any developer call knowing exactly what to ask for.

Get the template →
DL

Dusko Licanin

Full-Stack Developer · Banja Luka, Bosnia

Full-stack developer shipping SaaS MVPs, web apps, and mobile apps using AI-augmented workflows — without agency coordination overhead. Live portfolio: BookBed, Callidus, Pizzeria Bestek.

Frequently Asked Questions

How long does RevenueCat cache CustomerInfo in Flutter?

The SDK refreshes cached CustomerInfo when it is older than 5 minutes in the foreground or 25 hours in the background, but only when you call getCustomerInfo(), or after a purchase or restore. The caching documentation also says cached data is returned offline if the user never goes online again, and that an entitlement active when the user went offline stays active for up to three days. Recheck these values for the SDK version you ship.

Does an empty CustomerInfo offline mean the user is on the free plan?

No, an inactive or empty result alone does not prove the user is free. RevenueCat's CustomerInfo guide says CustomerInfo is empty when no purchases have been made and no transactions have been synced, so a device that has never synced looks the same as a free user. Treat it as unconfirmed until your server has confirmed that this App User ID has no entitlement.

Can I enforce subscription expiry offline in a Flutter app?

Not in a tamper-proof way, because a check that runs only on the device reads data and a clock the user controls. Moving the clock back can fool an expiry comparison in your own code. Use cached state for display and local features, and let your server authorize every backend operation with its own clock and subscription record.

What should happen to subscription state when users switch accounts?

Each account should see only its own access state and downloads, never the previous account's. Calling Purchases.logOut() clears the SDK cache, and RevenueCat's identity guide says apps that use their own user IDs can switch directly with Purchases.logIn(). Key your confirmed-access record and premium downloads by App User ID so nothing carries over.