Native paywalls

Design native paywalls in the dashboard and update them in real time — no app release, no store review. The Flutter SDK renders them natively and reports analytics automatically; Swift ships a SwiftUI view; any other stack can use the REST endpoints below.

One line in your app — forever#

Flutter
// once, in main(): await Paylo.configure('pk_test_...');
await PayloPaywall.showIfNeeded(context,
  placement: 'onboarding',                  // optional
  attributes: {'source': 'instagram'});     // optional

The server decides which paywall to show (your targeting rules) and whether to show it (subscribers see nothing by default, frequency caps are honored). Publish a new design from the dashboard — the app picks it up on the next call.

Designing in the dashboard#

Dashboard → Paywalls → Design gives you a live phone preview while you edit. Everything ships remotely:

FieldTypeDescription
heightlayoutBottom-sheet height, 50–100% of the screen (100% = full screen)
title / subtitletextHeadline and supporting copy, left or centered
featureslistUp to 8 checkmarked benefit lines
plansplansUp to 4 plans, click the preview to pick the highlighted one
theme / accent / backgroundstyleDark or light, brand color, optional custom background
image_urlurlHero image at the top
badge / plan badges & notes / strike pricestext"Most popular", "Save 40%", crossed-out original price per plan
countdown_enddatetimeLive countdown for limited offers
social_proof_texttext"★ 4.8 · 12,000+ users"
secondary_button / footer / terms & privacytextDismiss link, legal footer
localizationsmapPer-locale text overrides — the SDK picks the device language
Only one paywall is publishedat a time — that's the default one apps receive. Keep drafts and seasonal variants unpublished and point rulesat them. Paywalls are shared by test and live mode: publishing one updates both. The plans they show are looked up by slug in the app's own mode, so create your live plans with the same slugs.

Embedding in a page#

Prefer a classic subscription screen over a modal? Drop the inline widget in a Scaffold:

Flutter
Scaffold(
  appBar: AppBar(title: const Text('Subscription')),
  body: PayloPaywall.inline(placement: 'subscription_page'),
)

It loads itself, shows a spinner meanwhile, and renders nothing when the server says nothing should be shown (customize with loadingBuilder / emptyBuilder).

From your own pricing UI#

Flutter
// User tapped "Pro" in your custom list:
await PayloPaywall.showIfNeeded(context,
  preselectedPlanSlug: 'pro_monthly');

// Or skip the paywall — straight to checkout:
await Paylo.instance.subscribe(
  planId: 'pro_monthly', customerId: Paylo.customerId);

Analytics, automatically#

The Flutter SDK reports impressions, dismissals and checkout opens on its own (with Swift and Kotlin, call logPaywallEvent — see SDKs). Dashboard → Paywalls → Analytics shows the funnel per paywall — viewers, checkouts, paid conversions — and per A/B variant. These events also power the frequency caps in your rules.

Offline#

Since SDK v0.6.0 the last successful resolve is cached on-device and served when the network is unreachable (kept 7 days, per customer and placement) — a cold start in airplane mode still shows the paywall. Server errors are never masked by the cache, and fromCache on the result tells you when it happened. On Kotlin, pass cacheDir = context.cacheDir to the constructor to enable it; Flutter and Swift need no setup.

REST — build your own renderer#

Everything the SDK does is public API:

POST/v1/public/:developerId/paywall/resolvewhich paywall for this customer
GET/v1/public/:developerId/paywallthe published paywall
GET/v1/public/:developerId/paywallsall paywalls
POST/v1/public/:developerId/paywall-eventsreport impression / dismiss / checkout_opened
Resolve — response
{
  "paywall": {
    "id": "3b9d…",                // UUIDs
    "config": { "title": "Unlock Premium", "theme": "dark", "…": "…" },
    "plans": [{ "slug": "pro_monthly", "name": "Pro", "amount": 999, "…": "…" }]
  },
  "rule_id": "a71e…",           // null for the published fallback
  "reason": "rule_matched",     // published_fallback | audience_no_match |
                                // frequency_capped | already_subscribed | no_match
  "offer": { "percent_off": 50, "duration": "repeating", "months": 3, "token": "…" }
                                // only when the matched rule has a discount
}