Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enhancement] Create Channels Group #56

Closed
eyeveye opened this issue Aug 23, 2024 · 11 comments · Fixed by #87
Closed

[Enhancement] Create Channels Group #56

eyeveye opened this issue Aug 23, 2024 · 11 comments · Fixed by #87
Assignees
Labels
enhancement New feature or request platform/android s/needs-info Issue needs more info from the author

Comments

@eyeveye
Copy link

eyeveye commented Aug 23, 2024

Summary

For Android to be able to group the channels into group.

@eyeveye eyeveye added the enhancement New feature or request label Aug 23, 2024
@thomasgalliker
Copy link
Owner

Can you provide some more info, so I dont have to do the research work. I have never used channel groups before.

@eyeveye
Copy link
Author

eyeveye commented Aug 23, 2024

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:
image

@thomasgalliker
Copy link
Owner

I‘ll have a look at it.

@thomasgalliker
Copy link
Owner

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.

@thomasgalliker
Copy link
Owner

thomasgalliker commented Oct 31, 2024

@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...

@thomasgalliker thomasgalliker added the s/needs-info Issue needs more info from the author label Nov 12, 2024
@thomasgalliker
Copy link
Owner

thomasgalliker commented Nov 12, 2024

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.

@thomasgalliker
Copy link
Owner

@eyeveye could you have a look at the latest 3.1.x pre-release?
Happy new year 🎉

@thomasgalliker
Copy link
Owner

@eyeveye can you have a look at the latest 3.1.x-pre release of the nuget and let me know if the changes match your needs? Also, if you want to, have a look at the code changes in #87. From my point of view it looks good to merge it.

@eyeveye
Copy link
Author

eyeveye commented Feb 3, 2025

I have tried to assigned the group in the
yield return new NotificationChannelRequest
{
ChannelId = NotificationConstants.NOTIFICATION_DEFAULT_CHANNEL_ID,
ChannelName = "General",
Description = "General Channel",
LockscreenVisibility = NotificationVisibility.Public,
Importance = NotificationImportance.High,
Group = NotificationConstants.NOTIFICATION_OTHER_GROUP_CHANNEL_ID
//IsDefault = true
};

I can't see it from the Notification Categories in the phone.

@thomasgalliker
Copy link
Owner

Did you also create the channel group? Do you have a small repro app? Or did you try the sample app in this feature branch?

@eyeveye
Copy link
Author

eyeveye commented Mar 27, 2025

Did you also create the channel group? Do you have a small repro app? Or did you try the sample app in this feature branch?

This is good. I have tested it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request platform/android s/needs-info Issue needs more info from the author
Projects
None yet
2 participants