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#
// once, in main(): await Paylo.configure('pk_test_...');
await PayloPaywall.showIfNeeded(context,
placement: 'onboarding', // optional
attributes: {'source': 'instagram'}); // optionalThe 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:
| Field | Type | Description |
|---|---|---|
height | layout | Bottom-sheet height, 50–100% of the screen (100% = full screen) |
title / subtitle | text | Headline and supporting copy, left or centered |
features | list | Up to 8 checkmarked benefit lines |
plans | plans | Up to 4 plans, click the preview to pick the highlighted one |
theme / accent / background | style | Dark or light, brand color, optional custom background |
image_url | url | Hero image at the top |
badge / plan badges & notes / strike prices | text | "Most popular", "Save 40%", crossed-out original price per plan |
countdown_end | datetime | Live countdown for limited offers |
social_proof_text | text | "★ 4.8 · 12,000+ users" |
secondary_button / footer / terms & privacy | text | Dismiss link, legal footer |
localizations | map | Per-locale text overrides — the SDK picks the device language |
Embedding in a page#
Prefer a classic subscription screen over a modal? Drop the inline widget in a Scaffold:
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#
// 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:
/v1/public/:developerId/paywall/resolvewhich paywall for this customer/v1/public/:developerId/paywallthe published paywall/v1/public/:developerId/paywallsall paywalls/v1/public/:developerId/paywall-eventsreport impression / dismiss / checkout_opened{
"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
}