[MM-20640] Create notification channels only if supported (#3590)

* Create notification channels only if supported

* Update comment
This commit is contained in:
Miguel Alatzar
2019-11-21 09:12:49 -07:00
committed by Elias Nahum
parent ec99b65f00
commit f651da975f

View File

@@ -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);