Notification Activation Flow

Local app notifications require content, manifest activation, registration, and app-side routing.

Flow

Button click
  -> AppNotificationBuilder creates payload
  -> AppNotificationManager.Show displays notification
  -> User clicks notification
  -> Windows activates app through manifest/COM registration
  -> App registers notification manager
  -> App reads activation args
  -> App chooses foreground UI or silent action

Startup Order

_window = new MainWindow();

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

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

The official quickstart calls out that Register must happen before GetActivatedEventArgs.

Failure Modes

SymptomLikely cause
Notification does not showApp is elevated, notification settings, package/manifest issue
Click does nothingCOM activation manifest missing or mismatched GUID
Background button launches UI unexpectedlyDesktop apps must process activation arguments and decide behavior
Works while running, fails from closedClosed-app activation path not handled