Custom Protocol and closed app


#1

Hi all,

I want to open my Electron app when user click on my-app://whatever link in a browser.

Using open-url works fine. But If my app is closed, it opens but I can’t get URL params.

I tried to put open-url event at differents places, in ready, will-finish-launching, at root, but I can’t catch params.

Any idea? Thanks for your help :slight_smile:


Custom url scheme
#2

Found solution with this post ElectronアプリをカスタムURIで起動する (in Japanese, thanks google translate :smiley: ) and the associated repository (I could not build app, but script is explicit)

Quick tips for those who are interested:

  • don’t call anything like dialog inside open-url callback. I don’t know why but it always broke my script.
  • example only handle closed app. You have to switch from resolve callback to execute once your app is open.

If anyone need help/details, ask me :slight_smile:


#3

I’ve seen your post but did not managed to get it done!
My question: [SOLVED] Open app and pass parameters with deep linking using Electron (macOS/win32)

Is there a way to provide such functionality using only electron-builder, not electron-packager?
In Windows i’ve done deep-linking with/without opened app! In OSX if app is opened, i catch the URL param, if closed the app starts but can’t catch the param!

I provide and a minimal reproducible project at GitHub with my changes. See my Q.

Any help appreciated!