I've develop a WPF application that I've converter through Desktop App Converter and runs ok.
I´ve added toast notifications calling UWP APIs from desktop app as is explained here https://blogs.msdn.microsoft.com/tiles_and_toasts/2015/10/16/quickstart-handling-toast-activations-from-win32-apps-in-windows-10/
But to be able to open the app automatically when user tap on the toast, I had to create a shortcut and register a COM component same way as https://github.com/WindowsNotifications/desktop-toasts and it's also ok.
I think It´s too much work compared with a UWP app where default behaviour is just this, open app without any code.
How could I open the app tapping toast in my converted app throw the Bridge, same way as a truly UWP?
Thanks.
There is a simple solution, the technical points as follow:
Some detailed steps we need to notice:
Using protocal activation type in your payload of toast notification:
<toast activationType='protocol' launch='mytoastsample:'> <visual> <binding template='ToastGeneric'> <text>Click to launch Wpf Toast Sample</text> </binding> </visual> </toast>
After converting the application to UWP app, we need to open the Output directory and locate the AppxManifest.xml file.
Append the protocol association extension in the AppxManifest.xml file
<Application Id="WpfToastSample" Executable="WpfToastSample.exe" EntryPoint="Windows.FullTrustApplication"> <uap:VisualElements DisplayName="WpfToastSample" Description="WpfToastSample" BackgroundColor="#777777" Square150x150Logo="Assets\SampleAppx.150x150.png" Square44x44Logo="Assets\SampleAppx.44x44.png" /> <Extensions> <uap3:Extension Category="windows.protocol"> <uap3:Protocol Name="mytoastsample" Parameters="/p "%1"" /> </uap3:Extension> </Extensions> </Application>
I created a sample in here
The screenshot(gif): LINK