-
public class AegisInAppManager
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classAegisInAppManager.PendingAckpublic final classAegisInAppManager.WidgetMessagepublic final classAegisInAppManager.WidgetStateResponsepublic final classAegisInAppManager.FrequencyCapP1 — Suppression knobs delivered alongside each queued widget. Matches
apps/cell-plane/app/api/v1/in_app/campaigns.py:FrequencyCap. All fields nullable so older server payloads decode cleanly.public final classAegisInAppManager.InAppCampaign
-
Field Summary
Fields Modifier and Type Field Description private Function3<String, String, Map<String, Object>, Unit>onInteractiveEventpublic final static AegisInAppManagerINSTANCE
-
Method Summary
Modifier and Type Method Description final UnitsetCurrentSurface(String surfaceKey)In-App Surface Filter tracker — declare the canonical placement surface for in-app targeting (e.g. final UnitsetCurrentScreen(String name)Dynamic Screens P2 — capture the RAW screen name (no enum filter) for free-form target_screensmatching.final UnitacknowledgeCampaign(String campaignId, String action)React Native bridge ack entry point (manager-side gap closed 2026-06-01). final UnitemitInteractiveEvent(String subType, String eventName, Map<String, Object> payload)Push an interactive event to the registered callback (if any). final Unitinitialize(Context context, String writeKey, String apiHost, String userId, String contactId, String organizationId, Boolean enableSSE, Boolean debugMode)final UnitupdateUserId(String userId)final UnitupdateContactId(String contactId)final UnitonAppResume()Call from Activity.onResume() or ProcessLifecycleOwner ON_RESUME. final List<AegisInAppManager.WidgetMessage>getQueuedWidgets()final UnitdisplayWidgetOnTrigger(Activity activity)final UnitnotifyConversion(String goalName)Conversion-aware mass-suppression. final Unitdisconnect()final Function3<String, String, Map<String, Object>, Unit>getOnInteractiveEvent()Interactive widget event callback (manager-side gap closed 2026-06-01). final UnitsetOnInteractiveEvent(Function3<String, String, Map<String, Object>, Unit> onInteractiveEvent)Interactive widget event callback (manager-side gap closed 2026-06-01). -
-
Method Detail
-
setCurrentSurface
final Unit setCurrentSurface(String surfaceKey)
In-App Surface Filter tracker — declare the canonical placement surface for in-app targeting (e.g. "bill", "storefront_catalog"). Only the 8 canonical keys are captured; other names are ignored so an arbitrary screen name never poisons the gate. Threads
current_surfaceon the next fetch and gates render client-side. Wired fromAegis.screen(name)and callable directly by hosts.
-
setCurrentScreen
final Unit setCurrentScreen(String name)
Dynamic Screens P2 — capture the RAW screen name (no enum filter) for free-form
target_screensmatching. Set from Aegis.screen(name).
-
acknowledgeCampaign
final Unit acknowledgeCampaign(String campaignId, String action)
React Native bridge ack entry point (manager-side gap closed 2026-06-01). The RN facade calls
acknowledgeCampaign(stepExecutionId, action)with the JS action vocab (displayed|dismissed|clicked); this maps that onto the native vocab (viewed|dismissed|clicked), finds the queued widget by id, and routes through the existing privateacknowledgeWidget(...)so journey-vs-catalog routing + retry are preserved. Falls back topostCatalogEventwhen the widget has already been dequeued so the event still lands. Additive — no existing caller ofacknowledgeWidgetchanges.
-
emitInteractiveEvent
final Unit emitInteractiveEvent(String subType, String eventName, Map<String, Object> payload)
Push an interactive event to the registered callback (if any). Called by the interactive renderer when a user interaction completes (NPS submit, quiz answered, spin won, etc.). Canonical event names mirror Flutter's
widget.<type>.<event>and the drift contract (ios-sdk/Tests/drift/inapp-interactive-bridge-contract.json).
-
initialize
final Unit initialize(Context context, String writeKey, String apiHost, String userId, String contactId, String organizationId, Boolean enableSSE, Boolean debugMode)
-
updateUserId
final Unit updateUserId(String userId)
-
updateContactId
final Unit updateContactId(String contactId)
-
onAppResume
final Unit onAppResume()
Call from Activity.onResume() or ProcessLifecycleOwner ON_RESUME. Refreshes widget queue as fallback when SSE was disconnected while backgrounded.
-
getQueuedWidgets
final List<AegisInAppManager.WidgetMessage> getQueuedWidgets()
-
displayWidgetOnTrigger
final Unit displayWidgetOnTrigger(Activity activity)
-
notifyConversion
final Unit notifyConversion(String goalName)
Conversion-aware mass-suppression. Call when the host app observes a goal event (purchase, order_placed, checkout_completed, or any workspace-configured custom goal).
For every queued widget whose
frequency_cap.suppress_after_conversion_secondsis set, the queue evaluation paths (getQueuedWidgets,displayWidgetOnTrigger) skip the widget until expiry.Persisted across host-app launches via SharedPreferences so a conversion fired in session N silences eligible widgets in session N+1.
Web parity — libs/web-sdk/src/inapp/AegisInAppManager.ts:438.
Safe to call repeatedly for the same goal.
-
disconnect
final Unit disconnect()
-
getOnInteractiveEvent
final Function3<String, String, Map<String, Object>, Unit> getOnInteractiveEvent()
Interactive widget event callback (manager-side gap closed 2026-06-01). Mirrors the Flutter
emitInteractiveEvent/onInteractiveEventshape (libs/mobile-sdk/flutter-sdk/lib/in_app/aegis_in_app.dart). The interactive renderer (InAppInteractiveRenderer) callsemitInteractiveEventwhen a user interaction completes; the RN bridge sets this callback to forward the{subType, eventName, payload}envelope to JS via theonInteractiveEventRCTDeviceEventEmitter event. Cleared by the bridge on disconnect. Additive — null by default, so non-RN hosts are unaffected.
-
setOnInteractiveEvent
final Unit setOnInteractiveEvent(Function3<String, String, Map<String, Object>, Unit> onInteractiveEvent)
Interactive widget event callback (manager-side gap closed 2026-06-01). Mirrors the Flutter
emitInteractiveEvent/onInteractiveEventshape (libs/mobile-sdk/flutter-sdk/lib/in_app/aegis_in_app.dart). The interactive renderer (InAppInteractiveRenderer) callsemitInteractiveEventwhen a user interaction completes; the RN bridge sets this callback to forward the{subType, eventName, payload}envelope to JS via theonInteractiveEventRCTDeviceEventEmitter event. Cleared by the bridge on disconnect. Additive — null by default, so non-RN hosts are unaffected.
-
-
-
-