Last modified September 17, 2024 by Shelly Wolfe

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 10.0.0

There are no code changes required to upgrade to Swrve Unity SDK v10.0.0.

Version 9.3.0

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


Version 9.2.0

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


Version 9.1.0

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

  • Unity 2020 is end-of-life. Unity 2021 is now the minimum LTS.

The following table lists the methods and fields that have changed or been moved.

Changed To
ISwrveEmbeddedMessageListener Use the new ISwrveEmbeddedListener, which adds a bool isControl parameter.

Version 9.0.1

There are no code changes required to upgrade to Swrve Unity SDK v9.0.1.


Version 9.0.0

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

  • Unity 2019 is end-of-life. Unity 2020 is now the minimum LTS.
  • Unity has deprecated the iOS Notifications Services API and we have migrated to the Mobile Notifications Package. Please update your package to the latest version using the Unity Package Manager.

The following table lists the methods and fields that have changed or been moved.

Removed Summary
SwrveTriggeredMessageListener Use embedded campaigns to customize the rendering of in-app messages.
SwrveConfig.PushNotificationEvents Use SwrveConfig.PushNotificationPermissionEvents to trigger notification prompts on Android 13 and iOS.
ISwrvePushNotificationListener.OnRemoteNotification(UnityEngine.iOS.RemoteNotification notification) Use ISwrvePushNotificationListener.OnRemoteNotification(Unity.Notifications.iOS.iOSNotification notification)

Requesting push notification permission for Android and iOS

With the release of Android 13, users must actively grant permission for an app to display notifications on their device. To improve permission opt-in rates, Android recommends waiting until an opportune time to display the permission prompt.

In earlier versions, the default behaviour on iOS automatically triggered the push permission prompt on a user’s first app session, unless you configured the SwrveConfig.PushNotificationEvents API to trigger the request using specific events.

With the release of version 9.0.0, we’ve replaced the API with SwrveConfig.PushNotificationPermissionEvents, which you should now use to trigger the prompt for both Android 13+ and iOS. This is now required to get push permission from all users.

To configure the notification permission request:

  1. Set the Android targetSdk to at least API Level 33 to ensure the permission prompt is not displayed upon install for Android users.
  2. The SwrveConfig.PushNotificationPermissionEvents API captures a HashSet of string event names. Configure the API with a list of special event names to trigger the prompt.

Multiple push providers on Android

If using multiple push providers on Android, please update your Java or Kotlin FirebaseMessagingService class to use the following new API: SwrvePushServiceDefault.handle(Context context, Map<String, String> data, String messageId, long sentTime)


Previous versions

If you are upgrading from a version older than 9.0.0, please refer to the Unity integration guide.