From a0d4296d17af189aa10600983d8a0af038601c50 Mon Sep 17 00:00:00 2001 From: hoshiizumiya Date: Thu, 14 May 2026 12:38:02 +0800 Subject: [PATCH 1/2] Fix app notifications IsSupported method to always return true Fix app notifications are not supported when app is running with administrator privileges (elevated). It should work in the elevated mode. --- dev/AppNotifications/AppNotificationManager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/AppNotifications/AppNotificationManager.cpp b/dev/AppNotifications/AppNotificationManager.cpp index bcee2ddfc5..cb5420e944 100644 --- a/dev/AppNotifications/AppNotificationManager.cpp +++ b/dev/AppNotifications/AppNotificationManager.cpp @@ -104,7 +104,7 @@ namespace winrt::Microsoft::Windows::AppNotifications::implementation bool AppNotificationManager::IsSupported() { - static bool isSupported{ !Security::IntegrityLevel::IsElevated() }; + static bool isSupported = true; return isSupported; } From 20bddcffaa9f805599eb6214eb8f91f1b859c8e9 Mon Sep 17 00:00:00 2001 From: hoshiizumiya Date: Thu, 14 May 2026 19:10:47 +0800 Subject: [PATCH 2/2] Protect call --- dev/AppNotifications/AppNotificationManager.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/dev/AppNotifications/AppNotificationManager.cpp b/dev/AppNotifications/AppNotificationManager.cpp index cb5420e944..c64a484967 100644 --- a/dev/AppNotifications/AppNotificationManager.cpp +++ b/dev/AppNotifications/AppNotificationManager.cpp @@ -427,14 +427,20 @@ namespace winrt::Microsoft::Windows::AppNotifications::implementation { return; } - + bool isCallingPreviewSupported = false; + try + { + isCallingPreviewSupported = winrt::AppNotificationConferencingConfig::IsCallingPreviewSupported(); + } + catch(...) {} + auto logTelemetry{ AppNotificationTelemetry::Show::Start( g_telemetryHelper, m_appId, notification.Payload(), notification.Tag(), notification.Group(), - winrt::AppNotificationConferencingConfig::IsCallingPreviewSupported()) }; + isCallingPreviewSupported) }; THROW_HR_IF(WPN_E_NOTIFICATION_POSTED, notification.Id() != 0);