Last modified November 30, 2018 by Gordon Glauser

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 Maven

If you’re integrating the Android SDK libraries using Maven from the Swrve repository on Jcenter, update the build.gradle to use the latest version (for example, compile 'com.swrve.sdk.android:swrve-google:6.0.1'). For more information, see the Android Integration Guide.


Version 6.0.1

If you are upgrading from a version prior to 6.0, see below. Otherwise, there are no code changes required to upgrade to Swrve Android SDK v6.0.1.

If you are in the process of upgrading to Android SDK v6.0, please use v6.0.1 instead, as it addresses an important fix to an issue with user identity that was introduced in version 6.0. Do not use Android SDK v6.0.

Version 6.0

This section provides information for upgrading to Swrve Android SDK v6.0.

Removed Summary
swrve-google flavor of SDK If you are currently using the swrve-google flavor of the SDK, you must migrate to swrve-firebase. For more information, see How do I migrate from Google Cloud Messaging to Firebase?
Empty constructor for SwrveNotifcationConfig.Builder(). You must now pass small notification icons and NotificationChannel into the SwrveNotifcationConfig.Builder() constructor.
SwrveNotifcationConfig title Removed the configuration of notification title from SwrveNotifcationConfig.
userId property from SwrveConfig To set a custom user ID, use our new Identify API call. For more information, see the Android Integration guide.
Default configurations of how notifications are displayed using <meta-data> properties in the AndroidManifest.xml. Use the SwrveNotificationConfig instead.
Configuration of default channel via SwrveConfig This has been added to the SwrveNotificationConfig.
SwrveFirebaseInstanceIdService The SwrveFirebaseInstanceIdService class was deprecated in SDK version 5.3 and has been completely removed in 6.0. Remove this from your AndroidManifest.xml if you haven’t already.
SwrveSDK.setPushNotificationListener The SwrveSDK.setPushNotificationListener method was deprecated in SDK version 5.3 and has been completely removed in 6.0. Use SwrveConfig.setNotificationListener instead.
Removed configuration of HTTP from SwrveConfig The SDK now only supports HTTPS.
Moved To
SwrveAdmMessageReceiver Moved from com.swrve.sdk.adm.SwrveAdmMessageReceiver to com.swrve.sdk.SwrveAdmMessageReceiver. Update your AndroidManifest.xml.
SwrveAdmIntentService Moved from com.swrve.sdk.adm.SwrveAdmIntentService to com.swrve.sdk.SwrveAdmIntentService. Update your AndroidManifest.xml.
SwrveFirebaseMessagingService Moved from com.swrve.sdk.firebase.SwrveFirebaseMessagingService to com.swrve.sdk.SwrveFirebaseMessagingService. Update your AndroidManifest.xml.

Version 5.3.2

If you are upgrading from a version prior to 5.0, see the Android SDK 5.0 Upgrade Guide. Otherwise, there are no code changes required to upgrade to Swrve Android SDK v5.3.2.


Version 5.3.1

If you are upgrading from a version prior to 5.0, see the Android SDK 5.0 Upgrade Guide. Otherwise, there are no code changes required to upgrade to Swrve Android SDK v5.3.1.


Version 5.3

This section provides information for upgrading to Swrve Android SDK v5.3. If you are upgrading from a version prior to 5.0, see the Android SDK 5.0 Upgrade Guide.

Firebase Messaging Upgrade

SwrveFirebaseInstanceIdService is now deprecated. No additional steps are required, as this upgrade simply removes it from your manifest.

Migrating from GCM to FCM

In line with Google’s decision to remove support for Google Cloud Messaging (GCM) by April 2019, we have deprecated the swrve-google flavor of the Android SDK in version 5.3 and will remove support for it in version 6.0 later this year. You must migrate your app to use Firebase Cloud Messaging (FCM). For information on how to migrate from GCM to FCM, see the FAQ article How do I migrate from Google Cloud Messaging to Firebase? or contact your Customer Success Manager at support@swrve.com if you require further assistance.


Version 5.2

This section provides information for upgrading to Swrve Android SDK v5.2. If you are upgrading from a version prior to 5.0, see the Android SDK 5.0 Upgrade Guide.

OTT Platform Support

Swrve Android SDK 5.2 includes support for Android TV and Amazon Fire TV platforms. There are no additional installation or integration steps, however you must update the Android API level to 21 (the minimum required to run Android TV).


Version 5.1.1

If you are upgrading from a version prior to 5.0, see the Android SDK 5.0 Upgrade Guide. Otherwise, there are no code changes required to upgrade to Swrve Android SDK v5.1.


Version 5.1

If you are upgrading from a version prior to 5.0, see the Android SDK 5.0 Upgrade Guide. Otherwise, there are no code changes required to upgrade to Swrve Android SDK v5.1.


Version 5.0

This section provides information for upgrading to Swrve Android SDK v5.0.

API Changes

With the release of Swrve’s Android SDK version 5.0, we have made major changes to the APIs to ensure internal consistency and improve SDK integration. For a complete list of the changes you need to make, see the Android SDK 5.0 Upgrade Guide.


Version 4.11.3

No code changes are required to upgrade to Swrve Android SDK v4.11.3.


Version 4.11.2

No code changes are required to upgrade to Swrve Android SDK v4.11.2.


Version 4.11.1

No code changes are required to upgrade to Swrve Android SDK v4.11.1.


Version 4.11

This section provides information for upgrading to Swrve Android SDK v4.11.

Firebase Cloud Messaging

To use the Firebase-flavored SDK, you must remove the Google-flavored SDK from your build.gradle and use the Firebase one instead. You cannot use both together. For new integrations, see the Android Integration Guide. On the Integration Setting screen in Swrve, you can continue to use the Google Cloud Messaging Server Key field to enter your Android Server key for Firebase.

If you’re upgrading a current Google Cloud Messaging app, see How Do I Migrate from Google Cloud Messaging to Firebase?

Google and Firebase SDKs

The new SDKs use the API 26 support libraries, which means you’ll need to update the version of these libraries in your app’s dependencies too and add the new Google Maven repository:

Android O Notification Channels

If you are compiling against API 26 (Android O), you must provide a default Notification Channel in the SwrveConfig object, otherwise Swrve Notifications cannot be shown.

Default SDK Device Logging Level

Swrve logcat logging is now based off Timber and the default logging level has been changed to WARN. For information on how to change the default logging level, see How Do I Configure SDK Device Logging?


Version 4.10.1

No code changes are required to upgrade to Swrve Android SDK v4.10.1.


Version 4.10

This section provides information for upgrading to Swrve Android SDK v4.10.

Silent Push Notifications

To enable silent push notifications, complete the steps outlined under Configuring Silent Notifications in the Android Integration Guide.


Version 4.9

This section provides information for upgrading to Swrve Android SDK v4.9.

Android API Level

The minimum API level that the Swrve SDK now supports is level 14 (Ice Cream Sandwich). If your app supports APIs below level 14, the Swrve SDK will not track or execute on those earlier versions, but will operate as normal on level 14 and above.

If your app supports API levels below 14, you need to override the Swrve library defaults. Include the following overrides in your AndroidManifest.xml:

Amazon SDK

If compiling the Amazon SDK from source, you may want to replace the stubbed amazon-device-messaging jar located at SwrveSDK/providedLibs/amazon-device-messaging-STUBBED.jar.


Version 4.8

No code changes are required to upgrade to Swrve Android SDK v4.8.


Previous Versions

If you are upgrading from a version older than 4.8, please refer to the Android SDK 5.0 Upgrade Guide and Android Integration Guide.