Skip to content

Commit

Permalink
Release v2.4.1 (#49)
Browse files Browse the repository at this point in the history
* GetCleverTapID return value

* [SDK-3121] Init CleverTapUnityManager on App Launch (#46)

* initial commit to handle notification clicked for Android 12

* update to 2.4.1 aar

* fix typo in CleverTapBinding

* update package and changelog

* Use CT Android SDK 5.1.0

* Update version (#48)

---------

Co-authored-by: Peter Wilkniss <[email protected]>
  • Loading branch information
nzagorchev and pwilkniss authored Sep 18, 2023
1 parent 2ffe391 commit 85bec49
Show file tree
Hide file tree
Showing 12 changed files with 23 additions and 7 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.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)
- Fixes push notification clicked event handling for Android 12+

Version 2.4.0 *(15 May, 2023)*
-------------------------------------------
- Adds below new public APIs to support [CleverTap Android SDK v5.0.0](https://github.com/CleverTap/clevertap-android-sdk/releases/tag/corev5.0.0_ptv1.0.9)
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.
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.0";
public const string Version = "2.4.1";

#if UNITY_IOS
void Start() {
Expand Down Expand Up @@ -531,7 +531,7 @@ public static void MarkReadInboxMessageForID(string messageId) {

public static void MarkReadInboxMessagesForIDs(string[] messageIds) {
int arrLength = messageIds.Length;
CleverTap_MarkReadInboxMessagesForIDs(messageIds, arrLength);
CleverTap_markReadInboxMessagesForIDs(messageIds, arrLength);
}

public static void RecordInboxNotificationViewedEventForID(string messageId) {
Expand Down Expand Up @@ -1098,6 +1098,7 @@ public static void ResumeInAppNotifications() {
}

public static string GetCleverTapID() {
return "testCleverTapID";
}

public static void RecordScreenView(string screenName) {
Expand Down Expand Up @@ -1242,4 +1243,4 @@ public static void IsPushPermissionGranted(){
}
#endif
}
}
}
2 changes: 2 additions & 0 deletions Plugin/CleverTapUnity/Editor/CleverTapUnityDependencies.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,7 @@
<androidPackage spec="com.android.installreferrer:installreferrer:2.2" />

<androidPackage spec="org.jetbrains.kotlin:kotlin-stdlib:1.5.31" />

<androidPackage spec="androidx.work:work-runtime:2.7.1" />
</androidPackages>
</dependencies>
2 changes: 2 additions & 0 deletions Plugin/CleverTapUnity/iOS/CleverTapUnityManager.mm
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ + (void)launchWithAccountID:(NSString*)accountID andToken:(NSString *)token {

+ (void)launchWithAccountID:(NSString*)accountID token:(NSString *)token region:(NSString *)region {
[CleverTap setCredentialsWithAccountID:accountID token:token region:region];
// Initialize CleverTapUnityManager to register listeners and set delegates
[CleverTapUnityManager sharedInstance];
[[CleverTap sharedInstance] notifyApplicationLaunchedWithOptions:nil];
}

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.0"
libraryVersion = "2.4.1"
}

android {
Expand Down Expand Up @@ -51,7 +51,7 @@ dependencies {
// This will add classes from com.unity3d.player to our library which will allow the ClevertapPlugin.java class to get access to current unity activity and work on it accordingly
compileOnly fileTree('libs')

implementation 'com.clevertap.android:clevertap-android-sdk:5.0.0'
implementation 'com.clevertap.android:clevertap-android-sdk:5.1.0'
implementation 'androidx.annotation:annotation:1.2.0'
implementation 'androidx.appcompat:appcompat:1.6.0-rc01'
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public void onNewIntent(Intent intent){

private void handleIntent(Intent intent) {
if (intent != null) {
CleverTapUnityPlugin.handleIntent(intent);
CleverTapUnityPlugin.handleIntent(intent, this);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import android.content.Intent;
import android.location.Location;
import android.net.Uri;
import android.os.Build;
import android.os.Build.VERSION_CODES;
import android.os.Bundle;
import android.text.TextUtils;
Expand Down Expand Up @@ -100,7 +101,7 @@ private static void changeCredentials(final String accountID, final String accou
CleverTapAPI.changeCredentials(accountID, accountToken, region);
}

static void handleIntent(Intent intent) {
static void handleIntent(Intent intent, Activity activity) {
if (intent == null) {
return;
}
Expand All @@ -117,6 +118,11 @@ static void handleIntent(Intent intent) {
Bundle extras = intent.getExtras();
boolean isPushNotification = (extras != null && extras.get("wzrk_pn") != null);
if (isPushNotification) {

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
CleverTapAPI.getDefaultInstance(activity).pushNotificationClickedEvent(extras);
}

JSONObject data = new JSONObject();

for (String key : extras.keySet()) {
Expand Down

0 comments on commit 85bec49

Please sign in to comment.