Class MPSessionReplayInstance
-
- All Implemented Interfaces:
-
com.mixpanel.android.sessionreplay.tracking.TouchEventListener
public final class MPSessionReplayInstance implements TouchEventListener
-
-
Field Summary
Fields Modifier and Type Field Description private Stringtokenprivate MPSessionReplayConfigconfigprivate final SessionReplaySendersessionReplaySenderprivate final FlushServiceflushService
-
Constructor Summary
Constructors Constructor Description MPSessionReplayInstance(Context appContext, String token, String distinctId, MPSessionReplayConfig config, SessionReplaySender sessionReplaySender, CoroutineScope lifecycleScope, EventService eventService, FlushService flushService)
-
Method Summary
Modifier and Type Method Description final StringgetToken()final UnitsetToken(String token)final MPSessionReplayConfiggetConfig()final UnitsetConfig(MPSessionReplayConfig config)final SessionReplaySendergetSessionReplaySender()final FlushServicegetFlushService()final Unitdeinitialize()De-initializes the Session Replay instance. final Unitflush(Function0<Unit> onComplete)Uploads all locally stored events to Mixpanel. final StringgetReplayId()final StringgetDistinctId()final BooleanisRecording()final Unitidentify(String distinctId)final UnitaddSensitiveView(View view)final UnitremoveSensitiveView(View view)final UnitaddSafeView(View view)final UnitremoveSafeView(View view)final UnitaddSensitiveClass(Class<?> aClass)final UnitremoveSensitiveClass(Class<?> aClass)final UnitdisableEventTriggers()Pauses event-triggered recording. final UnitenableEventTriggers()Enables event-triggered recording. final BooleanisEventTriggersEnabled()Returns whether event triggers are currently enabled. final UnitautoStartRecording()Automatically starts recording session replays based on the configured percentage. final UnitstartRecording(Double sessionsPercent)Starts recording session replays. final UnitstopRecording()UnitonTouchStart()UnitonTouchEnd()-
-
Constructor Detail
-
MPSessionReplayInstance
MPSessionReplayInstance(Context appContext, String token, String distinctId, MPSessionReplayConfig config, SessionReplaySender sessionReplaySender, CoroutineScope lifecycleScope, EventService eventService, FlushService flushService)
-
-
Method Detail
-
getConfig
final MPSessionReplayConfig getConfig()
-
setConfig
final Unit setConfig(MPSessionReplayConfig config)
-
getSessionReplaySender
final SessionReplaySender getSessionReplaySender()
-
getFlushService
final FlushService getFlushService()
-
deinitialize
final Unit deinitialize()
De-initializes the Session Replay instance.
-
flush
final Unit flush(Function0<Unit> onComplete)
Uploads all locally stored events to Mixpanel.
- Parameters:
onComplete- Optional callback that will be called when the flush operation is complete.
-
getReplayId
final String getReplayId()
-
getDistinctId
final String getDistinctId()
-
isRecording
final Boolean isRecording()
-
addSensitiveView
final Unit addSensitiveView(View view)
-
removeSensitiveView
final Unit removeSensitiveView(View view)
-
addSafeView
final Unit addSafeView(View view)
-
removeSafeView
final Unit removeSafeView(View view)
-
addSensitiveClass
final Unit addSensitiveClass(Class<?> aClass)
-
removeSensitiveClass
final Unit removeSensitiveClass(Class<?> aClass)
-
disableEventTriggers
final Unit disableEventTriggers()
Pauses event-triggered recording.
When disabled, the SDK will ignore events from the Mixpanel SDK that would normally trigger recording based on configured event triggers. This does not affect:
Manual recording via
startRecording()/stopRecording()Bridge registration (handler remains registered)
Settings parsing or remote configuration
Note: This is a global setting that affects all event triggers of session replay.
-
enableEventTriggers
final Unit enableEventTriggers()
Enables event-triggered recording.
Re-enables processing of events from the Mixpanel SDK for triggering recording. Event triggers will evaluate normally after calling this method.
Note: Event triggers are enabled by default on initialization.
-
isEventTriggersEnabled
final Boolean isEventTriggersEnabled()
Returns whether event triggers are currently enabled.
- Returns:
true if event triggers are enabled, false if paused
-
autoStartRecording
final Unit autoStartRecording()
Automatically starts recording session replays based on the configured percentage. If the percentage is 0, it will not start recording.
-
startRecording
final Unit startRecording(Double sessionsPercent)
Starts recording session replays.
- Parameters:
sessionsPercent- The percentage of sessions to record.
-
stopRecording
final Unit stopRecording()
-
onTouchStart
Unit onTouchStart()
-
onTouchEnd
Unit onTouchEnd()
-
-
-
-