Scheduling of local windows notification not possible? #5046
Replies: 5 comments 24 replies
-
I believe this should be filed as a feature request (as a github issue), for that the |
Beta Was this translation helpful? Give feedback.
-
I don't use MAUI (WinUI 3, Windows App SDK 1.6.241114003 on Windows 10) and this works for me in unpackaged desktop apps : https://learn.microsoft.com/en-us/windows/apps/design/shell/tiles-and-notifications/scheduled-toast |
Beta Was this translation helpful? Give feedback.
-
The only thing that will help is creating feature requests in the repo. Here I created such a request: #5050 |
Beta Was this translation helpful? Give feedback.
-
If anyone wants to try UWP.Notification + MAUI, here is an example project on Github: Please note that the planned notification works without any problems in MAUI and that is not a problem. The problem is that we do not get the parameters passed to Windows back from Windows because MAUI no longer has an OnActivated method and UWP needs it. So the question is how do you read the Windows Notification parameters with UWP Notifications + MAUI when the app is closed and the app is restarted via Windows notification? pc |
Beta Was this translation helpful? Give feedback.
-
If someone needs scheduled notifications for MAUI, then you have to use UWP.Notifications Nuget (as of January 2025) and there is a workaround from @whiskhub to get the ID sent by Windows. However, we all hope that the WinAppSDK team will implement a complete migration from UWP.Notification to windowsAppSDK so that WinAppSDK can be used for local notification in MAUI (as is also planned by Microsoft) You can find a working example here: https://github.com/true-perfect-code/MauiApp1_UWPNotifications pc |
Beta Was this translation helpful? Give feedback.
-
Hi WindowsAppSDK-Team
MAUI applications are based on WindowsAppSDK and not on UWP therefore you have to go using Windows App SDK when implementing local Windows notifications.
Apart from the fact that the WinAppSDK documentation on MAUI notification is incomplete (see topic dotnet/maui#27092 (comment) ), it also seems that it is not possible to schedule the notification!
In UWP this is possible via the Schedule method, here is a short example:
Have I missed something, or is scheduling really not possible?
If notifications can't be scheduled, what is the point of having UWP transfer them? It really makes no sense to make a notification about windows within the running application, that would confuse the user extremely. A local notification only makes sense if you want to remind the user of something that the user himself has stored in the application (scheduling, alarm, etc.) and usually when his app is not running on the desktop (which will usually be the case).
My code in MAUI Windows currently looks like this:
It works of course, parameters are passed to Windows and when the app is closed and you click on the notification, the app is opened and the arguments are passed to app. The issue is that the notification sent to Wiondows is displayed here immediately (because of method Show) and this is usually not what you need for a Notification, because you want to display it to the user with a time delay sometime in 5 days (sceduled) when his stored appointment is due.
Regards
pc
Beta Was this translation helpful? Give feedback.
All reactions