React Native SDK upgrade guide
To upgrade to the latest version of the Swrve React Native SDK plugin, replace the react-native-swrve-plugin
folder in your project with the one found in latest release on GitHub. Or use the following command:
npm update react-native-swrve-plugin
Updating native SDK dependencies
When you add the updated folder to your project, we recommend clearing your node_modules
folder and perform an npm install
to ensure you have the latest SDK dependency changes. Also, if you’re using iOS, ensure you run pod update
in the ios
folder.
Version 4.1.0
This section provides information for upgrading to Swrve React Native SDK Plugin v4.1.0.
The following table lists the methods and fields that have been changed or added.
Changed | To |
---|---|
MessageCustomButtonPressedListener |
The MessageCustomButtonPressedListener API is now deprecated. Please use InAppMessageListener instead to get campaign and button metadata. |
MessageDismissButtonPressedListener |
The MessageDismissButtonPressedListener API is now deprecated. Please use InAppMessageListener instead to get campaign and button metadata. |
MessageClipboardButtonPressedListener |
The MessageClipboardButtonPressedListener API is now deprecated. Please use InAppMessageListener instead to get campaign and button metadata. |
EmbeddedMessageCampaignListener |
The EmbeddedMessageCampaignListener API is now deprecated. Please use EmbeddedCampaignListener which adds a boolean: isControl for campaign holdouts. |
Added | Summary |
DeeplinkListener |
Implement this listener to handle deeplinks in the JS layer. |
embeddedControlMessageImpressionEvent |
Use this method to send an impression event for control embedded campaigns. |
Version 4.0.1
There are no code changes required to upgrade to Swrve React Native SDK Plugin v4.0.1.
Version 4.0.0
This section provides information for upgrading to Swrve React Native SDK Plugin v4.0.0. The following table lists the methods and fields that have been added.
Added | Summary |
---|---|
New string argument to the MessageCustomButtonPressedListener function containing the campaign name. |
If your integration uses the MessageCustomButtonPressedListener , add the campaign name argument as the last item in the signature. |
New string argument to the MessageDismissButtonPressedListener function containing the campaign name. |
If your integration uses the MessageDismissButtonPressedListener , add the campaign name argument as the last item in the signature. |
Version 3.2.0
There are no code changes required to upgrade to Swrve React Native SDK Plugin v3.2.0.
Version 3.1.0
There are no code changes required to upgrade to Swrve React Native SDK Plugin v3.1.0.
Version 3.0.0
This section provides information for upgrading to Swrve React Native SDK Plugin v3.0.0.
-
- The Swrve SDK now has a
minCompileSdk
value of 31, which means you must update thecompileSdkVersion
value in yourbuild.gradle
to 31.
- The Swrve SDK now has a
-
- 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'
.
- If you are using Google Play services advertising ID, you must now include the library dependency in your
Version 2.0.0
This section provides information for upgrading to Swrve React Native SDK Plugin v2.0.0. The following table lists the methods and fields that have been changed, removed, or added.
Changed | To |
---|---|
swrveConfig.managedModeAutoStartLastUser (native code) |
swrveConfig.autoStartLastUser |
Removed | Summary |
Install action from the in-app listeners arguments. | Action is no longer available in the campaign editor. Use the deeplink action instead. |
Added | Summary |
New argument to the SwrveSDK.setListeners function for embedded campaigns. |
If your integration includes embedded campaigns, add the embedded listeners argument as the last item in the list. For example:
constructor(props) { super(props); SwrveSDK.setListeners( /** User Resource Listeners arg **/ null, /** push listeners arg**/ null, /** in-app listeners arg **/ null, /** embedded listeners arg **/ null) } |
Version 1.3.0
There are no code changes required to upgrade to Swrve React Native SDK Plugin v1.3.0.
Version 1.2.1
There are no code changes required to upgrade to Swrve React Native SDK Plugin v1.2.1.
Version 1.2.0
There are no code changes required to upgrade to Swrve React Native SDK Plugin v1.2.0.
Version 1.1.0
This section provides information for upgrading to Swrve React Native SDK Plugin v1.1.0.
Geo-triggered campaigns
To use Swrve’s geo-triggered campaigns, you must integrate the Geo SDK plugin. For more information, see the Swrve Geo SDK Guide.