Using Deep Links to open a snap

Hello all,

I am developing a flutter app and I am publishing it to the Snapstore. For my next release I want to add deep links:

Deep links are a type of link that send users directly to an app instead of a website or a store . They are used to send users straight to specific in-app locations, saving users the time and energy locating a particular page themselves – significantly improving the user experience. source

I am using this package and here it was mentioned that it is up to the installer to configure the deep link. Now I am curious if this is possible at all with snaps and if so, how is it possible?

Thank you very much for your time.

You need to modify the .desktop file that snapd uses to generate the desktop entry. Primarily you need:

  1. A line registering the protocol. e.g:
  1. Modify the exec= line to establish what arguments are acceptable, with valid argument types here.

So for example

[Desktop Entry]
Comment=A meme notetaking application
Exec=CarrollNotes %u

If this is done correctly, other applications will be able to call your protocol handler, and the arguments would be passed to your snap to handle. You could then hypothetically launch CarrollNotes://OpenNote?=foobar and the snap would be passed the argument and be free to respond to it.

@James-Carroll how can I test a link like that?

I setup my .desktop like this

[Desktop Entry]
Comment=You are learning Japanese? Then you need to try DaKanji!
Exec=dakanji %u

After installing the snap and typing DaKanji://OpenNote into Firefox’s search bar nothing happens.