YMMYandexMetricaConfiguration class

This class contains the extended startup configuration for the library.

The parameters of the extended configuration are applied from the time of library initialization.

Instance methods

init?(apiKey:)

Initializes the instance of the YMMYandexMetricaConfiguration class with the specified API key.

Properties

apiKey

The API key of the application.

appVersion

App version.

crashReporting

Enables/disables collecting and sending information about app crashes.

handleFirstActivationAsUpdate

Defines the first launch of the app as an update.

location

Sets custom location of the device.

locationTracking

Enables/disables sending location of the device.

logs

Enables/disables logging the activity of the library.

preloadInfo

Sets the instance of the YMMYandexMetricaPreloadInfo class for tracking pre-installed apps.

sessionTimeout

Sets the session timeout in seconds.

statisticsSending

Enables/disables sending statistics to the AppMetrica server.

Method descriptions

init?(apiKey:)

public init?(apiKey: String)

Initializes the instance of the YMMYandexMetricaConfiguration class with the specified API key.

Parameters:
apiKey

The API key of the application.

Returns:

The instance of the YMMYandexMetricaConfiguration class.

Property descriptions

apiKey

var apiKey: String { get }

The API key of the application.

appVersion

var appVersion: String?

App version.

crashReporting

var crashReporting: Bool

Enables/disables collecting and sending information about app crashes.

Possible values:
  • YES — Sending information about crashes is enabled.
  • NO — Sending information about crashes is disabled.

handleFirstActivationAsUpdate

var handleFirstActivationAsUpdate: Bool

Defines the first launch of the app as an update.

Attention. If the first launch of the app is defined as an update, the installation is not shown as a new installation in reports, and is not attributed to partners.
Possible values:
  • YES — The first launch is defined as an update.
  • NO — The first launch is defined as a new installation.

location

var location: CLLocation?

Sets custom location of the device.

locationTracking

var locationTracking: Bool

Enables/disables sending location of the device.

By default, sending is enabled.

logs

var logs: Bool

Enables/disables logging the activity of the library.

Logging is disabled by default.

preloadInfo

var preloadInfo: YMMYandexMetricaPreloadInfo?

Sets the instance of the YMMYandexMetricaPreloadInfo class for tracking pre-installed apps.

For more information, see Tracking pre-installed apps.

sessionTimeout

var sessionTimeout: UInt

Sets the session timeout in seconds.

The default value is 10 (minimum allowed value).

statisticsSending

var statisticsSending: Bool

Enables/disables sending statistics to the AppMetrica server.

Note. Disabling sending also turns off sending data from all reporters that initialized with a different apiKey.