From b0516abebffa6043e111068501370c79733f39a5 Mon Sep 17 00:00:00 2001 From: Mattermost Build Date: Thu, 21 Nov 2019 17:16:33 +0100 Subject: [PATCH] Automated cherry pick of #3590 (#3591) * 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 3399afe5f..fc3eaaf01 100644 --- a/android/app/src/main/java/com/mattermost/rnbeta/CustomPushNotification.java +++ b/android/app/src/main/java/com/mattermost/rnbeta/CustomPushNotification.java @@ -507,6 +507,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);