Migration guide from 4.x to 5.x - optimove-tech/Optimove-SDK-Android GitHub Wiki
Migration
This guide will help you migrate to a new major version of the Optimove SDK. v5 contains all features present in v4 and adds in-app messaging, deferred deep linking, extended device support and more.
Prerequisites
In order to start using Optimove SDK v5 you must provide credentials which can be retreived from your Mobile Marketing UI. To gain access to this, please make a request to the Optimove Product Integration team.
Important Note: Optimove Mobile integration can begin as soon as you have received access to the Mobile Marketing UI, however tracking custom events and Track and Trigger functions require configuration with the Optimove Product Integration team.
Updating dependency
Note that Maven artifact name changed, to start the migration update the dependency as below and sync your project.
//v4
implementation 'com.optimove.sdk:optimove-sdk:4.+'
//v5
implementation 'com.optimove.android:optimove-android:5.+'
General
Package structure has changed, please update imports:
- Replace
com.optimove.sdk.optimove_sdk.main.Optimove
withcom.optimove.android.Optimove
. - Replace
com.optimove.sdk.optimove_sdk.*
withcom.optimove.android.*
Note: If some classes still cannot be found, follow this guide until the end -- perhaps you need to remove them.
Initialization
Update SDK initialization to the following.
//v4
Optimove.configure(this, new TenantInfo("<YOUR_OPTIMOVE_TENANT_TOKEN>", "<YOUR_OPTIMOVE_CONFIG_NAME>"));
//v5
Optimove.initialize(this, new OptimoveConfig.Builder(
"your-optimove-credentials",
"your-optimobile-credentials")
.build());
- For track and trigger integrations only Optimove credentials are required.
- For mobile push and all other features both sets of credentials will be required before moving to production, however mobile feature integration can be tested with only the Optimobile credentials.
Mobile Push
To migrate mobile push to v5 you need to completely remove existing integration and do a clean Optimobile integration.
Removing v4 push
- Remove
OptipushMessagingService
or your custom class extendingFirebaseMessagingService
from yourAndroidManifest.xml
. You will re-add when doing clean push integration. - Remove
enablePushCampaigns
anddisablePushCampaigns
calls. - Remove deep linking. For that remove references to
LinkDataExtractedListener
,DeepLinkHandler
,LinkDataError
and remove intent filter withcom.optimove.sdk.optimove_sdk.DEEPLINK
action from yourAndroidManifest.xml
. - Remove notification customizations by removing
com.optimove.sdk.custom-notification-icon
andcom.optimove.sdk.custom-notification-color
fromAndroidManifest.xml
. - Make sure your project builds, fix any remaining errors
Adding v5 push
Follow the Mobile Messaging Push Setup guide.