diff --git a/UWP XMPP Client/App.xaml.cs b/UWP XMPP Client/App.xaml.cs index 60403a56c..17a852a4b 100644 --- a/UWP XMPP Client/App.xaml.cs +++ b/UWP XMPP Client/App.xaml.cs @@ -217,16 +217,13 @@ private async Task onActivatedOrLaunchedAsync(IActivatedEventArgs args) Logger.Info("App activated by protocol activation with: " + protocolActivationArgs.Uri.ToString()); // If we're currently not on a page, navigate to the main page - if (rootFrame.Content is null) + if (!Settings.getSettingBoolean(SettingsConsts.INITIALLY_STARTED)) { - if (!Settings.getSettingBoolean(SettingsConsts.INITIALLY_STARTED)) - { - rootFrame.Navigate(typeof(AddAccountPage), "App.xaml.cs"); // ToDo add arguments - } - else - { - rootFrame.Navigate(typeof(ChatPage), "App.xaml.cs"); // ToDo add arguments - } + rootFrame.Navigate(typeof(AddAccountPage), "App.xaml.cs"); // ToDo add arguments + } + else + { + rootFrame.Navigate(typeof(ChatPage), protocolActivationArgs); // ToDo add arguments } } else if (args is ToastNotificationActivatedEventArgs toastActivationArgs) diff --git a/UWP XMPP Client/Pages/ChatPage.xaml.cs b/UWP XMPP Client/Pages/ChatPage.xaml.cs index d00db0b31..42efa36aa 100644 --- a/UWP XMPP Client/Pages/ChatPage.xaml.cs +++ b/UWP XMPP Client/Pages/ChatPage.xaml.cs @@ -13,6 +13,7 @@ using UWP_XMPP_Client.Classes.Collections; using UWP_XMPP_Client.DataTemplates; using UWP_XMPP_Client.Dialogs; +using Windows.ApplicationModel.Activation; using Windows.UI.Core; using Windows.UI.Xaml; using Windows.UI.Xaml.Controls; @@ -235,6 +236,13 @@ protected async override void OnNavigatedTo(NavigationEventArgs e) { toastActivationString = chatToastActivation.CHAT_ID; } + else if(e.Parameter is ProtocolActivatedEventArgs protocolActivationArgs) + { + if(!string.IsNullOrEmpty(protocolActivationArgs.Uri.PathAndQuery)) + { + // ToDo: Handle Uri activation + } + } loadChats(toastActivationString); loading_grid.Visibility = Visibility.Collapsed;