Migrating to version 3.0.0
Migrating your app from com.yandex.android:mobmetricapushlib to io.appmetrica.analytics:push shouldn't cause any issues.
Using two versions of AppMetrica Push SDK at the same time
Since we renamed the group and main artifacts, there may be cases where the app uses two versions of AppMetrica SDK at the same time: com.yandex.android:mobmetricapushlib and io.appmetrica.analytics:push.
Alert
That could lead to anomalies in reports and isn't recommended.
Migration guide
This guide contains examples that show the differences between SDK versions 2.3.3 and 3.0.0.
This section only covers methods that do not have backward compatibility.
Here's how to migrate to the new version
- Make sure you're using AppMetrica SDK version
io.appmetrica.analytics:analytics:6.0.0or higher. - Change the
com.yandex.android:mobmetricapushlib:2.3.3dependency toio.appmetrica.analytics:push:3.0.0. - In the project code, replace the classes and methods that were simply renamed or only changed their package.
The changes you need to make are listed in the paragraph on renaming classes. - Temporarily comment out the code with any remaining errors to ensure the project can be built.
- Modify any existing
excluderules.
The changes you need to make are listed in the paragraph on renaming dependencies. - Edit the code you commented out by following the other paragraphs in this guide.
If you have any questions, contact support.
Renamed dependencies
- Changed the name of the
com.yandex.android:mobmetricapushlibmodule toio.appmetrica.analytics:push. - Changed the name of the
com.yandex.android:appmetricapush-provider-firebasemodule toio.appmetrica.analytics:push-provider-firebase. - Changed the name of the
com.yandex.android:appmetricapush-provider-hmsmodule toio.appmetrica.analytics:push-provider-hms. - Changed the name of the
com.yandex.android:appmetricapush-provider-rustoremodule toio.appmetrica.analytics:push-provider-rustore. - Split the
com.yandex.android:appmetricapush-coremodule intoio.appmetrica.analytics:push-core-utilsandio.appmetrica.analytics:push-provider-api.
Renamed classes
- Renamed the
com.yandex.metrica.push.TokenUpdateListenerclass asio.appmetrica.analytics.push.TokenUpdateListener. - Renamed the
com.yandex.metrica.push.YandexMetricaPushclass asio.appmetrica.analytics.push.AppMetricaPush.- Changed the
EXTRA_ACTION_INFOconstant. - Removed the
getTokenmethod. - Changed the name of the
initmethod toactivate.
- Changed the
- Renamed the
com.yandex.appmetrica.push.firebase.FirebasePushServiceControllerProviderclass asio.appmetrica.analytics.push.provider.firebase.FirebasePushServiceControllerProvider. - Renamed the
com.yandex.appmetrica.push.hms.HmsPushServiceControllerProviderclass asio.appmetrica.analytics.push.provider.hms.HmsPushServiceControllerProvider. - Renamed the
com.yandex.appmetrica.push.hms.MetricaHmsMessagingServiceclass asio.appmetrica.analytics.push.provider.hms.AppMetricaHmsMessagingService. - Renamed the
com.yandex.appmetrica.push.rustore.MetricaRuStoreMessagingServiceclass asio.appmetrica.analytics.push.provider.rustore.AppMetricaRuStoreMessagingService. - Renamed the
com.yandex.appmetrica.push.rustore.RuStorePushServiceControllerProviderclass asio.appmetrica.analytics.push.provider.rustore.RuStorePushServiceControllerProvider. - Renamed the
com.yandex.metrica.push.common.core.PushServiceControllerProviderclass asio.appmetrica.analytics.push.provider.api.PushServiceControllerProvider. - Renamed the
com.yandex.metrica.push.common.core.PushServiceControllerclass asio.appmetrica.analytics.push.provider.api.PushServiceController. - Renamed the
com.yandex.metrica.push.firebase.MetricaMessagingServiceclass asio.appmetrica.analytics.push.provider.firebase.AppMetricaMessagingService.
The io.appmetrica.analytics.push.provider.firebase.AppMetricaMessagingService class is moved to a separate dependency.
Other
- Changed the name of the default notification channel to
appmetrica_push.
The old default channels won't be deleted.
If you didn't find the answer you were looking for, you can use the feedback form to submit your question. Please describe the problem in as much detail as possible. Attach a screenshot if possible.