Send App Notifications

Use Windows App SDK app notifications for local desktop notifications. Test without elevation.

Send A Notification

using Microsoft.Windows.AppNotifications;
using Microsoft.Windows.AppNotifications.Builder;

var notification = new AppNotificationBuilder()
    .AddText("Export complete")
    .AddArgument("action", "open-export")
    .BuildNotification();

AppNotificationManager.Default.Show(notification);

Activation Flow

For packaged apps, notification activation needs manifest COM registration and app startup handling.

At startup:

AppNotificationManager.Default.NotificationInvoked += OnNotificationInvoked;
AppNotificationManager.Default.Register();

var activatedArgs = AppInstance.GetCurrent().GetActivatedEventArgs();

The official quickstart says to call Register before GetActivatedEventArgs.

Test Checklist

App is not elevated:
Manifest activation configured:
Notification shown:
Click foreground path handled:
Button/background-like action handled in app code:
App closed activation path handled:

Gotcha: App notifications are not supported for apps running elevated as administrator. Show may fail silently.