From 159587c05ea9ce7f5c628a653a88d773fab19b66 Mon Sep 17 00:00:00 2001 From: Vassil Angelov Date: Tue, 29 Oct 2024 17:43:27 +0200 Subject: [PATCH 1/2] bug(MC-2299): Fix c2a param not tracked for open_url and close actions --- .../clevertap/android/sdk/inapp/CTInAppBaseFragment.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/clevertap-core/src/main/java/com/clevertap/android/sdk/inapp/CTInAppBaseFragment.java b/clevertap-core/src/main/java/com/clevertap/android/sdk/inapp/CTInAppBaseFragment.java index d11599b8b..daf7a9fe8 100644 --- a/clevertap-core/src/main/java/com/clevertap/android/sdk/inapp/CTInAppBaseFragment.java +++ b/clevertap-core/src/main/java/com/clevertap/android/sdk/inapp/CTInAppBaseFragment.java @@ -89,13 +89,13 @@ void openActionUrl(String url) { try { final Bundle formData = UriHelper.getAllKeyValuePairs(url, false); - String actionParts = formData.getString(Constants.KEY_C2A); - String callToAction = null; - if (actionParts != null) { - final String[] parts = actionParts.split("__dl__"); + String callToAction = formData.getString(Constants.KEY_C2A); + if (callToAction != null) { + final String[] parts = callToAction.split("__dl__"); if (parts.length == 2) { // Decode it here as wzrk_c2a is not decoded by UriHelper callToAction = URLDecoder.decode(parts[0], "UTF-8"); + formData.putString(Constants.KEY_C2A, callToAction); url = parts[1]; } } From 8a0294fe12a0eb8e11fbdc270e1d8f8632d1bffb Mon Sep 17 00:00:00 2001 From: Vassil Angelov Date: Mon, 4 Nov 2024 12:00:58 +0200 Subject: [PATCH 2/2] Extract __dl__ as a constant --- .../src/main/java/com/clevertap/android/sdk/Constants.java | 1 + .../com/clevertap/android/sdk/inapp/CTInAppBaseFragment.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/clevertap-core/src/main/java/com/clevertap/android/sdk/Constants.java b/clevertap-core/src/main/java/com/clevertap/android/sdk/Constants.java index 8e3c29f2d..39478b9ce 100644 --- a/clevertap-core/src/main/java/com/clevertap/android/sdk/Constants.java +++ b/clevertap-core/src/main/java/com/clevertap/android/sdk/Constants.java @@ -446,4 +446,5 @@ public interface Constants { String FLUSH_PUSH_IMPRESSIONS_ONE_TIME_WORKER_NAME = "CTFlushPushImpressionsOneTime"; + String URL_PARAM_DL_SEPARATOR = "__dl__"; } \ No newline at end of file diff --git a/clevertap-core/src/main/java/com/clevertap/android/sdk/inapp/CTInAppBaseFragment.java b/clevertap-core/src/main/java/com/clevertap/android/sdk/inapp/CTInAppBaseFragment.java index daf7a9fe8..06b9b5bfe 100644 --- a/clevertap-core/src/main/java/com/clevertap/android/sdk/inapp/CTInAppBaseFragment.java +++ b/clevertap-core/src/main/java/com/clevertap/android/sdk/inapp/CTInAppBaseFragment.java @@ -91,7 +91,7 @@ void openActionUrl(String url) { String callToAction = formData.getString(Constants.KEY_C2A); if (callToAction != null) { - final String[] parts = callToAction.split("__dl__"); + final String[] parts = callToAction.split(Constants.URL_PARAM_DL_SEPARATOR); if (parts.length == 2) { // Decode it here as wzrk_c2a is not decoded by UriHelper callToAction = URLDecoder.decode(parts[0], "UTF-8");