How to integrate other apps into Flatpak app?

Hello,

Let say a have Flatpak apps “AAA” that want to open a PDF reader for reading documentation or what ever, how do I do this? Do I have to include that PDF reader into Flatpak apps AAA?

But if I already have Flatpak PDF reader installed? Can I make AAA call external Flatpak PDF reader instead?

Would flatpak-spawn work in this case?

Thanks.

Hello,

If you want to open the file with the default application on the system use gtk_show_uri_on_window.

If you want to let the user choose with which application to open the file you can use GtkAppChooserDialog.

Otherwise, have a look at this issue https://github.com/flatpak/xdg-desktop-portal/issues/283 .

Thanks, will look into it.

If you want to let the user choose with which application to open the file you can use GtkAppChooserDialog.

Or just use the OpenURI portal https://flatpak.github.io/xdg-desktop-portal/portal-docs.html#gdbus-method-org-freedesktop-portal-OpenURI.OpenURI

Do you have some example? I’m not sure how to use it.

It depends on the programming language you’re using, it’s more of how to use D-Bus then how to do the portals calls actually

Let me know if this is off-topic.
If the application you want to use isn’t a standard one, it has to be included in this application’s Flatpak environment. I know of no way of doing that - apart from compiling the whole thing as part of this Flatpak.

Are there any Flatpak app that use it?