I want to show notification banner only and don't want to add my notification in action center.. for some notifications.
Is there any API where I can decide this to add in the action center or not
I want to show notification banner only and don't want to add my notification in action center.. for some notifications.
Is there any API where I can decide this to add in the action center or not
Hi, Sorry to bother you, did you solve this problem, and is there anything else I can help you with?
Hello, does my answer solve your problem? If you have new questions, please feel free to ask us
Hello,
Welcome to our Microsoft Q&A platform!
In UWP, Toast Notification is sent via ToastNotifier
, which will inevitably leave a record in the action center.
But you can try to remove history after notification:
private async void SendNotificationWithoutHistory(ToastNotification toast)
{
toast.Tag = "testTag";
var notifier = ToastNotificationManager.CreateToastNotifier();
notifier.Show(toast);
await Task.Delay(3000);
ToastNotificationManager.History.Remove("testTag");
}
In this code, we first display a notification and then remove it from the action center after 3 seconds.
But currently, there is no API that can only show notifications without keeping records.
Thanks
You can try InAppNotification from Windows Community Toolkit (https://github.com/windows-toolkit/WindowsCommunityToolkit). It provide notification within app, easier to call
// Show notification with simple text (and a duration of 2 seconds)
int duration = 2000;
ExampleInAppNotification.Show("Some text.", duration);
6 people are following this question.
How to write and read multiple types of data using Data Writer and Data Reader
Consuming UWP mail api from WPF Desktop Bridge App
Get Network usage information in UWP apps
How to Get/Set Cookies in Windows.Web.Http API
Switch the ListView Datatemplate from one data template to another data template?