From 32a0e9be15089bd4dfc1cbc4b0e13c058edc5ed4 Mon Sep 17 00:00:00 2001 From: Hendy Irawan Date: Sat, 31 Oct 2020 00:36:29 +0700 Subject: [PATCH] [IMPROVEMENT] Android push notification as a heads-up notification (#2507) Co-authored-by: Diego Mello --- .../java/chat/rocket/reactnative/CustomPushNotification.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/android/app/src/play/java/chat/rocket/reactnative/CustomPushNotification.java b/android/app/src/play/java/chat/rocket/reactnative/CustomPushNotification.java index d9b8ebf5a..e0e6bd8cf 100644 --- a/android/app/src/play/java/chat/rocket/reactnative/CustomPushNotification.java +++ b/android/app/src/play/java/chat/rocket/reactnative/CustomPushNotification.java @@ -213,9 +213,11 @@ public class CustomPushNotification extends PushNotification { String CHANNEL_ID = "rocketchatrn_channel_01"; String CHANNEL_NAME = "All"; + // User-visible importance level: Urgent - Makes a sound and appears as a heads-up notification + // https://developer.android.com/training/notify-user/channels#importance NotificationChannel channel = new NotificationChannel(CHANNEL_ID, CHANNEL_NAME, - NotificationManager.IMPORTANCE_DEFAULT); + NotificationManager.IMPORTANCE_HIGH); final NotificationManager notificationManager = (NotificationManager) mContext.getSystemService(Context.NOTIFICATION_SERVICE); notificationManager.createNotificationChannel(channel);