Models and Events
Models and Events
Section titled “Models and Events”Initialization models
Section titled “Initialization models”InitOptions
Section titled “InitOptions”| Field | Default | Purpose |
|---|---|---|
debug | false | SDK log verbosity only — it does not change the backend |
environment | Environment.Production | Backend the SDK talks to (Production or Development) |
mode | Mode.Client | Ignored: popups always come from Deepdots. Kept for compatibility (pass nil from Swift) |
popupOptions | PopupOptions() | Credentials: id, publicKey, companyId |
provideLang | { null } | Resolver for the current UI language |
autoLaunch | false | Start evaluating triggers right after initialize |
storage | null (persistent) | Host KeyValueStorage; see Analytics |
trackingEnabled | true | Start with tracking on, or off while waiting for consent |
analytics | null | AnalyticsKeys of the analytics integration; without them the channel runs in dry-run |
geolocation | true | Country and city by IP in analytics; false disables the lookup and the cached value |
contactAttributes | null | Attributes persisted on the backend Contact (requires metadata["userId"]) |
renderChrome | true | Whether the SDK paints the scrim and the card |
showProgressBar | null | Progress label and bar under the popup header |
metadata | null | Arbitrary host metadata forwarded to the backend |
renderChrome (default true, from 0.4.0) controls whether the SDK paints the popup “modal” — the dimmed scrim and the rounded card with elevation drawn by PopupView. Set it to false to render the popup transparent and full-bleed so it blends into your own screen; the survey stays functional (close button in the header, footer with back/start/complete/send). It mirrors the web/RN renderChrome flag. Note the native divergence: the chrome is native Compose (not HTML), and the SDK still auto-mounts a full-screen overlay, so the flag removes the scrim and card but does not hand the container mounting over to your app.
showProgressBar (default null, from 0.5.0) shows a Question X of Y label with a progress bar under the popup header. null follows the showProgressBar configured for the survey in the platform; true / false force it from the host. It respects the survey’s progressUnit (question count or percentage), showProgressUnit and loadingBarColor, and stays hidden on the start screen, on the completion screen, and when the survey has a single page. It mirrors the web/RN showProgressBar flag.
PopupOptions
Section titled “PopupOptions”idpublicKeycompanyId
ShowOptions
Section titled “ShowOptions”surveyIdproductIddata
Popup definition model
Section titled “Popup definition model”PopupDefinition
Section titled “PopupDefinition”idtitlemessagetriggertriggersconditionscooldownlegacyConditionsactionssurveyIdproductIdstylesegments
Trigger models
Section titled “Trigger models”Supported trigger types in code:
Trigger.TimeOnPage(seconds: Double)Trigger.Scroll(percentage: Int)Trigger.Exit(delaySeconds: Double = 0.0)Trigger.Event(name: String)Trigger.Click(targetId: String)
Style and segmentation models
Section titled “Style and segmentation models”themepositionimageUrlimageSizeimageAlignmentfont—PopupFont(family, url?), from 0.4.0
font applies a custom font to the native chrome (popup title, buttons and form controls) and to the survey inside the WebView. It mirrors Web’s PopupStyle.font. The font is fetched once and cached for the session; family is sanitized and url is only accepted over http(s) or data:. It is configured with the popup style in the platform.
Segments
Section titled “Segments”langpath
Event model
Section titled “Event model”PopupShownPopupClickedSurveyCompleted
The shared helper Event.code() maps them to:
popup_shownpopup_clickedsurvey_completed
EventData
Section titled “EventData”popupIdsurveyIdproductIdextratimestamp
Notes for integration teams
Section titled “Notes for integration teams”metadatais where the examples passuserIdLegacyConditionremains supported for backward compatibility