There was a request recently at work where, what if we could click a link in a Power BI report to trigger some arbitrary action in our tools.
Below is an example of how to register and then use a custom URL protocol handler in C#.
Calling RegisterUrlScheme will create a registry entry that will allow us to launch the application using a custom uri scheme.
With something like this below, we can always ensure that the application is always registered and if launched though the uri scheme, handle it appropriately.
This means that we can now click on links like myApp:// and embed the url anywhere.
As the result in the c# client is a Uri, we can easily parse query strings and extract any parameters we may need.