Last modified February 28, 2022 by Shelly Wolfe

Android SDK upgrade guide

This guide provides information about how you can upgrade to the latest Swrve Android SDK. For information about the changes that have been made in each Android SDK release, see Android SDK release notes.

Upgrading using Gradle

If you use Gradle to integrate the Android SDK, update the build.gradle to use the latest version (for example, implementation 'com.swrve.sdk.android:swrve-firebase:9.3.1'). For more information, see the Android integration guide.

Warning: With the upcoming deprecation and retirement of Bintray/JCenter, version 7.6.0 is the last version published to Bintray/JCenter. We’ve moved our existing versions and all future releases will be available in Maven Central repository.

Version 9.4.0

There are no code changes required to upgrade to Swrve Android SDK v9.4.0.


Version 9.3.1

There are no code changes required to upgrade to Swrve Android SDK v9.3.1.


Version 9.3.0

There are no code changes required to upgrade to Swrve Android SDK v9.3.0.


Version 9.2.0

There are no code changes required to upgrade to Swrve Android SDK v9.2.0.


Version 9.1.0

There are no code changes required to upgrade to Swrve Android SDK v9.1.0.


Version 9.0.0

This section provides information for upgrading to Swrve Android SDK v9.0.0.

  • The Swrve SDK now has a minCompileSdk value of 31, which means you must update the compileSdkVersion value in your build.gradle to 31.
  • If you are using Google Play services advertising ID, you must now include the library dependency in your build.gradle. For example:
    api 'com.google.android.gms:play-services-ads-identifier:17.1.0'. For more information, see How do I log advertising and vendor IDs?.

Version 8.0.0

This section provides information for upgrading to Swrve Android SDK v8.0.0.

The following table lists the methods and fields that have changed or been removed:

Changed To
SwrveConfig.ManagedModeAutoStartLastUser SwrveConfig.AutoStartLastUser
SwrveMessagePersonalisationProvider.java SwrveMessagePersonalizationProvider.java
SwrveInAppMessageConfig.Builder.personalisationProvider SwrveInAppMessageConfig.Builder.personalizationProvider
SwrveInAppMessageConfig.Builder.personalisedTextBackgroundColor SwrveInAppMessageConfig.Builder.personalizedTextBackgroundColor
SwrveInAppMessageConfig.Builder.personalisedTextForegroundColor SwrveInAppMessageConfig.Builder.personalizedTextForegroundColor
SwrveInAppMessageConfig.Builder.personalisedTextTypeface SwrveInAppMessageConfig.Builder.personalizedTextTypeface
SwrveEmbeddedMessageListener.onMessage(Context context, SwrveEmbeddedMessage message); SwrveEmbeddedMessageListener.onMessage(Context context, SwrveEmbeddedMessage message, Map<String, String> personalizationProperties);
Removed Summary
SwrveConfig.LoadCachedCampaignsAndResourcesOnUIThread Method no longer needed.

Version 7.6.1

This section provides information for upgrading to Swrve Android SDK v7.6.1.

Migration to Maven Central

Add mavenCentral() to your root build.gradle file allprojects/repositories section:

repositories {
    mavenCentral()
}

Version 7.6.0

There are no code changes required to upgrade to Swrve Android SDK v7.6.0.

Support for Huawei Push Services

For information on using the new Swrve Huawei SDK library for Huawei push notifications, see the Android integration guide.


Version 7.5.0

There are no code changes required to upgrade to Swrve Android SDK v7.5.0.


Version 7.4.0

This section provides information for upgrading to Swrve Android SDK v7.4.0.

Embedded campaigns

For information on adding embedded campaigns to your Swrve integration, see the Android integration guide.


Version 7.3.2

There are no code changes required to upgrade to Swrve Android SDK v7.3.2.


Version 7.3.1

There are no code changes required to upgrade to Swrve Android SDK v7.3.1.


Version 7.3.0

There are no code changes required to upgrade to Swrve Android SDK v7.3.0.

Firebase Instance ID exceptions

The Firebase messaging library now validates your google-services.json file and throws an IllegalArgumentException if problems are found. If you see this exception in Logcat, then refresh your google-services.json file from the Firebase console.


Version 7.2.1

There are no code changes required to upgrade to Swrve Android SDK v7.2.1.


Version 7.2.0

There are no code changes required to upgrade to Swrve Android SDK v7.2.0.


Version 7.1.0

This section provides information for upgrading to Swrve Android SDK v7.1.0.

Amazon Device Messaging (ADM) 1.1.0

We updated the ADM library to 1.1.0, which brings support for Fire OS7. To upgrade to this version, add the following entry in your AndroidManifest.xml under the application tag:

<service android:name="com.swrve.sdk.SwrveAdmHandlerJobService"
         android:permission="android.permission.BIND_JOB_SERVICE"
         android:exported="false" />

For information about ADM, see the Amazon Developer docs.


Version 7.0.0

This section provides information for upgrading to Swrve Android SDK v7.0.0.

Removed Summary
SwrveNotificationCustomFilter We removed the deprecated SwrveNotificationCustomFilter. Please use SwrveNotificationFilter instead, which exposes more details of the notification than its predecessor.
Changed Summary
SwrveNotificationConfig.accentColorResourceId
to SwrveNotificationConfig.accentColorHex
Changed the notification accent color configuration from RGB to Hex.
Moved To
SwrveCustomButtonListener Moved from com.swrve.sdk.SwrveSDKBase to com.swrve.sdk.config.SwrveInAppMessageConfig. This listener needs to be set before starting the Swrve SDK as part of the config object.
SwrveDismissButtonListener Moved from com.swrve.sdk.SwrveSDKBase to com.swrve.sdk.config.SwrveInAppMessageConfig. This listener needs to be set before starting the Swrve SDK as part of the config object.
DismissButtonListener Moved from com.swrve.sdk.SwrveSDKBase to com.swrve.sdk.config.SwrveInAppMessageConfig, This listener needs to be set before starting the Swrve SDK as part of the config object.
defaultBackgroundColor Moved from com.swrve.sdk.SwrveConfigBase to com.swrve.sdk.config.SwrveInAppMessageConfig
inAppMessageFocusColor Moved from com.swrve.sdk.config.SwrveConfigBase to com.swrve.sdk.config.SwrveInAppMessageConfig and renamed to focusColor.
inAppMessageClickColor Moved from com.swrve.sdk.config.SwrveConfigBase to com.swrve.sdk.config.SwrveInAppMessageConfig and renamed to clickColor.
autoShowMessagesMaxDelay Moved from com.swrve.sdk.config.SwrveConfigBase to com.swrve.sdk.config.SwrveInAppMessageConfig.

AndroidX

We have migrated from android-support to AndroidX. For more information, see Android’s Migrating to AndroidX guide.

Firebase Cloud Messaging library update

We’ve updated Firebase Cloud Messaging to version 20.1.0 and dropped support for Android 14 and 15. When upgrading to Swrve Android SDK 7.0 ensure your minimum Android support is at 16.


Previous versions

If you are upgrading from a version older than 7.0.0, please refer to the Android Integration Guide.