© 2026 Hedgehog Software, LLC
// Get the listener using Windows.UI.Notifications.Management; using Windows.UI.Notifications; using Windows.Foundation.Metadata; internal class Program { private static void Main(string[] args) { if (ApiInformation.IsTypePresent("Windows.UI.Notifications.Management.UserNotificationListener")) { // Listener supported! // Get the listener Console.WriteLine("Yep"); UserNotificationListener listener = UserNotificationListener.Current; UserNotificationListenerAccessStatus accessStatus = await listener.RequestAccessAsync(); switch (accessStatus) { case UserNotificationListenerAccessStatus.Allowed: // Yay! Proceed as normal break; case UserNotificationListenerAccessStatus.Denied: break; case UserNotificationListenerAccessStatus.Unspecified: break; } } else { Console.WriteLine("Nop"); } } }