From de67ceb4461f85a5e66cad5043a0e36e03c3d5a2 Mon Sep 17 00:00:00 2001 From: Ruslan Boitsov Date: Sat, 28 Oct 2017 15:44:10 +0300 Subject: [PATCH] Fix for #876 The notifications really can't work under Oreo, because you make the channel with some strange id, while providing the id as the name in the next argument. Maybe not the best fix, but I find this string to be as cool of an id as it is of a name. Definitely better than having no notifications at all. --- .../tasks/notification/NotificationSchedulerJobTask.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/fastaccess/provider/tasks/notification/NotificationSchedulerJobTask.java b/app/src/main/java/com/fastaccess/provider/tasks/notification/NotificationSchedulerJobTask.java index 6b885981..cdda4daf 100644 --- a/app/src/main/java/com/fastaccess/provider/tasks/notification/NotificationSchedulerJobTask.java +++ b/app/src/main/java/com/fastaccess/provider/tasks/notification/NotificationSchedulerJobTask.java @@ -271,7 +271,7 @@ public class NotificationSchedulerJobTask extends JobService { NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); if (notificationManager != null) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { - NotificationChannel notificationChannel = new NotificationChannel(String.valueOf(id), + NotificationChannel notificationChannel = new NotificationChannel(notification.getChannelId(), notification.getChannelId(), NotificationManager.IMPORTANCE_DEFAULT); notificationChannel.setShowBadge(true); notificationManager.createNotificationChannel(notificationChannel); @@ -297,4 +297,4 @@ public class NotificationSchedulerJobTask extends JobService { public Notification notification; public Comment comment; } -} \ No newline at end of file +}