Last modified December 5, 2019 by Gordon Glauser

Unity SDK upgrade guide

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

Version 7.0

This section provides information for upgrading to Swrve Unity SDK v7.0.

Removed Summary
SetConversationVersion(int) We no longer support directly changing the conversation version that your instance is expecting. We will always set the latest conversation version that the current SDK supports.
Changed
config.AndroidPushNotificationAccentColor to config.AndroidPushNotificationAccentColorHex Changed the notification accent color configuration from RGB to Hex.

AndroidX

We have migrated the Android Native plugin from android-support over to AndroidX. For more information please see Android’s Migrating to AndroidX guide.

Firebase messaging library update

We’ve updated Firebase messaging to version 20.0.1 and dropped support for Android 14 and 15. When upgrading to Swrve Unity SDK 7.0 please ensure your minimum Android support is at 16.

Delayed initialization and custom user ID

For information about how to configure the SDK to delay initialization and set a custom user ID for tracking purposes, see the Unity integration guide.


Version 6.2 and 5.2

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


Version 6.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 Unity SDK v6.1.


Version 6.0

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

Removed Summary
Init (MonoBehaviour container, int appId, string apiKey, string userId) We no longer support directly editing the Swrve user ID when initializing the SDK. To set a custom user ID, use our new Identify API call. For more information, see Unity integration guide.
Init (MonoBehaviour container, int appId, string apiKey, string userId, SwrveConfig config) We no longer support directly editing the Swrve user ID when initializing the SDK. To set a custom user ID, use our new Identify API call. For more information, see Unity integration guide.
userId property from SwrveConfig To set a custom user ID, use our new Identify API call. For more information, see Unity integration guide.
HTTP/HTTPS configuration from SwrveConfig The SDK now only supports HTTPS protocol for all requests to and from it.
AndroidPushNotificationTitle from SwrveConfig Removed the configuration of an Android push notification title from the SwrveConfig.

Authenticated push

If you want to use our new user identity authenticated push feature, ensure you configure your app to use silent notifications. For information on how to configure silent notifications, see the Unity integration guide.


Version 5.1.3

No code changes are required to upgrade to Swrve Unity SDK v5.1.3. If you are upgrading from a version prior to 5.1.2, please check the previous upgrade instructions.


Version 5.1.2

This section provides information to enable you to upgrade to Swrve Unity SDK v5.1.2. If you are upgrading from a version prior to 5.1, also see the Unity SDK 5.0+ Upgrade Guide.

Custom buttons in rich push notifications

To ensure custom buttons in rich push notifications work correctly, use the SwrveUnityApplication as your main Unity Android application by adding it to Plugins/Android/AndroidManifest.xml as follows (for more information about AndroidManifest.xml on Unity, see the Unity documentation for Android Manifest):

Alternatively, you can call the following method from your custom Application class inside the onCreate method:


Version 5.1.1

No code changes are required to upgrade to Swrve Unity SDK v5.1.1. If you are upgrading from a version prior to 5.1, see the Unity SDK 5.0+ Upgrade Guide.


Version 5.1

This section provides information to enable you to upgrade to Swrve Unity SDK v5.1.

API changes

With the release of Swrve’s Unity SDK version 5.1, 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 Unity SDK 5.0+ Upgrade Guide.

Rich Push notifications for iOS

Ensure that your are setting an App Group Identifier to the key iOSAppGroupIdentifier to your postprocess.json.

Custom Android Manifest

Create or modify your AndroidManifest.xml file so the SDK native code is called on Application launch by setting a custom Application class:


Previous versions

If you are upgrading from a version older than 5.1, please refer to the Unity SDK 5.0 upgrade guide and Unity integration guide.