-
- All Implemented Interfaces:
-
com.posthog.PostHogIntegration,com.posthog.internal.replay.PostHogSessionReplayHandler
public final class PostHogReplayIntegration implements PostHogIntegration, PostHogSessionReplayHandler
-
-
Constructor Summary
Constructors Constructor Description PostHogReplayIntegration(Context context, PostHogAndroidConfig config, MainHandler mainHandler)
-
Method Summary
Modifier and Type Method Description Unitinstall(PostHogInterface postHog)Unituninstall()final BooleancaptureSessionReplaySnapshot(View excludeView, Boolean forceFullSnapshot, Function0<Boolean> isStillValid, Function1<Boolean, Unit> onResult)One-shot capture of the top-most native activity window, for first-party PostHog wrapper SDKs (e.g. Unitstart(Boolean resumeCurrent)Unitstop()BooleanisActive()Map<String, Object>debugProperties()UnitonEvent(String event, Map<String, Object> properties)Called when an event is captured. UnitonSessionIdChanged()Called when the session ID changes. UnitonRemoteConfig(Boolean loaded)-
-
Constructor Detail
-
PostHogReplayIntegration
PostHogReplayIntegration(Context context, PostHogAndroidConfig config, MainHandler mainHandler)
-
-
Method Detail
-
install
@Synchronized() Unit install(PostHogInterface postHog)
-
uninstall
@Synchronized() Unit uninstall()
-
captureSessionReplaySnapshot
final Boolean captureSessionReplaySnapshot(View excludeView, Boolean forceFullSnapshot, Function0<Boolean> isStillValid, Function1<Boolean, Unit> onResult)
One-shot capture of the top-most native activity window, for first-party PostHog wrapper SDKs (e.g. posthog-flutter) driving out-of-engine capture on their own cadence. Not for app use: it shares snapshot state with the normal timer-driven capture. Must be called on the main thread.
excludeView (the caller's own decor view) is never captured. forceFullSnapshot resets the decor view's snapshot state so an episode's first capture is a full snapshot, not incremental mutations against a player mirror that interleaved frames have invalidated. isStillValid is re-checked on the capture thread, so work queued on an episode's last tick self-drops instead of emitting a late frame.
The return value only means the capture was scheduled; onResult fires on the capture thread with whether a frame was actually delivered — callers must treat that, not the return value, as the retry signal. Returns false without calling onResult if this window already has a pending/in-flight capture.
-
debugProperties
Map<String, Object> debugProperties()
-
onEvent
Unit onEvent(String event, Map<String, Object> properties)
Called when an event is captured. Checks if the event matches any configured triggers and starts session recording if so, provided the other gates permit the session.
-
onSessionIdChanged
Unit onSessionIdChanged()
Called when the session ID changes. Stops recording if event triggers are configured and the new session hasn't been activated yet, or re-initialises recording so the new session gets fresh meta + full wireframe events.
-
onRemoteConfig
Unit onRemoteConfig(Boolean loaded)
-
-
-
-