-
public final class MessageManagerSPEC-070-A A.9 — Manages in-app message trigger evaluation, frequency tracking, and presentation. Mirrors iOS
InAppMessaging/MessageManager.swift:6-267.Architectural split (do not change):
MessageManagerowns: trigger evaluation, condition matching, frequency tracking, candidate selection, queue gate, delegate veto,in_app_message_*analytics events, CTA action routing.InAppMessageView(composable inInAppMessageRenderer.kt) owns: actual rendering of banner/modal/fullscreen/tooltip variants.
MessageManagerhosts theInAppMessageViewinside aComponentDialog— same approachPendingMessageListeneruses — so journey-delivered and trigger-delivered messages both land in the same renderer.NOTE: this class deliberately does NOT touch the renderer ctor — it uses the existing
@Composable InAppMessageViewfunction directly. Therendererconstructor parameter (kept on the public API for symmetry with iOS DI) is currently unused as a delivery handle; it only exists so a sample app or test can subclass / replace the presentation pipeline.
-
-
Field Summary
Fields Modifier and Type Field Description private volatile AppDNAInAppMessageDelegatedelegate
-
Constructor Summary
Constructors Constructor Description MessageManager(Context context, Function0<Map<String, MessageConfig>> configProvider, InAppMessageRenderer renderer)
-
Method Summary
Modifier and Type Method Description final AppDNAInAppMessageDelegategetDelegate()Public delegate. final UnitsetDelegate(AppDNAInAppMessageDelegate delegate)Public delegate. final UnitonEvent(String eventName, Map<String, Object> props)Evaluate every active message against an event. final UnitsuppressDisplay(Boolean suppress)Toggle session-wide suppression. final UnitresetSession()Clear in-session frequency counters. final Unitshutdown()SPEC-070-A final audit pass C F2 — release delay_seconds-queued runnables on SDK shutdown so Dialog presentations don't fire on a stale Activity reference afterAppDNA.shutdown().-
-
Constructor Detail
-
MessageManager
MessageManager(Context context, Function0<Map<String, MessageConfig>> configProvider, InAppMessageRenderer renderer)
-
-
Method Detail
-
getDelegate
final AppDNAInAppMessageDelegate getDelegate()
Public delegate. Hosted by
AppDNA.inAppMessagesnamespace —AppDNAModules.kt InAppMessagesModule.setDelegate(...)writes through to this field.
-
setDelegate
final Unit setDelegate(AppDNAInAppMessageDelegate delegate)
Public delegate. Hosted by
AppDNA.inAppMessagesnamespace —AppDNAModules.kt InAppMessagesModule.setDelegate(...)writes through to this field.
-
onEvent
final Unit onEvent(String eventName, Map<String, Object> props)
Evaluate every active message against an event. Called from
AppDNA.trackInternal()after the event has been written to the queue (see file-top wiring TODO).
-
suppressDisplay
final Unit suppressDisplay(Boolean suppress)
Toggle session-wide suppression. While true,
onEventis a no-op.
-
resetSession
final Unit resetSession()
Clear in-session frequency counters. Called from
AppDNA.reset().SPEC-401-A R86 (Lens B F1) — do NOT reset
isPresentinghere. iOSMessageManager.resetSession()leaves the gate untouched (InAppMessaging/MessageManager.swift:99-101). IfAppDNA.reset()is called while a Dialog is actively showing, dropping the gate races a second concurrent present() (in-flight Dialog stays visible while a follow-up tracked event passes the gate and calls present() again, stacking dialogs). The gate is reset on natural dismiss or shutdown.
-
-
-
-