presentFunnel method
- String placement, {
- String? locale,
- FunnelPresentationOverride? style,
- FunnelPresentHandlers handlers = const FunnelPresentHandlers(),
- Map<
String, String> values = const <String, String>{},
Presents the funnel a placement serves — natively, the way the funnel's editor settings say (full screen, modal or sheet) — and resolves when it ends. The placement is resolved first (instantly after preloadPlacement); nothing is presented when it serves no funnel.
The SDK performs purchases and restores itself unless handlers
carries onPurchase / onRestore (and onWinBackPurchase for a
purchase the funnel sells at a win-back offer, with the offer's id —
without it onPurchase buys that one at the regular price), and closes after a successful one
when the funnel is set to "Close after purchase". Only one funnel is
presented at a time: a second call while one is up resolves
unavailable with reason alreadyPresented.
values are values for the funnel's declared externals (an ad's
scene, a campaign): trimmed, 512 characters at most, undeclared names
dropped; a fresh value overrides a restored one and preselects a
defaultFrom question. Never pass personal data — values are written
to the on-device session state. A funnel with a photo check calls
handlers.onCheck and waits for it up to the check's timeout; the
photos the visitor gave come back in FunnelPresentResult.photos.
Implementation
Future<FunnelPresentResult> presentFunnel(
String placement, {
String? locale,
FunnelPresentationOverride? style,
FunnelPresentHandlers handlers = const FunnelPresentHandlers(),
Map<String, String> values = const <String, String>{},
}) =>
_platform.presentFunnel(placement, locale: locale, style: style, handlers: handlers, values: values);