Package 

Class ScreenManager

    • Method Detail

      • previewScreen

         final ScreenConfig previewScreen(String json)

        SPEC-070-A I.11 — preview a screen from a raw JSON payload (host-side, not from remote config). Mirrors iOS ScreenManager.previewScreen(json:). Parses → cache under the parsed id → present via showScreen. Used by the console preview flow + integration tests.

        Returns the parsed ScreenConfig on success, null on parse failure.

      • dismissScreen

         final Unit dismissScreen()

        SPEC-070-A finalization B6 P1 — best-effort dismissal of the currently presented SDUI screen. Mirrors iOS ScreenManager.dismissScreen which dismisses the top UIViewController.

        Today screens render via AppDNAScreenSlot in the host's own Composable tree (NOT via a dedicated SDUI ScreenActivity yet — that's tracked separately as the larger B6 P0-2 follow-up). For activity-hosted presentations (PaywallActivity / OnboardingActivity / SurveyActivity) the host already calls module-specific dismissers; this method additionally signals PresentationCoordinator that the modal closed so the next queued presentation can fire, and best-effort finishes any tracked SDUI ScreenActivity once that lands.

      • handleScreenAction

         final Boolean handleScreenAction(String screenId, Map<String, Object> action)

        SPEC-070-A B.6 + G.8 — public hook for SectionRegistry / Activity-based action dispatch to fire the screen delegate's onScreenAction veto hook AND emit the screen_action analytics event. Returns false when the host vetoed the action — the caller MUST NOT execute the default action handling in that case.

        action mirrors iOS SectionAction payload shape (type plus type-specific fields).

      • dispatchScreenAction

         final Unit dispatchScreenAction(String screenId, Map<String, Object> action, Function0<Unit> perform)

        SPEC-070-C D10 — full veto gate for a screen action. Runs the synchronous handleScreenAction veto (which also emits the screen_action analytics) exactly as before; if it allows AND an async wrapper-veto (asyncOnScreenAction) is registered, awaits it too. perform runs only when BOTH vetoes allow.

        When no async veto is set (every native host), perform runs synchronously inline so the host's action dispatch ordering is byte-identical to before this seam existed. When an async veto is set, perform runs on the main thread once the awaited decision resolves.

      • trackScreenResponseSubmitted

         final Unit trackScreenResponseSubmitted(String screenId, Integer fieldCount)

        SPEC-070-A G.8 — emit screen_response_submitted for form/submit actions. Hosts call this when a screen submits a form payload to the SDK. Mirrors iOS ScreenManager.swift:311.