FlowResult. It assumes you already have a published flow attached to a placement (the Quickstart walks through building that end to end).
Before you startYou need:
- A FlowPilot workspace.
- An app inside that workspace.
- An SDK API key for that app.
- The SDK installed in your Xcode project.
- A placement key (for example
onboarding) with a published flow attached, targeting iOS.
Steps
Configure at launch
Call
FlowPilot.configure(_:) once, as early as possible, with your API key and App ID. See Configuration for every option.Present a placement
Ask the SDK to resolve and present your placement. Reach the SDK through
FlowPilot.shared.- UIKit
- SwiftUI
Call
presentPlacement(_:from:) from a view controller. It is async and throws, so wrap it in a Task and a do/catch.Read the result
Both paths hand you a
FlowResult. Switch on its outcome to decide what to do next.FlowResult also carries finalVariables, screensVisited, durationMs, and experimentAssignments. See Results and outcomes.Common mistakes
- Using a dashboard token instead of an SDK API key. The SDK authenticates with
Authorization: Bearer <sdk-key>. Your dashboard login will not work. Create an SDK key in the app settings. - App ID mismatch. The
appIdyou configure must own the placement, or the resolve returns no flow. - Placement key typo, paused placement, or no flow attached. The key in code must match the placement key exactly, the placement must be active, and a published flow must be attached.
- Forgetting to publish. A draft flow is never served. Publish a version and attach it to the placement.
Troubleshooting
Nothing appears? Walk this checklist:- Is the API key an SDK key (it starts with
fp_) and valid for the environment you configured? - Is the App ID the one that owns the placement?
- Is the placement active (not paused) and targeting iOS?
- Is a published flow version attached to the placement?
- Is the placement key in your code an exact match?
- Is the device online? If it may be offline, configure caching or a bundled fallback.