Preview Drafts in Your App
A debug build with your project's Sandbox key shows each native funnel's latest draft at its placement — no publish, live refresh, nothing recorded.
The canvas in the funnel builder is a structural preview. To see a draft exactly as your app draws it — your bundled fonts, real store prices, your navigation around it — run a debug build of your app with the project's Sandbox key. There is nothing to send and nothing to switch on: the placement your app already opens shows the funnel's latest draft.
- No publish needed. A debug build on a Sandbox key gets every native
funnel's latest draft from the normal placement path — the same
RovenueFunnelVieworgetFunnelcall your app ships with. - Live. While the funnel is on screen, an edit in the builder shows up within about 17 seconds (two seconds of autosave, then the view's 15-second refresh), on the screen you are looking at when that screen still exists. Closing and reopening the funnel shows the latest draft at once.
- Marked. The view draws a small Draft badge, and
onLoadedreportsisDraft: true— again after every live refresh. - Nothing is recorded. A draft session emits no
funnel_*event, no exposure and no webhook, and no funnel attribution reaches a receipt. - Purchases are real sandbox purchases. A buy step runs your app's own purchase flow against the store's sandbox (StoreKit sandbox or a test configuration, a Google Play license tester) — which is what you are testing.
Debug builds with a Sandbox key only
Drafts are served only when both hold: the app is configured with a
Sandbox publishable key (rov_pk_test_…), and it is a debug
build (DEBUG on iOS; on Android, an app whose FLAG_DEBUGGABLE is set,
read from the context you pass to configure). It also needs SDK
0.19 or later. A release build — TestFlight included — and every live
key always get the published version, exactly as your users do. Mint a
Sandbox key on the dashboard's SDK & API page.
See a draft
Put the funnel on a placement. A draft is reached through a placement like a published funnel is: a placement row that targets the funnel, or a row that targets a running experiment over it. Test on device → Your app in the builder lists the placements that show the funnel, and warns when there are none.
Configure your debug build with the project's Sandbox key. The Your app tab shows that key with a copy button.
Open the placement in your app, on a simulator, an emulator or a phone. The Your app tab gives the line for each SDK with the placement's identifier filled in:
@MainActor func onboardingFunnel() -> RovenueFunnelView {
RovenueFunnelView(
placementId: "onboarding",
handlers: FunnelHostHandlers(
onLoaded: { loaded in
print(loaded.funnelId, loaded.revision, loaded.isDraft)
},
onUnavailable: { unavailable in
for issue in unavailable.issues {
print(issue.code, issue.message)
}
}
)
)
}
_ = onboardingFunnelimport android.content.Context
import dev.rovenue.sdk.funnelui.FunnelHostHandlers
import dev.rovenue.sdk.funnelui.RovenueFunnelView
fun showOnboarding(context: Context): RovenueFunnelView {
val view = RovenueFunnelView(context)
view.setPlacement(
placementId = "onboarding",
handlers = FunnelHostHandlers(
onLoaded = { loaded -> println("${loaded.funnelId} ${loaded.revision} ${loaded.isDraft}") },
onUnavailable = { unavailable ->
unavailable.issues.forEach { issue -> println("${issue.code} ${issue.message}") }
},
),
)
return view
}import { RovenueFunnelView } from "@rovenue/react-native-sdk";
function OnboardingFunnel() {
return (
<RovenueFunnelView
placementIdentifier="onboarding"
onLoaded={(e) => console.log(e.funnelId, e.revision, e.isDraft)}
onUnavailable={(e) => e.issues?.forEach((issue) => console.log(issue.code, issue.message))}
/>
);
}final view = RovenueFunnelView(
placementIdentifier: 'onboarding',
onLoaded: (loaded) => print('${loaded.funnelId} ${loaded.revision} ${loaded.isDraft}'),
onUnavailable: (unavailable) {
for (final issue in unavailable.issues) {
print('${issue.code} ${issue.message}');
}
},
);The handlers are optional; see Show a funnel for every event the view reports.
Edit in the builder. The open view refreshes in place within a few seconds. Publish when you are happy: release builds and live keys pick up the published version as usual.
A draft that cannot be shown
The draft goes through the same check a publish does. When it fails — a
block a native funnel cannot carry, a missing offering, a document the
funnel core cannot read — the view does not fall back to another funnel or
to the published version. It reports onUnavailable with the reason
draft_issues and the list of issues, each with its code, message and the
page and block it is on. With no onUnavailable handler, the view draws
that list itself. The SDK debug log names each issue too. Fix them in the
builder and the next refresh draws the funnel.
A draft whose funnel is archived, or that no longer sits on the placement,
is gone at the next refresh: the view reports onUnavailable with
no_target and clears.
Offline
A draft is never written to the device's placement cache, so it can never
survive into a release build or a live key on the same install. Offline, a
debug build skips the cache and shows the funnel from the bundled
offline fallback file — the
published version — or reports onError when there is none.
On a simulator or emulator
The only thing to get right is that the app reaches your API.
iOS Simulator. The simulator shares your Mac's network, so a debug
build pointed at http://localhost:3000 (a self-hosted API on your
machine) works as is.
Android emulator. Inside the emulator, localhost is the emulator
itself. Either point the debug build at http://10.0.2.2:3000, or forward
the port and keep localhost:
adb reverse tcp:3000 tcp:3000adb reverse lasts until the emulator restarts; run it again after a cold
boot. A cleartext http:// base URL also needs
android:usesCleartextTraffic="true" (or a network security config) in
your debug manifest.
The Rovenue app tab
Test on device → Rovenue app is the other way to look at a draft, with
no build of your own: the Rovenue operator app, signed in with your
dashboard account, scans the QR code. On a simulator, which has no camera,
copy the app link or one of its commands from the same tab —
rovenue://preview/funnels/<funnelId>?….
Troubleshooting
If your app shows the published version, or nothing:
- It is a debug build. A release or TestFlight build always gets the
published version. On Android, pass
contexttoconfigure: without it the SDK cannot tell a debug build apart. - It uses a
rov_pk_test_key of this project. A live key gets the published version; a Sandbox key of another project sees nothing. - The SDK is 0.19 or later. Older SDKs never ask for drafts.
- The funnel is on the placement you open. The Your app tab lists the placements that show it. A placement row behind an audience your test user does not match shows the next row instead.
- The app reaches your API. On the Android emulator use
10.0.2.2oradb reverse tcp:3000 tcp:3000.