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.
This commit is contained in:
Ruslan Boitsov 2017-10-28 15:44:10 +03:00 committed by GitHub
parent 88980d51d0
commit de67ceb446
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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