From 5d4af70ceaa217f804ed6b9abc6d4a2abe89ca90 Mon Sep 17 00:00:00 2001 From: Jules Rosser Date: Mon, 30 Jan 2023 15:27:33 +0000 Subject: [PATCH] intoduce Android notification categorisation --- .../customairshipextender/CustomNotificationProvider.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/android/app/src/main/java/com/expensify/chat/customairshipextender/CustomNotificationProvider.java b/android/app/src/main/java/com/expensify/chat/customairshipextender/CustomNotificationProvider.java index 9b8f64d51a53..10a25f05d7d4 100644 --- a/android/app/src/main/java/com/expensify/chat/customairshipextender/CustomNotificationProvider.java +++ b/android/app/src/main/java/com/expensify/chat/customairshipextender/CustomNotificationProvider.java @@ -1,5 +1,6 @@ package com.expensify.chat.customairshipextender; +import static androidx.core.app.NotificationCompat.CATEGORY_MESSAGE; import static androidx.core.app.NotificationCompat.PRIORITY_MAX; import android.app.NotificationChannel; @@ -82,6 +83,9 @@ protected NotificationCompat.Builder onExtendBuilder(@NonNull Context context, @ super.onExtendBuilder(context, builder, arguments); PushMessage message = arguments.getMessage(); + // Improve notification delivery by categorising as a time-critical message + builder.setCategory(CATEGORY_MESSAGE); + // Configure the notification channel or priority to ensure it shows in foreground if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { builder.setChannelId(CHANNEL_MESSAGES_ID);