Open eyeveye opened 2 months ago
Can you provide some more info, so I dont have to do the research work. I have never used channel groups before.
Hi,
Currently my code as follow:
I am using Plugin.Firebase.CloudMessaging. As you can see, there is a group called "Latest Result" which is the group for the rest of the channel.
private void CreateNotificationChannel() {
notificationManager.CreateNotificationChannelGroup(new NotificationChannelGroup(NotificationConstants.NOTIFICATION_LATEST_RESULT_GROUP_CHANNEL_ID, "Latest Result"));
notificationManager.CreateNotificationChannel(new NotificationChannel(
NotificationConstants.NOTIFICATION_LATEST_4D_CHANNEL_ID,
"4D",
NotificationImportance.High)
{ Group = NotificationConstants.NOTIFICATION_LATEST_RESULT_GROUP_CHANNEL_ID });
notificationManager.CreateNotificationChannel(new NotificationChannel(
NotificationConstants.NOTIFICATION_LATEST_TOTO_CHANNEL_ID,
"TOTO",
NotificationImportance.High)
{ Group = NotificationConstants.NOTIFICATION_LATEST_RESULT_GROUP_CHANNEL_ID });
notificationManager.CreateNotificationChannel(new NotificationChannel(
NotificationConstants.NOTIFICATION_LATEST_SWEEP_CHANNEL_ID,
"SWEEP",
NotificationImportance.High)
{ Group = NotificationConstants.NOTIFICATION_LATEST_RESULT_GROUP_CHANNEL_ID });
}
In Android App Notification Settings it will show as such:
I‘ll have a look at it.
I cannot find any hints regarding CreateNotificationChannelGroup in Plugin.Firebase.CloudMessaging. You probably use the Plugin.LocalNotification? Nevertheless, it's quite a straightforward implementation. I give it a try.
@eyeveye do you want to try the latest 3.x pre release? I extended the INotificationChannels interface with channel group operations. Also, you can set the initial list of groups and channels via options (see MauiProgram of the sample app).
Question: Since you're using notification channels in your app --> Would you expect that the Plugin.FirebasePushNotifications library creates a default notification channel by itself (automatically at startup time) or would you leave this to the dev of the app if a defaul notification channel needs to be created or not. (The current 3.1.x pre release no longer creates a default notification channel. You have to do it by yourself if you want one...). I'm not 100% sure what is the better option. Not everyone would use notification channels I guess...
The brach is ready to be merged. If you want to have a look at the latest 3.1.x pre-release, I'd highly appreciate it.
Summary
For Android to be able to group the channels into group.