ToastNotificationManagerCompat Remove by Tag #4429
-
I am running a WinUI3 unpackaged desktop application so I am using the ToastNotificationManagerCompat
However, when I do this I am getting this exception
I also see that the DesktopNotificationManagerCompat is marked obsolete. Should I be doing this a different way? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Hi @Daniellled, thanks for reporting this. Could you open an issue so we can properly track and fix this? |
Beta Was this translation helpful? Give feedback.
-
Hi @Daniellled, yes, that class is obsolete and the replacement class is (It looks like you were also using some unofficial staging docs rather than docs.microsoft.com as linked above) ToastNotificationManagerCompat will work fully from unpackaged apps :) And if you want an example of how to handle toast activation from a WinUI 3 app, we have toasts functioning in the Windows App SDK Gallery app, here's the source for that: https://github.com/andrewleader/WindowsAppSDKGallery/blob/main/WindowsAppSDKGallery/App.xaml.cs#L60 |
Beta Was this translation helpful? Give feedback.
Hi @Daniellled, yes, that class is obsolete and the replacement class is
ToastNotificationManagerCompat
. Here's the docs for using it: https://docs.microsoft.com/windows/apps/design/shell/tiles-and-notifications/send-local-toast?tabs=desktop(It looks like you were also using some unofficial staging docs rather than docs.microsoft.com as linked above)
ToastNotificationManagerCompat will work fully from unpackaged apps :)
And if you want an example of how to handle toast activation from a WinUI 3 app, we have toasts functioning in the Windows App SDK Gallery app, here's the source for that: https://github.com/andrewleader/WindowsAppSDKGallery/blob/main/WindowsAppSDKGallery/App.xaml.cs#L60