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.

Added

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]];
Profiles
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:

Revenue
Added the YMMRevenueInfo class for revenue tracking.

Added the following method to the YMMYandexMetrica class:

Added the following method to the YMMYandexMetricaReporting protocol:

Renamed

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

The YMMYandexMetrica class.

handleFirstActivationAsUpdateEnabled
// 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.

trackLocationEnabled
// Enables device location sending.locationTracking

The YMMYandexMetricaConfiguration class.

reportCrashesEnabled
// Enables application crashes reporting.crashReporting

The YMMYandexMetricaConfiguration class.

customAppVersion
// Sets the app version.appVersion

The YMMYandexMetricaConfiguration class.

loggingEnabled
// Enables logging.logs

The YMMYandexMetricaConfiguration class.

Deleted

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"];
Deleted.
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];
Deleted.