A surprising number of apps want to update themselves from inside their ui. And homegrown methods of doing so are unreliable at best, and insecure at worst. It seems that flatpak could easily improve this situation by offering a portal that sandboxed apps can use to find out about and trigger updates. This would be strictly limited to updating the app itself, nothing else. Suggested API:
Since this is closely tied to flatpak itself, and the implementation would likely use libflatpak, it may make sense to put this portal into flatpak itself, instead of xdg-desktop-portal.