Upgrade to Version 9 of the SDK for Android

Version 9 of the Android SDK brings improvements over previous versions, including new interactive notification features, better delivery tracking, and enhanced inbox messaging options.

If your app uses version 7 or 8 of the SDK, we recommend that you upgrade sequentially in this order: 7.x → 8.x → 8.2.x → 9.x. Skipping a major version can result in compatibility issues.

Add the New MobilePush Android SDK 

To upgrade to version 9, add the SDK as a dependency to your build.gradle file, as shown in this example.

1implementation("com.salesforce.marketingcloud:marketingcloudsdk:9.x")

To use the latest SDK version, replace 9.x with the latest version number available on the Change Log.

Use RemoteViews for Carousel Notifications 

Version 9 and later of the SDK use RemoteViews to render carousel notifications and standard notifications. These notifications include buttons that you define in Content Builder. For best results, don’t override the SDK’s RemoteViews implementation. Don’t use NotificationCompat.Builder.setContentView, which can interfere with the way that the SDK renders content.

For information about configuring the action that occurs when a user taps a button or a carousel image, see Configure Button and Carousel Actions.

Handle Nullable URL Property in Inbox 

In version 9 and later, the url field in the InboxMessage object can be null. As a result, it doesn’t always contain a link to a CloudPages page for Inbox 2.0. Configure your app to handle this case by checking for null values before using the url field.

For more information, see Implement Inbox Messaging on Android.