Class ReporterConfig.Builder
- Enclosing class:
- ReporterConfig
public static class ReporterConfig.Builder
extends java.lang.Object
-
Method Summary
Modifier and Type Method Description ReporterConfigbuild()Creates instance ofReporterConfigReporterConfig.BuilderwithLogs()Enable logging for appropriateIReporter.ReporterConfig.BuilderwithMaxReportsInDatabaseCount(int maxReportsInDatabaseCount)Sets maximum number of reports to store in database.ReporterConfig.BuilderwithSessionTimeout(int sessionTimeout)Set the timeout for expiring session.ReporterConfig.BuilderwithStatisticsSending(boolean enabled)Enables/disables statistics sending to the AppMetrica server.ReporterConfig.BuilderwithUserProfileID(java.lang.String userProfileID)Sets the ID of the user profile.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Method Details
-
withSessionTimeout
Set the timeout for expiring session.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.Builderobject.
-
withLogs
Enable logging for appropriateIReporter. Should be called beforeYandexMetrica.getReporter(Context, String).- Returns:
- the same
ReporterConfig.Builderobject.
-
withStatisticsSending
Enables/disables statistics sending to the AppMetrica server. By default, the sending is enabled.NOTE: Disabling this option doesn't affect data sending from the main apiKey and other reporters.
- Parameters:
enabled-trueto allow AppMetrica sending statistics, otherwisefalse.- Returns:
- the same
ReporterConfig.Builderobject.
-
withMaxReportsInDatabaseCount
@NonNull public ReporterConfig.Builder withMaxReportsInDatabaseCount(int maxReportsInDatabaseCount)Sets maximum number of reports to store in database. If this number is exceeded, some reports will be removed.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.Builderobject.
-
withUserProfileID
Sets the ID of the user profile. NOTE: The string value can contain up to 200 characters.- Parameters:
userProfileID- The custom user profile ID.- Returns:
- the same
YandexMetricaConfig.Builderobject - See Also:
YandexMetrica.setUserProfileID(String)
-
build
Creates instance ofReporterConfig- Returns:
ReporterConfigobject
-