Skip to content

Commit

Permalink
Fixed notification channels and groups for Android
Browse files Browse the repository at this point in the history
  • Loading branch information
Clon1998 committed Nov 19, 2023
1 parent 54dff1d commit 19a3d9f
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions common/lib/service/notification_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,14 @@ class NotificationService {
}

void onMachineAdded(Machine machine) {
List<NotificationChannel> channelsOfmachines = _channelsForMachine(machine);
for (var channels in channelsOfmachines) {
_notifyAPI.setChannel(channels);
}
// Channels wont work since the group needs to be created first!
// List<NotificationChannel> channelsOfmachines = _channelsForMachine(machine);
// for (var channels in channelsOfmachines) {
// _notifyAPI.setChannel(channels);
// }
_setupMachineFcmUpdater(machine);
_registerLocalMessageHandlingForMachine(machine);
logger.i("Added notifications channels and stream-listener for ${machine.logName}");
logger.i("Added stream-listener for ${machine.logName}");
}

void onMachineRemoved(String uuid) {
Expand Down Expand Up @@ -207,8 +208,14 @@ class NotificationService {
List<NotificationChannel> channels = [
NotificationChannel(
channelKey: 'basic_channel',
channelName: 'General Notifications',
channelDescription: 'Notifications regarding updates and infos about Mobileraker!',
channelName: 'News & Updates',
channelDescription: 'Stay updated with Mobileraker! Get the latest news and important info here.',
channelGroupKey: 'mobileraker_default_grp',
),
NotificationChannel(
channelKey: 'marketing_channel',
channelName: 'Promotions',
channelDescription: 'Be the first to know about special promotions and discounts!',
channelGroupKey: 'mobileraker_default_grp',
)
];
Expand Down

0 comments on commit 19a3d9f

Please sign in to comment.