Migration guide to branch 3.x.x

This guide contains examples that demonstrate the differences between the SDK versions 2.9.6 and 3.0.0. This section only covers methods that do not have backward compatibility.


Reporter activation
Called before any actions with the reporter. If you already get the reporter, activation cannot change the parameters. Example:
YMMMutableReporterConfiguration *configuration = [[YMMMutableReporterConfiguration alloc] initWithApiKey:reporter_API_key];configuration.sessionTimeout = 32; // Session timeout of the reporter. configuration.logs = YES; // Enabling reporter logging.[YMMYandexMetrica activateReporterWithConfiguration:[configuration copy]];
Added the following classes to work with user profiles:

Added the following methods to the YMMYandexMetrica class for user profiles:

Added the following methods to the YMMYandexMetricaReporting class for user profiles:

Added the YMMRevenueInfo class for revenue tracking.

Added the following method to the YMMYandexMetrica class:

Added the following method to the YMMYandexMetricaReporting protocol:


Version 2.9.6Version 3.0.0
// Enables device location sending.setLocationTracking

The YMMYandexMetrica class.

// The first app launch with the AppMetrica SDK should be treated as the first launch of the updated app version, and not as an install.handleFirstActivationAsUpdate

The YMMYandexMetricaConfiguration class.

// Enables device location sending.locationTracking

The YMMYandexMetricaConfiguration class.

// Enables application crashes reporting.crashReporting

The YMMYandexMetricaConfiguration class.

// Sets the app version.appVersion

The YMMYandexMetricaConfiguration class.

// Enables logging.logs

The YMMYandexMetricaConfiguration class.


Version 2.9.6Version 3.0.0
Activation with the API key
[YMMYandexMetrica activateWithApiKey:API_key];
YMMYandexMetricaConfiguration *configuration = [[YMMYandexMetricaConfiguration alloc] initWithApiKey:API_key];
[YMMYandexMetrica activateWithConfiguration:configuration];

You can activate the library using the extended configuration YMMYandexMetricaConfiguration.

Setting the session length.
[YMMYandexMetrica setSessionTimeout:30];

You can set the session timeout using the extended configuration YandexMetricaConfig.

Monitoring app crashes.
[YMMYandexMetrica setReportCrashesEnabled:YES];

You can enable the crash reporting using the extended configuration YMMYandexMetricaConfiguration.

Setting the app version
[YMMYandexMetrica setCustomAppVersion:@"1.0.5"];

You can set the application version using the extended configuration YMMYandexMetricaConfiguration.

Enabling logs
[YMMYandexMetrica setLoggingEnabled:YES];

You can enable the library logging using the extended configuration YMMYandexMetricaConfiguration.

Setting environment values.
[YMMYandexMetrica setEnvironmentValue:@"bar" forKey:@"foo"];
Enables deeplink tracking by using provided application's URL scheme.
[YMMYandexMetrica enableTrackingWithURLScheme:urlScheme];
Deleted. This attribution method is no longer supported.
Activation with the numberic key.
[YMMYandexMetrica startWithAPIKey:13];