Migrate to the Next-Gen MobilePush SDK for Android
The version 8.x update of the MobilePush Android SDK sets a more modern architectural foundation to enable a variety of improvements and all new features for future versions. The updated MobilePush SDK is designed with existing MobilePush customers in mind so that the upgrade path is light and straightforward.
Add the new MobilePush Android SDK version 8.x as a dependency to your build.gradle
file, as shown in the following example.
To use the latest SDK version, replace {8.x} with the latest version number available on the SDK releases page.
After adding the new SDK as a dependency, you must replace your existing initialization function to reference the new SDK. After you've fetched the updated SDK version in your project, the functions that must be modified are highlighted in your codebase.
Ensure that you update how you initialize the SDK. You must replace the legacy MarketingCloudSDK.init function with the new SFMCSdk.configure function.
The SFMCSdk.configure
function takes in MarketingCloudConfig as a parameter. This configuration is the same as the one you're using for your existing implementation and doesn't need to be changed.
Next, update the existing identity functions within the SDK according to the following instructions.
-
Set the identity or ID of a known user: Update your existing identity tracking function setContactKey to instead use the new setProfileID function.
-
Set the Attributes of a user: Update your existing identity tracking function setAttribute to instead use the new setProfileAttributes function.
Finally, update all of the remaining existing functions in your implementation to reference functions from the new SDK. All existing functions that require modification are highlighted as deprecated
in your codebase.