public class SessionConfiguration extends Object implements com.snowplowanalytics.snowplow.internal.session.SessionConfigurationInterface, Configuration
| Modifier and Type | Field and Description |
|---|---|
TimeMeasure |
backgroundTimeout
The amount of time that can elapse before the
session id is updated while the app is in the
background.
|
TimeMeasure |
foregroundTimeout
The amount of time that can elapse before the
session id is updated while the app is in the
foreground.
|
androidx.core.util.Consumer<SessionState> |
onSessionUpdate
The callback called everytime the session is updated.
|
| Constructor and Description |
|---|
SessionConfiguration(JSONObject jsonObject) |
SessionConfiguration(TimeMeasure foregroundTimeout,
TimeMeasure backgroundTimeout)
This will setup the session behaviour of the tracker.
|
| Modifier and Type | Method and Description |
|---|---|
Configuration |
copy() |
TimeMeasure |
getBackgroundTimeout() |
TimeMeasure |
getForegroundTimeout() |
androidx.core.util.Consumer<SessionState> |
getOnSessionUpdate() |
SessionConfiguration |
onSessionUpdate(androidx.core.util.Consumer<SessionState> onSessionUpdate) |
void |
setBackgroundTimeout(TimeMeasure backgroundTimeout) |
void |
setForegroundTimeout(TimeMeasure foregroundTimeout) |
void |
setOnSessionUpdate(androidx.core.util.Consumer<SessionState> onSessionUpdate) |
@NonNull public TimeMeasure foregroundTimeout
@NonNull public TimeMeasure backgroundTimeout
@Nullable public androidx.core.util.Consumer<SessionState> onSessionUpdate
public SessionConfiguration(@NonNull
TimeMeasure foregroundTimeout,
@NonNull
TimeMeasure backgroundTimeout)
foregroundTimeout - The timeout set for the inactivity of app when in foreground.backgroundTimeout - The timeout set for the inactivity of app when in background.public SessionConfiguration(@NonNull
JSONObject jsonObject)
@NonNull public TimeMeasure getForegroundTimeout()
getForegroundTimeout in interface com.snowplowanalytics.snowplow.internal.session.SessionConfigurationInterfaceforegroundTimeoutpublic void setForegroundTimeout(@NonNull
TimeMeasure foregroundTimeout)
setForegroundTimeout in interface com.snowplowanalytics.snowplow.internal.session.SessionConfigurationInterfaceforegroundTimeout@NonNull public TimeMeasure getBackgroundTimeout()
getBackgroundTimeout in interface com.snowplowanalytics.snowplow.internal.session.SessionConfigurationInterfacebackgroundTimeoutpublic void setBackgroundTimeout(@NonNull
TimeMeasure backgroundTimeout)
setBackgroundTimeout in interface com.snowplowanalytics.snowplow.internal.session.SessionConfigurationInterfacebackgroundTimeout@Nullable public androidx.core.util.Consumer<SessionState> getOnSessionUpdate()
getOnSessionUpdate in interface com.snowplowanalytics.snowplow.internal.session.SessionConfigurationInterfaceonSessionUpdatepublic void setOnSessionUpdate(@Nullable
androidx.core.util.Consumer<SessionState> onSessionUpdate)
setOnSessionUpdate in interface com.snowplowanalytics.snowplow.internal.session.SessionConfigurationInterfaceonSessionUpdate@NonNull public SessionConfiguration onSessionUpdate(@Nullable androidx.core.util.Consumer<SessionState> onSessionUpdate)
onSessionUpdate@NonNull public Configuration copy()
copy in interface Configuration