forked from Ivasoft/mattermost-mobile
[MM-20640] Create notification channels only if supported (#3590)
* Create notification channels only if supported * Update comment
This commit is contained in:
committed by
Elias Nahum
parent
ec99b65f00
commit
f651da975f
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user