Skip to content

Conversation

@SuriyaKannimuthu
Copy link
Contributor

@SuriyaKannimuthu SuriyaKannimuthu commented Nov 25, 2025

Version 5.4.0

  • 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.
  • Unity 2021 Compatibility in UnityNativeRequest: Added support for Unity 2021* by including the required using System.Text; directive.
  • Updated to CleverTap Android SDK v7.7.0
  • Updated to CleverTap iOS SDK v7.4.0

Summary by CodeRabbit

Release Notes – Version 5.4.0

  • New Features

    • Improved JSON handling: platform string variables containing JSON are now detected and returned as proper JSON objects instead of quoted strings.
    • Added Unity 2021 compatibility support.
  • Updates

    • Version bumped to 5.4.0.
    • Android SDK updated to v7.7.0.
    • iOS SDK updated to v7.4.0.

✏️ Tip: You can customize this high-level summary in your review settings.

* Unity 2021 - using System.Text; - added
…Variables

Update CleverTapUnityPlugin.java - String Json parsing added in binding.
…y-Integration

Update UnityNativeRequest.cs
Version 5.4.0

- 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.
- Unity 2021 Compatibility in UnityNativeRequest: Added support for Unity 2021* by including the required using System.Text; directive.
- Updated to [CleverTap Android SDK v7.7.0](https://github.com/CleverTap/clevertap-android-sdk/releases/tag/corev7.7.0)
- Updated to [CleverTap iOS SDK v7.4.0](https://github.com/CleverTap/clevertap-ios-sdk/releases/tag/7.4.0)
@francispereira
Copy link

francispereira commented Nov 25, 2025

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@coderabbitai
Copy link

coderabbitai bot commented Nov 25, 2025

Walkthrough

CleverTap Unity SDK updated from version 5.3.7 to 5.4.0 with dependencies bumped to Android SDK 7.7.0 and iOS SDK 7.4.0. Adds JSON string detection in platform variables, conditionally includes System.Text for Unity 2021 compatibility, and updates all version metadata across build configuration and package files.

Changes

Cohort / File(s) Summary
Version & Metadata
CHANGELOG.md, CleverTap/Runtime/Constants/CleverTapVersion.cs, CleverTap/package.json
Version constants updated from 5.3.7 to 5.4.0; SDK revision bumped to 50400; CHANGELOG entry added documenting improvements and dependency updates
Android Plugin
CleverTap/Plugins/Android/clevertap-android-wrapper.androidlib/build.gradle, CleverTap/Plugins/Android/.../CleverTapUnityPlugin.java
Library version bumped to 5.4.0; Android SDK dependency updated to 7.7.0; new tryParseJson() helper method added; getVariableValue() logic extended to detect and return parsed JSON for string values
Dependency Definitions
CleverTap/Plugins/Editor/CleverTapDependencies.xml
iOS SDK pod version updated from 7.3.4 to 7.4.0
Unity Compatibility
CleverTap/Runtime/Native/UnityNativeWrapper/Models/UnityNativeRequest.cs
Conditional using System.Text; directive added for Unity versions older than 2022.1

Sequence Diagram

sequenceDiagram
    participant Caller as Platform/Caller
    participant GetVar as getVariableValue()
    participant TryParse as tryParseJson()
    participant Return as Return Value

    Caller->>GetVar: getVariableValue(stringValue)
    alt String Value
        GetVar->>TryParse: tryParseJson(stringValue)
        alt Valid JSON
            TryParse-->>GetVar: Parsed JSON Object
            GetVar-->>Return: Return parsed JSON
        else Non-JSON String
            TryParse-->>GetVar: null
            GetVar-->>Return: Return quoted string
        end
    end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Most changes are mechanical version/dependency bumps across multiple files
  • JSON parsing logic in CleverTapUnityPlugin.java is new but contained to a single helper method with straightforward trim-and-detect logic
  • Conditional compilation directive in UnityNativeRequest.cs is straightforward

Possibly related PRs

Suggested reviewers

  • darshanclevertap

Poem

🐰 A version hops forth, from 5.3 to 5.4,
JSON strings now parse through each data door,
Android and iOS SDKs align with glee,
Unity 2021 joins the jubilee!
The wrapper's renewed, compatibility blessed—
This release, dear friends, is truly the best! 🎉

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Release 5.4.0' directly and clearly summarizes the main change: a version release. It aligns perfectly with the PR description and all file modifications (version bumps across multiple files, SDK updates, and feature additions).
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch develop

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@SuriyaKannimuthu SuriyaKannimuthu merged commit b44adde into master Nov 25, 2025
3 of 4 checks passed
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 11700b1 and f4e2ad7.

📒 Files selected for processing (7)
  • CHANGELOG.md (1 hunks)
  • CleverTap/Plugins/Android/clevertap-android-wrapper.androidlib/build.gradle (2 hunks)
  • CleverTap/Plugins/Android/clevertap-android-wrapper.androidlib/src/main/java/com/clevertap/unity/CleverTapUnityPlugin.java (2 hunks)
  • CleverTap/Plugins/Editor/CleverTapDependencies.xml (1 hunks)
  • CleverTap/Runtime/Constants/CleverTapVersion.cs (1 hunks)
  • CleverTap/Runtime/Native/UnityNativeWrapper/Models/UnityNativeRequest.cs (1 hunks)
  • CleverTap/package.json (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: nzagorchev
Repo: CleverTap/clevertap-unity-sdk PR: 192
File: CTExample/Assets/Editor/IOSPushNotificationsPostBuildProcessor.cs:147-164
Timestamp: 2025-06-20T15:56:59.454Z
Learning: In CTExample/Assets/Editor/IOSPushNotificationsPostBuildProcessor.cs, the GetCleverTapIOSSDKVersion method needs to handle multiple CocoaPods dependency formats including simple versions ('7.1.1'), local paths (:path => "../clevertap-ios-sdk"), and git repositories (:git => 'url', :branch => 'develop'). The method should extract the entire dependency specification after the pod name, not just assume a simple version format.
Learnt from: nzagorchev
Repo: CleverTap/clevertap-unity-sdk PR: 178
File: CTExample/Assets/AppInbox/Scripts/AppInbox.cs:24-31
Timestamp: 2025-04-24T15:10:39.004Z
Learning: The OnInboxMessageUpdate callback in the CleverTap Unity SDK is triggered specifically when new inbox messages are added, and should refresh the internal message lists to avoid stale data.
📚 Learning: 2025-06-20T15:56:59.454Z
Learnt from: nzagorchev
Repo: CleverTap/clevertap-unity-sdk PR: 192
File: CTExample/Assets/Editor/IOSPushNotificationsPostBuildProcessor.cs:147-164
Timestamp: 2025-06-20T15:56:59.454Z
Learning: In CTExample/Assets/Editor/IOSPushNotificationsPostBuildProcessor.cs, the GetCleverTapIOSSDKVersion method needs to handle multiple CocoaPods dependency formats including simple versions ('7.1.1'), local paths (:path => "../clevertap-ios-sdk"), and git repositories (:git => 'url', :branch => 'develop'). The method should extract the entire dependency specification after the pod name, not just assume a simple version format.

Applied to files:

  • CleverTap/Runtime/Constants/CleverTapVersion.cs
  • CleverTap/Plugins/Editor/CleverTapDependencies.xml
🔇 Additional comments (9)
CleverTap/package.json (1)

3-3: Version bump to 5.4.0 looks consistent.

This aligns with the version updates across CleverTapVersion.cs (SDK version and revision), build.gradle (library version), and the CHANGELOG entry.

CleverTap/Runtime/Native/UnityNativeWrapper/Models/UnityNativeRequest.cs (2)

4-6: Unity 2021 compatibility added correctly.

The conditional inclusion of System.Text for Unity versions older than 2022.1 is appropriate and enables the use of Encoding.UTF8.GetBytes in the POST request handler below.


92-102: POST request handling properly supports both Unity 2021 and 2022.1+.

The conditional compilation correctly uses the newer UnityWebRequest.Post overload for Unity 2022.1+ and falls back to manual construction with UploadHandlerRaw for older versions. The manual approach properly sets the Content-Type header and uses UTF8 encoding.

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

13-13: Library version bump aligns with release.

Updated to 5.4.0, consistent with package.json and CleverTapVersion.cs.


58-58: Let me search for more specific changelog information about what changed in version 7.7.0:

Let me search more specifically for version 7.7.0 in package repositories:

Let me search specifically in Maven Central to see the full version list and clarify what versions actually exist:

Version 7.7.0 does not exist; the review comment is based on an incorrect premise.

Official CleverTap documentation and GitHub examples show 7.6.0 as the current recommended version, and Maven Repository lists 101 available versions but version 7.7.0 is not among them. The Android Quick Start Guide references version 7.5.2, and the GitHub releases page does not document any 7.7.0 release. No breaking changes documentation exists for this non-existent version. The review comment cannot be verified as written.

Likely an incorrect or invalid review comment.

CHANGELOG.md (1)

3-9: Changelog entry accurately documents the 5.4.0 release.

The entry comprehensively covers all major changes: improved JSON handling, Unity 2021 compatibility, and SDK version updates for both Android (7.7.0) and iOS (7.4.0).

CleverTap/Runtime/Constants/CleverTapVersion.cs (1)

3-4: Version constants updated consistently.

Both CLEVERTAP_SDK_VERSION and CLEVERTAP_SDK_REVISION are correctly updated to reflect version 5.4.0, maintaining the expected relationship where revision 50400 = 510000 + 4100 + 0.

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

682-700: Improved JSON handling for string variables.

The updated getVariableValue method now intelligently detects JSON-formatted strings and returns them as proper JSON objects instead of quoted strings. The fallback to quoted strings for non-JSON values preserves backward compatibility for plain string variables.


1254-1267: JSON parsing helper is well-implemented.

The tryParseJson helper method correctly:

  • Handles null input
  • Trims whitespace before detection
  • Detects JSON objects/arrays by their opening character
  • Gracefully handles malformed JSON by catching exceptions
  • Returns normalized JSON via .toString() or null on failure

<dependencies>
<iosPods>
<iosPod name="CleverTap-iOS-SDK" version="7.3.4" minTargetSdk="9.0" />
<iosPod name="CleverTap-iOS-SDK" version="7.4.0" minTargetSdk="9.0" />
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Verify iOS SDK 7.4.0 compatibility.

The iOS SDK version has been updated from 7.3.4 to 7.4.0. Ensure this version exists and review the release notes for any breaking changes or migration requirements.


🌐 Web query:

CleverTap iOS SDK 7.4.0 release notes breaking changes

💡 Result:

I couldn't find any CleverTap iOS SDK v7.4.0 release or release notes. CleverTap's changelog shows iOS v7.2.0 (May 27, 2025) with breaking/behavior notes and Android v7.4.0 listed separately. See CleverTap developer docs for the May 2025 SDK notes and general “What’s New”. (developer.clevertap.com)

If you need, I can:

  • search again for a specific GitHub tag or CocoaPods/SwiftPM release, or
  • list the breaking changes from iOS v7.2.0 (if that helps).

Citations:


I need to verify the actual availability of CleverTap iOS SDK versions on CocoaPods:

I need to check the CleverTap iOS SDK GitHub releases directly to verify if version 7.4.0 exists:

iOS SDK version 7.4.0 does not exist—specify 7.2.1 instead.

CleverTap iOS SDK's latest version is 7.2.1, not 7.4.0. Version 7.4.x exists only for the Android SDK (v7.4.1), not iOS. Update the dependency to use an available iOS SDK version such as 7.2.1.

🤖 Prompt for AI Agents
In CleverTap/Plugins/Editor/CleverTapDependencies.xml around line 4, the iOS pod
version is set to 7.4.0 which does not exist on CocoaPods; replace the iOS SDK
version with a valid release (e.g., change CleverTap-iOS-SDK version to 7.2.1)
so the Pod specification references an available iOS SDK release, and update any
related comments or lockfiles to reflect the corrected version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants