From 9b080985720a0ad49fd8eeba61c3b18f1dcd3b12 Mon Sep 17 00:00:00 2001 From: Mattermost Build Date: Thu, 21 Nov 2019 17:18:04 +0100 Subject: [PATCH] Automated cherry pick of #3590 (#3592) * Create notification channels only if supported * Update comment --- .../java/com/mattermost/rnbeta/CustomPushNotification.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/android/app/src/main/java/com/mattermost/rnbeta/CustomPushNotification.java b/android/app/src/main/java/com/mattermost/rnbeta/CustomPushNotification.java index 52573dcfe..602787c1f 100644 --- a/android/app/src/main/java/com/mattermost/rnbeta/CustomPushNotification.java +++ b/android/app/src/main/java/com/mattermost/rnbeta/CustomPushNotification.java @@ -530,6 +530,11 @@ public class CustomPushNotification extends PushNotification { } private void createNotificationChannels() { + // Notification channels are not supported in Android Nougat and below + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) { + return; + } + final NotificationManager notificationManager = (NotificationManager) mContext.getSystemService(Context.NOTIFICATION_SERVICE); mHighImportanceChannel = new NotificationChannel("channel_01", "High Importance", NotificationManager.IMPORTANCE_HIGH);