Flutter SDK reference

API reference for engageapp_inapp — navigator-key setup, init, identify, onAppForeground, and setHandlers.

engageapp_inapp renders full-screen in-app takeovers in Flutter apps (Flutter 3.27+). Add it with flutter pub add engageapp_inapp and use the EngageInApp.instance singleton.

Setup: navigator key

The SDK presents the takeover as a route, so it needs a GlobalKey<NavigatorState> that is attached to both your MaterialApp and the config. See the setup guide for the full wiring.

init(config)

EngageInAppConfig = { required publishableKey, apiBaseUrl = 'https://api.engageapp.xyz', navigatorKey?, httpClient?, videoBuilder? }. Throws ArgumentError if publishableKey or apiBaseUrl is empty.

videoBuilder — full-screen video

Widget Function(BuildContext, TakeoverMedia). The SDK ships without a video dependency, so supply a player (e.g. video_player) and it renders your widget filling the takeover. TakeoverMedia carries type (image / video), url, posterUrl, isFullscreen, autoplay, loop, and muted. Without a builder, video takeovers render posterUrl.

identify(externalId, {...})

Named optionals: email, firstName, lastName, device, identityHash. Async; safe to call repeatedly. identityHash is remembered for later fetches when identity verification is enabled.

setHandlers({...})

onButtonTap(action, message), onShown(message), onDismiss(message). An action carries type (deeplink / url / dismiss) and value.

onAppForeground()

Async Future<bool>; returns true when a takeover was shown. Same no-op guards as the Web SDK. Call it when your app resumes (e.g. from a WidgetsBindingObserver).

See the In-App Takeover setup guide for an end-to-end example.