diff --git a/code/notificationbuilder/src/main/java/com/adobe/marketing/mobile/notificationbuilder/internal/builders/MultiIconNotificationBuilder.kt b/code/notificationbuilder/src/main/java/com/adobe/marketing/mobile/notificationbuilder/internal/builders/MultiIconNotificationBuilder.kt index fc57bb02..d2e97946 100644 --- a/code/notificationbuilder/src/main/java/com/adobe/marketing/mobile/notificationbuilder/internal/builders/MultiIconNotificationBuilder.kt +++ b/code/notificationbuilder/src/main/java/com/adobe/marketing/mobile/notificationbuilder/internal/builders/MultiIconNotificationBuilder.kt @@ -13,7 +13,9 @@ package com.adobe.marketing.mobile.notificationbuilder.internal.builders import android.app.Activity import android.app.NotificationManager +import android.app.PendingIntent import android.content.Context +import android.content.Intent import android.os.Bundle import android.widget.RemoteViews import androidx.core.app.NotificationCompat @@ -25,6 +27,7 @@ import com.adobe.marketing.mobile.notificationbuilder.internal.extensions.setRem import com.adobe.marketing.mobile.notificationbuilder.internal.extensions.setRemoteViewImage import com.adobe.marketing.mobile.notificationbuilder.internal.templates.MultiIconPushTemplate import com.adobe.marketing.mobile.services.Log +import java.util.Random internal object MultiIconNotificationBuilder { const val SELF_TAG = "MultiIconNotificationBuilder" @@ -67,13 +70,20 @@ internal object MultiIconNotificationBuilder { val closeButtonIntentExtra = Bundle(pushTemplate.data.getBundle()) // copy the bundle closeButtonIntentExtra.putString(PushTemplateConstants.PushPayloadKeys.STICKY, "false") - notificationLayout.setRemoteViewClickAction( + val dismissIntent = Intent(PushTemplateConstants.NotificationAction.DISMISSED) + trackerActivityClass?.let { + dismissIntent.setClass(context.applicationContext, trackerActivityClass) + } + dismissIntent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP) + val pendingIntent = PendingIntent.getActivity( context, - trackerActivityClass, + Random().nextInt(), + dismissIntent, + PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE + ) + notificationLayout.setOnClickPendingIntent( R.id.five_icon_close_button, - null, - null, - closeButtonIntentExtra + pendingIntent ) return AEPPushNotificationBuilder.construct( diff --git a/code/testapp/src/main/assets/basic/basic_remindlater.json b/code/testapp/src/main/assets/basic/basic_remindlater.json index fb1fce23..34ddeeda 100644 --- a/code/testapp/src/main/assets/basic/basic_remindlater.json +++ b/code/testapp/src/main/assets/basic/basic_remindlater.json @@ -16,5 +16,6 @@ "adb_sound": "bells", "adb_n_count": "1", "adb_sticky": "true", - "adb_n_priority": "PRIORITY_HIGH" + "adb_n_priority": "PRIORITY_HIGH", + "adb_tag": "remindLater" } \ No newline at end of file diff --git a/code/testapp/src/main/assets/filmstrip/filmstrip_wide.json b/code/testapp/src/main/assets/filmstrip/filmstrip_wide.json index bf8d0d2d..f62a2a10 100644 --- a/code/testapp/src/main/assets/filmstrip/filmstrip_wide.json +++ b/code/testapp/src/main/assets/filmstrip/filmstrip_wide.json @@ -2,11 +2,12 @@ "_msg": "Wide screen test", "adb_version": "1", "adb_title": "Wide screen test", + "adb_body": "Notification body for filmstrip carousal wide screen test", "adb_a_type": "WEBURL", "adb_car_mode": "manual", "adb_car_layout": "filmstrip", "adb_uri": "https://www.adobe.com", - "adb_items": "[{\"img\":\"https://i.imgur.com/HOCncHZ.jpeg\",\"txt\":\"1.91:1\"},{\"img\":\"https://i.imgur.com/6AYShKw.jpeg\",\"txt\":\"3:2\",\"uri\":\"https://firefly.adobe.com/red_jersey\"},{\"img\":\"https://i.imgur.com/2fyue9O.jpeg\",\"txt\":\"16:9\"]", + "adb_items": "[{\"img\":\"https://i.imgur.com/HOCncHZ.jpeg\",\"txt\":\"1.91:1\"},{\"img\":\"https://i.imgur.com/6AYShKw.jpeg\",\"txt\":\"3:2\",\"uri\":\"https://firefly.adobe.com/red_jersey\"},{\"img\":\"https://i.imgur.com/2fyue9O.jpeg\",\"txt\":\"16:9\"}]", "adb_body_ex": "Wide screen test", "adb_template_type": "car", "adb_small_icon": "chat_bubble", diff --git a/code/testapp/src/main/assets/inputbox/inputbox.json b/code/testapp/src/main/assets/inputbox/inputbox.json index 19b9e003..2eb6adba 100644 --- a/code/testapp/src/main/assets/inputbox/inputbox.json +++ b/code/testapp/src/main/assets/inputbox/inputbox.json @@ -1,6 +1,6 @@ { "adb_version": "1", - "adb_template_type": "basic", + "adb_template_type": "input", "adb_title": "Game request", "adb_body": "Shall we play a game?", "adb_sound": "bells", @@ -22,5 +22,5 @@ "adb_input_txt": "do you have something to say?", "adb_feedback_txt": "thank you for the input!", "adb_feedback_image": "thankyou", - "adb_input_intent": "intent name from app" + "adb_input_receiver": "developer intent action name" } \ No newline at end of file diff --git a/code/testapp/src/main/assets/timer/timer.json b/code/testapp/src/main/assets/timer/timer.json index d15e63df..a3934494 100644 --- a/code/testapp/src/main/assets/timer/timer.json +++ b/code/testapp/src/main/assets/timer/timer.json @@ -19,5 +19,6 @@ "adb_n_visibility": "PRIVATE", "adb_n_priority": "PRIORITY_DEFAULT", "adb_n_count": "1", - "adb_image": "https://i.ibb.co/QN078XB/Resize-image-project.jpg" + "adb_image": "https://i.ibb.co/QN078XB/Resize-image-project.jpg", + "adb_sticky": true } \ No newline at end of file diff --git a/code/testapp/src/main/assets/zerobezel/zerobezel.json b/code/testapp/src/main/assets/zerobezel/zerobezel.json index a5b93857..10395a7b 100644 --- a/code/testapp/src/main/assets/zerobezel/zerobezel.json +++ b/code/testapp/src/main/assets/zerobezel/zerobezel.json @@ -7,11 +7,10 @@ "adb_n_count": "1", "adb_n_priority": "PRIORITY_LOW", "adb_image": "https://www.pngall.com/wp-content/uploads/8/Sample-PNG-Image.png", - "adb_uri": "instabiz://opensecond", - "adb_a_type": "DEEPLINK", + "adb_a_type": "OPENAPP", "adb_template_type": "zb", "adb_body_ex": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam auctor luctus libero, molestie posuere massa vestibulum at. Mauris consectetur mi lorem, vitae aliquet sem tristique in. Curabitur imperdiet tortor vitae nunc aliquet tincidunt. Ut pellentesque lectus sagittis dolor egestas, sit amet pretium libero lacinia.", - "adb_col_style": "txt", + "adb_col_style": "img", "adb_channel_id": "2024", "adb_sticky": "true", "adb_ticker": "Ticker text", diff --git a/code/testapp/src/main/assets/zerobezel/zerobezel_colors.json b/code/testapp/src/main/assets/zerobezel/zerobezel_colors.json index d2fc43bb..bad3c8d5 100644 --- a/code/testapp/src/main/assets/zerobezel/zerobezel_colors.json +++ b/code/testapp/src/main/assets/zerobezel/zerobezel_colors.json @@ -14,7 +14,7 @@ "adb_clr_body": "00EE00", "adb_clr_title": "FF0000", "adb_clr_icon": "123456", - "adb_col_style": "txt", + "adb_col_style": "img", "adb_channel_id": "2024", "adb_sticky": "true", "adb_ticker": "Ticker text", diff --git a/code/testapp/src/main/assets/zerobezel/zerobezel_txt.json b/code/testapp/src/main/assets/zerobezel/zerobezel_txt.json new file mode 100644 index 00000000..7dda9155 --- /dev/null +++ b/code/testapp/src/main/assets/zerobezel/zerobezel_txt.json @@ -0,0 +1,18 @@ +{ + "adb_version": "1", + "adb_title": "game request", + "adb_body": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam auctor luctus libero, molestie posuere massa vestibulum at. Mauris consectetur mi lorem, vitae aliquet sem tristique in. Curabitur imperdiet tortor vitae nunc aliquet tincidunt. Ut pellentesque lectus sagittis dolor egestas, sit amet pretium libero lacinia.", + "adb_sound": "bingBong", + "adb_icon": "chat_bubble", + "adb_n_count": "1", + "adb_n_priority": "PRIORITY_LOW", + "adb_image": "https://www.pngall.com/wp-content/uploads/8/Sample-PNG-Image.png", + "adb_a_type": "OPENAPP", + "adb_template_type": "zb", + "adb_body_ex": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam auctor luctus libero, molestie posuere massa vestibulum at. Mauris consectetur mi lorem, vitae aliquet sem tristique in. Curabitur imperdiet tortor vitae nunc aliquet tincidunt. Ut pellentesque lectus sagittis dolor egestas, sit amet pretium libero lacinia.", + "adb_col_style": "txt", + "adb_channel_id": "2024", + "adb_sticky": "true", + "adb_ticker": "Ticker text", + "customKey": "custom data" +} \ No newline at end of file diff --git a/code/testapp/src/main/java/com/adobe/marketing/mobile/notificationbuilder/testapp/notificationBuilder/NotificationBroadcastReceiver.kt b/code/testapp/src/main/java/com/adobe/marketing/mobile/notificationbuilder/testapp/notificationBuilder/NotificationBroadcastReceiver.kt index 9ec484bb..a0173661 100644 --- a/code/testapp/src/main/java/com/adobe/marketing/mobile/notificationbuilder/testapp/notificationBuilder/NotificationBroadcastReceiver.kt +++ b/code/testapp/src/main/java/com/adobe/marketing/mobile/notificationbuilder/testapp/notificationBuilder/NotificationBroadcastReceiver.kt @@ -18,6 +18,7 @@ import android.content.Intent import androidx.core.app.NotificationManagerCompat import com.adobe.marketing.mobile.notificationbuilder.NotificationBuilder import com.adobe.marketing.mobile.notificationbuilder.NotificationConstructionFailedException +import com.adobe.marketing.mobile.notificationbuilder.RemindLaterHandler import com.adobe.marketing.mobile.notificationbuilder.testapp.AppConstants.NotificationBuilderConstants import com.adobe.marketing.mobile.util.StringUtils @@ -34,9 +35,8 @@ class NotificationBroadcastReceiver : BroadcastReceiver() { try { when (action) { - "remind_clicked" -> {} - "scheduled_notification_broadcast" -> { - // TODO: Implement logic for scheduled notification + "remind_clicked" -> { + RemindLaterHandler.handleRemindIntent(intent, NotificationBroadcastReceiver::class.java) } else -> { val builder = NotificationBuilder.constructNotificationBuilder(intent, NotificationTrackerActivity::class.java , diff --git a/code/testapp/src/main/res/raw/bells.wav b/code/testapp/src/main/res/raw/bells.wav new file mode 100644 index 00000000..1754e921 Binary files /dev/null and b/code/testapp/src/main/res/raw/bells.wav differ