2222using Microsoft . Windows . AppLifecycle ;
2323using Serilog ;
2424using LaunchActivatedEventArgs = Microsoft . UI . Xaml . LaunchActivatedEventArgs ;
25+ using Microsoft . Windows . AppNotifications ;
2526
2627namespace Coder . Desktop . App ;
2728
@@ -74,6 +75,7 @@ public App()
7475 services . AddOptions < MutagenControllerConfig > ( )
7576 . Bind ( builder . Configuration . GetSection ( MutagenControllerConfigSection ) ) ;
7677 services . AddSingleton < ISyncSessionController , MutagenController > ( ) ;
78+ services . AddSingleton < IUserNotifier , UserNotifier > ( ) ;
7779
7880 // SignInWindow views and view models
7981 services . AddTransient < SignInViewModel > ( ) ;
@@ -194,10 +196,14 @@ public void OnActivated(object? sender, AppActivationArguments args)
194196 _logger . LogWarning ( "URI activation with null data" ) ;
195197 return ;
196198 }
197-
198199 HandleURIActivation ( protoArgs . Uri ) ;
199200 break ;
200201
202+ case ExtendedActivationKind . AppNotification :
203+ var notificationArgs = ( args . Data as AppNotificationActivatedEventArgs ) ! ;
204+ HandleNotification ( null , notificationArgs ) ;
205+ break ;
206+
201207 default :
202208 _logger . LogWarning ( "activation for {kind}, which is unhandled" , args . Kind ) ;
203209 break ;
@@ -210,6 +216,12 @@ public void HandleURIActivation(Uri uri)
210216 _logger . LogInformation ( "handling URI activation for {path}" , uri . AbsolutePath ) ;
211217 }
212218
219+ public void HandleNotification ( AppNotificationManager ? sender , AppNotificationActivatedEventArgs args )
220+ {
221+ // right now, we don't do anything other than log
222+ _logger . LogInformation ( "handled notification activation" ) ;
223+ }
224+
213225 private static void AddDefaultConfig ( IConfigurationBuilder builder )
214226 {
215227 var logPath = Path . Combine (
0 commit comments