Skip to content

Commit

Permalink
Profile APIs support for multiple data types (#51)
Browse files Browse the repository at this point in the history
* overload profile apis to support object

* Update version

* Update package

---------

Co-authored-by: Peter Wilkniss <[email protected]>
  • Loading branch information
nzagorchev and pwilkniss authored Oct 24, 2023
1 parent 85bec49 commit 835e3d3
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
Change Log
==========

Version 2.4.2 *(24 October, 2023)*
-------------------------------------------
- Profile APIs support for multiple data types
- Adds `OnUserLogin(Dictionary<string, object> properties)` and `ProfilePush(Dictionary<string, object> properties)`

Version 2.4.1 *(18 Sept, 2023)*
-------------------------------------------
- Updated to [CleverTap Android SDK v5.1.0](https://github.com/CleverTap/clevertap-android-sdk/releases/tag/corev5.1.0_ptv1.1.0)
Expand Down
Binary file modified CleverTapUnityPlugin.unitypackage
Binary file not shown.
Binary file not shown.
26 changes: 25 additions & 1 deletion Plugin/CleverTapUnity/CleverTapUnity-Scripts/CleverTapBinding.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
namespace CleverTap {
public class CleverTapBinding : MonoBehaviour {

public const string Version = "2.4.1";
public const string Version = "2.4.2";

#if UNITY_IOS
void Start() {
Expand Down Expand Up @@ -259,11 +259,21 @@ public static void OnUserLogin(Dictionary<string, string> properties) {
CleverTap_onUserLogin(propertiesString);
}

public static void OnUserLogin(Dictionary<string, object> properties) {
var propertiesString = Json.Serialize(properties);
CleverTap_onUserLogin(propertiesString);
}

public static void ProfilePush(Dictionary<string, string> properties) {
var propertiesString = Json.Serialize(properties);
CleverTap_profilePush(propertiesString);
}

public static void ProfilePush(Dictionary<string, object> properties) {
var propertiesString = Json.Serialize(properties);
CleverTap_profilePush(propertiesString);
}

public static string ProfileGet(string key) {
string ret = CleverTap_profileGet(key);
return ret;
Expand Down Expand Up @@ -769,10 +779,18 @@ public static void OnUserLogin(Dictionary<string, string> properties) {
CleverTap.Call("onUserLogin", Json.Serialize(properties));
}

public static void OnUserLogin(Dictionary<string, object> properties) {
CleverTap.Call("onUserLogin", Json.Serialize(properties));
}

public static void ProfilePush(Dictionary<string, string> properties) {
CleverTap.Call("profilePush", Json.Serialize(properties));
}

public static void ProfilePush(Dictionary<string, object> properties) {
CleverTap.Call("profilePush", Json.Serialize(properties));
}

public static string ProfileGet(string key) {
return CleverTap.Call<string>("profileGet", key);
}
Expand Down Expand Up @@ -1043,9 +1061,15 @@ public static void LaunchWithCredentials(string accountID, string token, string
public static void OnUserLogin(Dictionary<string, string> properties) {
}

public static void OnUserLogin(Dictionary<string, object> properties) {
}

public static void ProfilePush(Dictionary<string, string> properties) {
}

public static void ProfilePush(Dictionary<string, object> properties) {
}

public static string ProfileGet(string key) {
return "test";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ext {
targetSdkVersionVal = compileSdkVersionVal
buildToolsVersionVal = "33.0.0"

libraryVersion = "2.4.1"
libraryVersion = "2.4.2"
}

android {
Expand Down

0 comments on commit 835e3d3

Please sign in to comment.