Skip to content

Commit b44adde

Browse files
Merge pull request #230 from CleverTap/develop
Release 5.4.0
2 parents 11700b1 + f4e2ad7 commit b44adde

File tree

8 files changed

+39
-8
lines changed

8 files changed

+39
-8
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
Change Log
22
==========
3+
Version 5.4.0 *(25 November, 2025)*
4+
-------------------------------------------
5+
- Improved JSON Handling: Platform string variables that contain JSON data are now correctly detected and returned as proper JSON objects instead of plain quoted strings.
6+
- Unity 2021 Compatibility in UnityNativeRequest: Added support for Unity 2021* by including the required using System.Text; directive.
7+
- Updated to [CleverTap Android SDK v7.7.0](https://github.com/CleverTap/clevertap-android-sdk/releases/tag/corev7.7.0)
8+
- Updated to [CleverTap iOS SDK v7.4.0](https://github.com/CleverTap/clevertap-ios-sdk/releases/tag/7.4.0)
9+
310
Version 5.3.7 *(3 November, 2025)*
411
-------------------------------------------
512
- Added - "Preserve" attribute to address IL2CPP stripping of non-referenced property setters in UnityNativeEventDBEntry.

CleverTap/Plugins/Android/clevertap-android-wrapper.androidlib/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ ext {
1010
compileSdkVersionVal = 36
1111
targetSdkVersionVal = compileSdkVersionVal
1212

13-
libraryVersion = "5.3.7"
13+
libraryVersion = "5.4.0"
1414
}
1515

1616
android {
@@ -55,7 +55,7 @@ android {
5555
dependencies {
5656
compileOnly fileTree('libs')
5757

58-
api 'com.clevertap.android:clevertap-android-sdk:7.6.0'
58+
api 'com.clevertap.android:clevertap-android-sdk:7.7.0'
5959
implementation "androidx.core:core:1.13.0"
6060
implementation "com.google.firebase:firebase-messaging:24.0.0"
6161
}

CleverTap/Plugins/Android/clevertap-android-wrapper.androidlib/src/main/java/com/clevertap/unity/CleverTapUnityPlugin.java

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,13 @@ public String getVariableValue(String variableName) {
687687
if (value instanceof Map) {
688688
return new JSONObject((Map<?, ?>) value).toString();
689689
} else if (value instanceof String) {
690-
return "\"" + value + "\"";
690+
String stringValue = (String) value;
691+
String parsedJson = tryParseJson(stringValue);
692+
693+
if (parsedJson != null)
694+
return parsedJson;
695+
696+
return "\"" + stringValue + "\"";
691697
} else {
692698
return value.toString();
693699
}
@@ -1244,4 +1250,19 @@ private JSONArray inboxMessageListToJSONArray(ArrayList<CTInboxMessage> messageL
12441250

12451251
return array;
12461252
}
1247-
}
1253+
1254+
private String tryParseJson(String stringValue) {
1255+
if (stringValue == null) return null;
1256+
stringValue = stringValue.trim();
1257+
1258+
try {
1259+
if (stringValue.startsWith("{")) {
1260+
return new JSONObject(stringValue).toString();
1261+
} else if (stringValue.startsWith("[")) {
1262+
return new JSONArray(stringValue).toString();
1263+
}
1264+
} catch (Exception ignored) {}
1265+
1266+
return null;
1267+
}
1268+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<dependencies>
33
<iosPods>
4-
<iosPod name="CleverTap-iOS-SDK" version="7.3.4" minTargetSdk="9.0" />
4+
<iosPod name="CleverTap-iOS-SDK" version="7.4.0" minTargetSdk="9.0" />
55
</iosPods>
66
</dependencies>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
namespace CleverTapSDK.Constants {
22
public static class CleverTapVersion {
3-
public const string CLEVERTAP_SDK_VERSION = "5.3.7";
4-
public const int CLEVERTAP_SDK_REVISION = 50307;
3+
public const string CLEVERTAP_SDK_VERSION = "5.4.0";
4+
public const int CLEVERTAP_SDK_REVISION = 50400;
55
}
66
}

CleverTap/Runtime/Native/UnityNativeWrapper/Models/UnityNativeRequest.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
#if (!UNITY_IOS && !UNITY_ANDROID) || UNITY_EDITOR
22
using System;
33
using System.Collections.Generic;
4+
#if !UNITY_2022_1_OR_NEWER
5+
using System.Text;
6+
#endif
47
using CleverTapSDK.Utilities;
58
using UnityEngine.Networking;
69

CleverTap/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "com.clevertap.clevertap-sdk-unity",
3-
"version": "5.3.7",
3+
"version": "5.4.0",
44
"displayName": "CleverTap",
55
"description": "The CleverTap Unity SDK for App Analytics and Engagement.",
66
"documentationUrl": "https://www.clevertap.com/docs",

CleverTapSDK.unitypackage

5.03 KB
Binary file not shown.

0 commit comments

Comments
 (0)