Class ReporterConfig.Builder
Method Summary
Modifier and Type | Method and Description |
---|---|
ReporterConfig | build()
Creates instance of
ReporterConfig |
ReporterConfig.Builder | withLogs()
Enable logging for appropriate
IReporter . |
ReporterConfig.Builder | withMaxReportsInDatabaseCount(int maxReportsInDatabaseCount)
Sets maximum number of reports to store in database.
|
ReporterConfig.Builder | withSessionTimeout(int sessionTimeout)
Set the timeout for expiring session.
|
ReporterConfig.Builder | withStatisticsSending(boolean enabled)
Enables/disables statistics sending to the AppMetrica server.
|
ReporterConfig.Builder | withUserProfileID(java.lang.String userProfileID)
Sets the ID of the user profile.
|
Method Detail
withSessionTimeout
@NonNull public ReporterConfig.Builder withSessionTimeout(int sessionTimeout)
By default, the session times out if the app is inactive for 10 seconds. To change this time limit, pass to the IReporter.setSessionTimeout(int sessionTimeoutSeconds) method your time limit in seconds. The minimum acceptable value for the sessionTimeoutSeconds parameter is 10 seconds. If a value less than 10 is set, the value will automatically be 10 seconds.
Under the duration of sessions, in the concept of Metrica, means the following (see example):
EXAMPLE: Let the duration of session timeout is 2 minutes. Then, if interaction with your application started after 2 minutes of inactivity with the application, then a new session will be created, otherwise the session will continue.
- Parameters:
sessionTimeout
- Timeout in seconds.- Returns:
- the same
ReporterConfig.Builder
object.
withLogs
@NonNull public ReporterConfig.Builder withLogs()
IReporter
. Should be called before YandexMetrica.getReporter(Context, String)
.- Returns:
- the same
ReporterConfig.Builder
object.
withStatisticsSending
@NonNull public ReporterConfig.Builder withStatisticsSending(boolean enabled)
NOTE: Disabling this option doesn't affect data sending from the main apiKey and other reporters.
- Parameters:
enabled
-true
to allow AppMetrica sending statistics, otherwisefalse
.- Returns:
- the same
ReporterConfig.Builder
object.
withMaxReportsInDatabaseCount
@NonNull public ReporterConfig.Builder withMaxReportsInDatabaseCount(int maxReportsInDatabaseCount)
NOTE: Default value is YandexMetricaDefaultValues.DEFAULT_MAX_REPORTS_IN_DATABASE_COUNT
- Parameters:
maxReportsInDatabaseCount
- Max number of reports to store in database. Must be in range [YandexMetricaDefaultValues.DEFAULT_MAX_REPORTS_COUNT_LOWER_BOUND
;YandexMetricaDefaultValues.DEFAULT_MAX_REPORTS_COUNT_UPPER_BOUND
]. If not, closest possible value will be used.- Returns:
- the same
ReporterConfig.Builder
object.
withUserProfileID
@NonNull public ReporterConfig.Builder withUserProfileID(@Nullable java.lang.String userProfileID)
- Parameters:
userProfileID
- The custom user profile ID.- Returns:
- the same
YandexMetricaConfig.Builder
object - See Also:
YandexMetrica.setUserProfileID(String)
build
@NonNull public ReporterConfig build()
ReporterConfig
- Returns:
ReporterConfig
object