From 48709602b75ebfc1c356f42f9d901379dbd074ae Mon Sep 17 00:00:00 2001 From: piyush-kukadiya <61137760+piyush-kukadiya@users.noreply.github.com> Date: Mon, 8 Jul 2024 18:30:15 +0530 Subject: [PATCH] task(notification) - remove unused notification icon url from core and push templates SDK-3772 (#600) Co-authored-by: CTLalit <144685420+CTLalit@users.noreply.github.com> --- .../main/java/com/clevertap/android/sdk/Constants.java | 1 - .../bitmap/NotificationBitmapDownloadRequestHandler.kt | 6 ------ .../java/com/clevertap/android/pushtemplates/Utils.java | 5 +---- sample/build.gradle | 8 ++++---- 4 files changed, 5 insertions(+), 15 deletions(-) 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 fa7f7f0bc..5637e7112 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 @@ -61,7 +61,6 @@ public interface Constants { int DEFINE_VARS_EVENT = 8; String variablePayloadType = "varsPayload"; String WZRK_FETCH = "wzrk_fetch"; - String ICON_BASE_URL = "http://static.wizrocket.com/android/ico/"; String NOTIFICATION_CLICKED_EVENT_NAME = "Notification Clicked"; String NOTIFICATION_VIEWED_EVENT_NAME = "Notification Viewed"; String SC_OUTGOING_EVENT_NAME = "SCOutgoing"; diff --git a/clevertap-core/src/main/java/com/clevertap/android/sdk/bitmap/NotificationBitmapDownloadRequestHandler.kt b/clevertap-core/src/main/java/com/clevertap/android/sdk/bitmap/NotificationBitmapDownloadRequestHandler.kt index f3019ac2b..830ef34b6 100644 --- a/clevertap-core/src/main/java/com/clevertap/android/sdk/bitmap/NotificationBitmapDownloadRequestHandler.kt +++ b/clevertap-core/src/main/java/com/clevertap/android/sdk/bitmap/NotificationBitmapDownloadRequestHandler.kt @@ -25,12 +25,6 @@ class NotificationBitmapDownloadRequestHandler( ) } - // Simply stream the bitmap - if (!srcUrl.startsWith("http")) { - bitmapDownloadRequest.bitmapPath = "${Constants.ICON_BASE_URL}/$srcUrl" - } - - val downloadedBitmap: DownloadedBitmap = iBitmapDownloadRequestHandler.handleRequest(bitmapDownloadRequest) return Utils.getDownloadedBitmapPostFallbackIconCheck(fallbackToAppIcon, context, downloadedBitmap) diff --git a/clevertap-pushtemplates/src/main/java/com/clevertap/android/pushtemplates/Utils.java b/clevertap-pushtemplates/src/main/java/com/clevertap/android/pushtemplates/Utils.java index 00fe5d2b6..6bfaae337 100644 --- a/clevertap-pushtemplates/src/main/java/com/clevertap/android/pushtemplates/Utils.java +++ b/clevertap-pushtemplates/src/main/java/com/clevertap/android/pushtemplates/Utils.java @@ -63,10 +63,7 @@ public static Bitmap getNotificationBitmap(String icoPath, boolean fallbackToApp if (icoPath == null || icoPath.equals("")) { return fallbackToAppIcon ? getAppIcon(context) : null; } - // Simply stream the bitmap - if (!icoPath.startsWith("http")) { - icoPath = Constants.ICON_BASE_URL + "/" + icoPath; - } + Bitmap ic = getBitmapFromURL(icoPath,context); return (ic != null) ? ic : ((fallbackToAppIcon) ? getAppIcon(context) : null); } diff --git a/sample/build.gradle b/sample/build.gradle index 2db7e033c..7b97dab6d 100644 --- a/sample/build.gradle +++ b/sample/build.gradle @@ -18,8 +18,8 @@ android { applicationId "com.clevertap.demo" minSdkVersion 21 targetSdkVersion 34 - versionCode 200015 - versionName "2.0.0-full" + versionCode 6020200 + versionName "6.2.2" multiDexEnabled true testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } @@ -152,13 +152,13 @@ dependencies { implementation "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.72" implementation "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:3.1.1"*/ - remoteImplementation("com.clevertap.android:clevertap-android-sdk:6.2.0") + remoteImplementation("com.clevertap.android:clevertap-android-sdk:6.2.1") remoteImplementation("com.clevertap.android:clevertap-geofence-sdk:1.3.0") //remoteImplementation("com.clevertap.android:clevertap-xiaomi-sdk:1.5.4") remoteImplementation("com.clevertap.android:push-templates:1.2.3") remoteImplementation("com.clevertap.android:clevertap-hms-sdk:1.3.4") - stagingImplementation("com.clevertap.android:clevertap-android-sdk:6.2.0") + stagingImplementation("com.clevertap.android:clevertap-android-sdk:6.2.1") stagingImplementation("com.clevertap.android:clevertap-geofence-sdk:1.3.0") //stagingImplementation("com.clevertap.android:clevertap-xiaomi-sdk:1.5.4") stagingImplementation("com.clevertap.android:push-templates:1.2.3")