Search code examples
macosprotocolsdesktop-applicationelectroncustom-url

Custom url protocol for OSX desktop app using electron by atom


I am new to dekstop app by electron. However i built a desktop app using this source code and just changing the links to my site. Now I have a functional desktop app for mac.

But i want to open my app using a link say appName://and-some-link-follows

How can i implement custom url schema to open dekstop app whenever i click appName://....

For example: I want to do something like Slack desktop app which opens up by clicking slack://and-some-link

Any help please. Stuck here for 2 days. Thanks in advance.


Solution

  • I found it.

    1. Do a build for your app
    2. Right click -> show package content
    3. In info.plist add the following

    Can't pase code. So in image

    1. Open app once to register customURL into system.

    In terminal enter /System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -dump|egrep "(bindings.*:$)"|sort to check wheather yours is in the list.