-
public class DebugStateProviderSingleton state holder for debug information. All SDK components report their state to this provider, which then exposes it as a Flow for the debug UI to consume.
This object is thread-safe.
-
-
Field Summary
Fields Modifier and Type Field Description private final Flow<String>formattedDebugStringprivate final Flow<List<String>>eventLinespublic final static DebugStateProviderINSTANCE
-
Method Summary
Modifier and Type Method Description final Unitinit(Boolean enabled)Initializes the state provider. final Unitupdate(String key, Object value)Update a key-value pair in the debug data map. final Stringnow()Returns a timestamp string formatted as HH:mm:ss. final UnitrecordPendingEvent(TrackedEvent event)Record a newly tracked event as pending so it appears in the debug overlay. final UnitmarkEventsFlushed(List<TrackedEvent> events)Mark the supplied events as successfully flushed. final Flow<String>getFormattedDebugString()A flow emitting a formatted, multi-line string of all current debug data. final Flow<List<String>>getEventLines()A flow emitting individual event log lines so that the overlay can render them separately. -
-
Method Detail
-
init
final Unit init(Boolean enabled)
Initializes the state provider. Must be called from
AppstackAttributionSdk.init.- Parameters:
enabled- Whether debug mode is active.
-
update
final Unit update(String key, Object value)
Update a key-value pair in the debug data map. If debug mode is disabled, this method does nothing. If the value is
null, the key is removed.- Parameters:
key- The key for the debug entry (e.g., "SDK Version").value- The value to display (e.g., "1.0.0").
-
recordPendingEvent
final Unit recordPendingEvent(TrackedEvent event)
Record a newly tracked event as pending so it appears in the debug overlay.
-
markEventsFlushed
final Unit markEventsFlushed(List<TrackedEvent> events)
Mark the supplied events as successfully flushed.
-
getFormattedDebugString
final Flow<String> getFormattedDebugString()
A flow emitting a formatted, multi-line string of all current debug data.
-
getEventLines
final Flow<List<String>> getEventLines()
A flow emitting individual event log lines so that the overlay can render them separately.
-
-
-
-