How to handle cutstom url protocols (like skype://) with AppImage?

Having AppImage of the app, how to make it support custom url protocols, so that it automatically opens when user clicks corresponding link (think skype:// like link) and handles it? deb and rpm can be made to register appropriate handlers during installation (not familiar with the actual process though), but what about AppImage?

Or maybe the question should be slightly different since I know how to register custom protocol with xdg-mime. However in the man for xdg-mime there’s such passage:

application must already be installed in the desktop menu
before it can be made the default handler.

So how does one install AppImage in the desktop menu? Simply dragging and droping it on a toolbar doesn’t seem to work. I assume here that registering it in the “desktop menu” should suffice to make it handle custom protocols. Also xdg-mime process is probably specific to Ubuntu. Would be great to know to to make it work in general on all linux platforms.

Ok I found this now:

How can I integrate AppImages with the system?

Using the optional appimaged daemon, you can easily integrate AppImages with the system. The daemon puts AppImages into the menus, registers MIME types, icons, all on the fly. You can download it from this repository. But it is entirely optional.

And this is probably the daemon:

Is it possible to integrate some kind of bootstrap procedure into the AppImage, so that it will install appimaged daemon on the very first launch in case it is not already installed in the system?

Ok, and I arrived at: AppImageLauncher.

So I guess the answer to the question is - you gotta do it manually.

But then there’s this passage:

This so-called “desktop integration” can’t be provided by the AppImages themselves even though some AppImages ship with a “desktop integration script” prompting the user to integrate the AppImages

So it should be possible to make a script that does the job automatically? So back to the second to original question - any hint on how to do that? Are there any hooks?

You could write a bash script that registers the AppImage and the protocol with the system, but I have never done it.

What should happen if the user has multiple versions of the app? I am not a huge fan of this type of integration for this reason.

I may be wrong, but won’t this work with the appimage deamon? I thought I read that some where.

appimaged copies certain files into the system. Which file is the protocol in?