Package 

Class NavigationInterceptor


  • 
    public final class NavigationInterceptor
    
                        

    SPEC-070-A A.10 — Per-screen interception hook list. Mirrors iOS Screens/NavigationInterceptor.swift:5-58.

    Architecture:

    • Activity-driven path: Application.registerActivityLifecycleCallbacks wired in AppDNA.configure() invokes evaluateInterceptions(activity.javaClass.simpleName) on onActivityResumed. Equivalent of iOS' viewDidAppear swizzle.

    • Compose-only path: hosts call AppDNA.notifyScreenAppeared("Home") from NavHost route changes (composables don't have an Activity per screen). Same evaluateInterceptions runs.

    Hooks are stored per-screen-name. Registering the same screen name twice replaces the prior hook (iOS parity).

    • Method Detail

      • evaluateInterceptions

         final InterceptionResult evaluateInterceptions(String screenName)

        Evaluate all matching hooks in registration order. Returns the first non-Allow result, or Allow if every hook permits the navigation. Returns null only when consent has been revoked.

        Suspend function — hook bodies may call into network / Firestore. Must be invoked from a coroutine (e.g. lifecycleScope.launch { NavigationInterceptor.shared.evaluateInterceptions(...) }).

      • notifyScreenAppeared

         final Unit notifyScreenAppeared(String screenName)

        Compose-only manual notification path. Equivalent of iOS swizzle triggering viewDidAppear.