How to configure a flatpak app as default application to handle whatsapp links

Information

  • Flathub desktop whatsapp client: io.github.mimbrero.WhatsAppDesktop

How can you configure xdg-open to handle this urls

https://api.whatsapp.com/send?phone=593995686521&_fb_noscript=1

I means, you can create whatsapp buttons using html from this tutorials. Then from chrome browser you can click that button, and there how show the top menu that allow you select an installed application.

  • e.g. the flatpak application io.github.mimbrero.WhatsAppDesktop

Or if it is the only one application opens automatically.

Think can use xdg-open, but have problems with the following command.

flatpak run io.github.mimbrero.WhatsAppDesktop 'https://api.whatsapp.com/send?phone=593995686521&_fb_noscript=1'
# or
flatpak run io.github.mimbrero.WhatsAppDesktop 'https://wa.link/cw03ii'

Because only open the desktop client, without focus int the corresponding user, in this case the user with the number defined in the url.

Currently in the chrome browser when I click the button it opens another tab.

href of the button https://wa.link/cw03ii

linktree of example, click in ‘contactanos por whatsapp’

e.g.This is the top menu that is showed in zoom application case.
Screenshot from 2024-06-04 18-09-35

The idea is to work like the official whatsapp desktop client in windows11.
Thanks in advanced.

Added f40