From 316e96d79a4257377b119821da3ee6e37ae6df9b Mon Sep 17 00:00:00 2001 From: Piyush Kukadiya Date: Tue, 13 Sep 2022 16:05:03 +0530 Subject: [PATCH] fix(SDK-2160): add subtitle to notification header above android 12 for input box in PushTemplateReceiver --- .../android/pushtemplates/PushTemplateReceiver.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/clevertap-pushtemplates/src/main/java/com/clevertap/android/pushtemplates/PushTemplateReceiver.java b/clevertap-pushtemplates/src/main/java/com/clevertap/android/pushtemplates/PushTemplateReceiver.java index fc2442e30..6f1584d37 100644 --- a/clevertap-pushtemplates/src/main/java/com/clevertap/android/pushtemplates/PushTemplateReceiver.java +++ b/clevertap-pushtemplates/src/main/java/com/clevertap/android/pushtemplates/PushTemplateReceiver.java @@ -328,6 +328,11 @@ private void handleInputBoxNotification(Context context, Bundle extras, Intent i repliedNotification = new NotificationCompat.Builder(context); } setSmallIcon(context); + + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { + repliedNotification.setSubText(pt_subtitle); + } + repliedNotification.setSmallIcon(smallIcon) .setContentTitle(pt_title) .setContentText(extras.getString(PTConstants.PT_INPUT_FEEDBACK)) @@ -473,7 +478,7 @@ private void handleRatingNotification(Context context, Bundle extras) { if (notification != null) { contentViewRating = notification.bigContentView; contentViewSmall = notification.contentView; - } + } // why null check just return if no notification exist in drawer if (1 == extras.getInt(PTConstants.KEY_CLICKED_STAR, 0)) { contentViewRating.setImageViewResource(R.id.star1, R.drawable.pt_star_filled);