-
Notifications
You must be signed in to change notification settings - Fork 66
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
How to sort notifications by id ? #376
Comments
I did try to add |
Set a sort key that orders this notification among other notifications from the same package. This can be useful if an external sort was already applied and an app would like to preserve this. Notifications will be sorted lexicographically using this value, although providing different priorities in addition to providing sort key may cause this value to be ignored. |
Hi, I am setting the same priority for all notifications, but they still don't get sorted. Channel: android.AddChannel(new NotificationChannelRequest
{
Id = $"my_channel_01",
Name = "Channel 1",
Description = "blablabla",
Importance = AndroidImportance.Low
}); Summary: var notification = new NotificationRequest
{
NotificationId = 1,
Title = "appName",
ReturningData = "none",
Group = "appName",
Android =
{
IsGroupSummary = true,
ChannelId = "my_channel_01",
Ongoing = false,
AutoCancel = false,
Priority = AndroidPriority.Low
}
}; Notifications: var notification = new NotificationRequest
{
NotificationId = getNotificationId(defaultPriority),
Title = "appName",
Subtitle = priorityNames[defaultPriority],
Description = notiText,
Group = "appName",
Android =
{
IconSmallName =
{
ResourceName = priorityIcons[defaultPriority]
},
IconLargeName =
{
ResourceName = priorityIcons[defaultPriority]
},
IsGroupSummary = false,
Ongoing = persistentNotification,
ChannelId = "my_channel_01",
AutoCancel = false,
Priority = AndroidPriority.Low
}
}; getNotificationId returns a number based on priority (high = 10000, medium = 20000, low = 30000) |
Can't find any option to do this but looks like it is possible in Android.
https://developer.android.com/reference/androidx/core/app/NotificationCompat.Builder#setSortKey(java.lang.String)
The text was updated successfully, but these errors were encountered: