macOS/Windows AppLinks

Ángel Rubén Valdeolmos Carmona 586 Reputation points
2022-05-11T07:16:44.433+00:00

I have a requirement that when the user visits a website protocol with certain parameters (appname:url.com/param1/param2), the desktop application must open and read those parameters, I know that this is possible on iOS/Android, on desktop too? where can i read doc.

https://learn.microsoft.com/en-us/windows/msix/app-installer/install-parameters
https://developer.shotgridsoftware.com/af0c94ce/#registering-a-protocol-on-osx
https://stackoverflow.com/questions/68577785/how-to-make-url-protocol-to-launch-application-from-its-own-directory-instead

in Windows/macOS it would be something like this?

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
2,920 questions
0 comments No comments
{count} votes

Accepted answer
  1. Wenyan Zhang (Shanghai Wicresoft Co,.Ltd.) 26,626 Reputation points Microsoft Vendor
    2022-05-12T08:01:02.41+00:00

    Hello,

    I know that this is possible on iOS/Android, on desktop too? where can i read doc.

    Sure, For UWP platform please refer to Enable apps for websites using app URI handlers document, you could register to handle HTTP and HTTPS links in the app manifest and then associate your app and website with a JSON file, when you navigate the specific uri in the browser, it will launch the app automatically. You can get AbsolutePath from OnActivated method, then navigate to matched page with parameter.

    For macOS, you could check the macOS part here : https://developer.apple.com/documentation/xcode/allowing-apps-and-websites-to-link-to-your-content#topics
    I check the links in your question, CFBundleURLSchemes is suitable for macOS as well. It's similar to iOS, see: https://developer.apple.com/library/archive/featuredarticles/iPhoneURLScheme_Reference/Introduction/Introduction.html#//apple_ref/doc/uid/TP40007899 Try to add CFBundleURLTypes in your app, and launch your app in Safari for testing.

    I see the tag is dotnet-maui, you may need to invoke platform code. If you have any other issues, feel free to let me know.

    Best Regards,
    Wenyan Zhang


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful