2121using Microsoft . Windows . AppLifecycle ;
2222using Serilog ;
2323using LaunchActivatedEventArgs = Microsoft . UI . Xaml . LaunchActivatedEventArgs ;
24+ using Microsoft . Windows . AppNotifications ;
2425
2526namespace Coder . Desktop . App ;
2627
@@ -70,6 +71,7 @@ public App()
7071 services . AddOptions < MutagenControllerConfig > ( )
7172 . Bind ( builder . Configuration . GetSection ( MutagenControllerConfigSection ) ) ;
7273 services . AddSingleton < ISyncSessionController , MutagenController > ( ) ;
74+ services . AddSingleton < IUserNotifier , UserNotifier > ( ) ;
7375
7476 // SignInWindow views and view models
7577 services . AddTransient < SignInViewModel > ( ) ;
@@ -188,10 +190,14 @@ public void OnActivated(object? sender, AppActivationArguments args)
188190 _logger . LogWarning ( "URI activation with null data" ) ;
189191 return ;
190192 }
191-
192193 HandleURIActivation ( protoArgs . Uri ) ;
193194 break ;
194195
196+ case ExtendedActivationKind . AppNotification :
197+ var notificationArgs = ( args . Data as AppNotificationActivatedEventArgs ) ! ;
198+ HandleNotification ( null , notificationArgs ) ;
199+ break ;
200+
195201 default :
196202 _logger . LogWarning ( "activation for {kind}, which is unhandled" , args . Kind ) ;
197203 break ;
@@ -204,6 +210,12 @@ public void HandleURIActivation(Uri uri)
204210 _logger . LogInformation ( "handling URI activation for {path}" , uri . AbsolutePath ) ;
205211 }
206212
213+ public void HandleNotification ( AppNotificationManager ? sender , AppNotificationActivatedEventArgs args )
214+ {
215+ // right now, we don't do anything other than log
216+ _logger . LogInformation ( "handled notification activation" ) ;
217+ }
218+
207219 private static void AddDefaultConfig ( IConfigurationBuilder builder )
208220 {
209221 var logPath = Path . Combine (
0 commit comments