Skip to content

Commit

Permalink
Merge pull request #32 from CleverTap/ansh/SDK1084
Browse files Browse the repository at this point in the history
Ansh/sdk1084 : SDK version 2.2.0
  • Loading branch information
root-ansh-ct authored Feb 14, 2022
2 parents 6fd5155 + 1109468 commit 0ac2057
Show file tree
Hide file tree
Showing 72 changed files with 450 additions and 52 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
Change Log
==========

Version 2.2.0 *(14 FEB, 2022)*
-------------------------------------------
- Add public APIs for Increment/Decrement ops and InApp Controls
- Deprecates `profileGetCleverTapID()`and `profileGetCleverTapAttributionIdentifier()`.
- Adds a new public method `getCleverTapID()` as an alternative to above-deprecated methods.
- Updated to [CleverTap Android SDK v4.4.0](https://github.com/CleverTap/clevertap-android-sdk/releases/tag/core-v4.4.0)
- Updated to [CleverTap iOS SDK v4.0.0](https://github.com/CleverTap/clevertap-ios-sdk/releases/tag/4.0.0)

Version 2.1.2 *(19 May, 2021)*
-------------------------------------------
- Updated to [CleverTap iOS SDK v3.9.4](https://github.com/CleverTap/clevertap-ios-sdk/releases/tag/3.9.4)
Expand Down
Binary file modified CleverTapUnityPlugin.unitypackage
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
88 changes: 87 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.1.2";
public const string Version = "2.2.0";

#if UNITY_IOS
void Start() {
Expand Down Expand Up @@ -674,14 +674,100 @@ public static string ProfileGet(string key) {
return CleverTap.Call<string>("profileGet", key);
}

/**
* Returns a unique CleverTap identifier suitable for use with install attribution providers.
* @return The attribution identifier currently being used to identify this user.
*
* Disclaimer: this method may take a long time to return, so you should not call it from the
* application main thread
*
* NOTE: Deprecated as of clevertap android core sdk version 4.2.0 and will be removed
* in future versions .
* instead listen for the id via CleverTapUnity#CleverTapInitCleverTapIdCallback() function
*/
public static string ProfileGetCleverTapAttributionIdentifier() {
return CleverTap.Call<string>("profileGetCleverTapAttributionIdentifier");
}

/**
* Returns a unique CleverTap identifier suitable for use with install attribution providers.
* @return The attribution identifier currently being used to identify this user.
*
* Disclaimer: this method may take a long time to return, so you should not call it from the
* application main thread
*
* NOTE: Deprecated as of clevertap android core sdk version 4.2.0 and will be removed
* in future versions .
* instead request for clevertapId via getCleverTapId() call and listen for response
* via CleverTapUnity#CleverTapInitCleverTapIdCallback() function
*/
public static string ProfileGetCleverTapID() {
return CleverTap.Call<string>("profileGetCleverTapID");
}

/*
* requests for a unique, asynchronous CleverTap identifier. The value will be available as json {"cleverTapID" : <value> } via
* CleverTapUnity#CleverTapInitCleverTapIdCallback() function
*/
public static void GetCleverTapId(){
CleverTap.Call("getCleverTapID");
}

/**
* This method is used to increment the given value.Number should be in positive range
*/
public static void ProfileIncrementValueForKey(string key, double val) {
CleverTap.Call("profileIncrementValueForKey",key, val);
}

/**
* This method is used to increment the given value.Number should be in positive range
*/
public static void ProfileIncrementValueForKey(string key, int val) {
CleverTap.Call("profileIncrementValueForKey",key, val);
}

/**
* This method is used to decrement the given value.Number should be in positive range
*/
public static void ProfileDecrementValueForKey(string key, double val) {
CleverTap.Call("profileDecrementValueForKey",key, val);
}

/**
* This method is used to decrement the given value.Number should be in positive range
*/
public static void ProfileDecrementValueForKey(string key, int val) {
CleverTap.Call("profileDecrementValueForKey",key, val);
}

/**
* Suspends display of InApp Notifications.
* The InApp Notifications are queued once this method is called
* and will be displayed once resumeInAppNotifications() is called.
*/
public static void SuspendInAppNotifications() {
CleverTap.Call("suspendInAppNotifications");
}

/**
* Suspends the display of InApp Notifications and discards any new InApp Notifications to be shown
* after this method is called.
* The InApp Notifications will be displayed only once resumeInAppNotifications() is called.
*/
public static void DiscardInAppNotifications() {
CleverTap.Call("discardInAppNotifications");
}

/**
* Suspends the display of InApp Notifications and discards any new InApp Notifications to be shown
* after this method is called.
* The InApp Notifications will be displayed only once resumeInAppNotifications() is called.
*/
public static void ResumeInAppNotifications() {
CleverTap.Call("resumeInAppNotifications");
}

public static void ProfileRemoveValueForKey(string key) {
CleverTap.Call("profileRemoveValueForKey", key);
}
Expand Down
36 changes: 36 additions & 0 deletions Plugin/CleverTapUnity/CleverTapUnity-Scripts/CleverTapUnity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,37 @@ void Awake(){
DontDestroyOnLoad(gameObject);
CleverTapBinding.SetDebugLevel(CLEVERTAP_DEBUG_LEVEL);
CleverTapBinding.Initialize(CLEVERTAP_ACCOUNT_ID, CLEVERTAP_ACCOUNT_TOKEN, CLEVERTAP_ACCOUNT_REGION);
//==========[Testing Newly added Clevertap APIs]============================================
// CleverTapBinding.GetCleverTapId();
// CleverTapBinding.ProfileIncrementValueForKey("add_int",2);
// CleverTapBinding.ProfileIncrementValueForKey("add_double",3.5);
// CleverTapBinding.ProfileDecrementValueForKey("minus_int",2);
// CleverTapBinding.ProfileDecrementValueForKey("minus_double",3.5);
// CleverTapBinding.SuspendInAppNotifications();
// CleverTapBinding.DiscardInAppNotifications();
// CleverTapBinding.ResumeInAppNotifications();
// CleverTapBinding.RecordEvent("Send Basic Push");

// CleverTapBinding.RecordEvent("Send Carousel Push");
// CleverTapBinding.RecordEvent("Send Manual Carousel Push");
// CleverTapBinding.RecordEvent("Send Filmstrip Carousel Push");
// CleverTapBinding.RecordEvent("Send Rating Push");
// CleverTapBinding.RecordEvent("Send Product Display Notification");
// CleverTapBinding.RecordEvent("Send Linear Product Display Push");
// CleverTapBinding.RecordEvent("Send CTA Notification");
// CleverTapBinding.RecordEvent("Send Zero Bezel Notification");
// CleverTapBinding.RecordEvent("Send Zero Bezel Text Only Notification");
// CleverTapBinding.RecordEvent("Send Timer Notification");
// CleverTapBinding.RecordEvent("Send Input Box Notification");
// CleverTapBinding.RecordEvent("Send Input Box Reply with Event Notification");
// CleverTapBinding.RecordEvent("Send Input Box Reply with Auto Open Notification");
// CleverTapBinding.RecordEvent("Send Input Box Remind Notification DOC FALSE");
// CleverTapBinding.RecordEvent("Send Input Box CTA DOC true");
// CleverTapBinding.RecordEvent("Send Input Box CTA DOC false");
// CleverTapBinding.RecordEvent("Send Input Box Reminder DOC true");
// CleverTapBinding.RecordEvent("Send Input Box Reminder DOC false");

//==========[Testing Newly added Clevertap APIs]============================================
if (CLEVERTAP_ENABLE_PERSONALIZATION) {
CleverTapBinding.EnablePersonalization();
}
Expand Down Expand Up @@ -111,6 +142,11 @@ void CleverTapPushOpenedCallback(string message) {
}
}

// returns a unique CleverTap identifier suitable for use with install attribution providers.
void CleverTapInitCleverTapIdCallback(string message) {
Debug.Log("unity received clevertap id: " + (!String.IsNullOrEmpty(message) ? message : "NULL"));
}

// returns the custom data associated with an in-app notification click
void CleverTapInAppNotificationDismissedCallback(string message) {
Debug.Log("unity received inapp notification dismissed: " + (!String.IsNullOrEmpty(message) ? message : "NULL"));
Expand Down
14 changes: 7 additions & 7 deletions Plugin/CleverTapUnity/Editor/CleverTapUnityDependencies.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@
<androidPackages>
<androidPackage spec="com.google.android.gms:play-services-base:17.4.0" />

<androidPackage spec="androidx.annotation:annotation:1.1.0" />
<androidPackage spec="androidx.annotation:annotation:1.2.0" />

<androidPackage spec="androidx.core:core:1.3.2" />
<androidPackage spec="androidx.core:core:1.3.0" />

<androidPackage spec="androidx.viewpager:viewpager:1.0.0" />

<androidPackage spec="androidx.fragment:fragment:1.2.5" />
<androidPackage spec="androidx.fragment:fragment:1.3.6" />

<androidPackage spec="com.google.android.material:material:1.2.1" />
<androidPackage spec="com.google.android.material:material:1.4.0" />

<androidPackage spec="androidx.appcompat:appcompat:1.2.0" />
<androidPackage spec="androidx.appcompat:appcompat:1.3.1" />

<androidPackage spec="androidx.recyclerview:recyclerview:1.1.0" />
<androidPackage spec="androidx.recyclerview:recyclerview:1.2.1" />

<androidPackage spec="com.android.installreferrer:installreferrer:2.1" />
<androidPackage spec="com.android.installreferrer:installreferrer:2.2" />
</androidPackages>
</dependencies>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified Plugin/CleverTapUnity/iOS/CleverTapSDK.framework/CleverTapSDK
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#import <Foundation/Foundation.h>
#import "CleverTap.h"

@interface CleverTap (InAppNotifications)

#if !CLEVERTAP_NO_INAPP_SUPPORT
/*!
@method
@abstract
Suspends and saves inApp notifications until 'resumeInAppNotifications' is called for current session.
Automatically resumes InApp notifications display on CleverTap shared instance creation. Pending inApp notifications are displayed only for current session.
*/
- (void)suspendInAppNotifications;

/*!
@method
@abstract
Discards inApp notifications until 'resumeInAppNotifications' is called for current session.
Automatically resumes InApp notifications display on CleverTap shared instance creation. Pending inApp notifications are not displayed.
*/
- (void)discardInAppNotifications;

/*!
@method
@abstract
Resumes displaying inApps notifications and shows pending inApp notifications if any.
*/
- (void)resumeInAppNotifications;

#endif

@end
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import Foundation;
#import <Foundation/Foundation.h>
#import "CleverTap.h"

@interface CleverTap (SSLPinning)
Expand Down
Loading

0 comments on commit 0ac2057

Please sign in to comment.