flutter-geolocator icon indicating copy to clipboard operation
flutter-geolocator copied to clipboard

[Feature Request]: linux: switch to xdg-desktop-portal

Open emersion opened this issue 1 year ago • 5 comments

Is there already an issue requesting this feature?

Please select affected platform(s)

  • [ ] Android
  • [ ] iOS
  • [X] Linux
  • [ ] macOS
  • [ ] Web
  • [ ] Windows

Use case

Right now the Linux plugin uses either the GNOME-specific API, either Geoclue directly. However these interfaces shouldn't be used inside of a sandbox like Flatpak.

Instead, org.freedesktop.portal.Location should be used. It works both outside and inside sandboxes.

Proposal

Use org.freedesktop.portal.Location instead of other APIs.

Specific requirements or considerations

No response

Additional information or context

No response

emersion avatar Nov 12 '23 19:11 emersion

Dear @emersion,

Thanks for filing the feature request. Can you elaborate a bit on the subject? Why shouldn't these interfaces be used inside a sandbox? And what would be the advantages of using the free desktop.portal.Location for the user/developer? Can you point us to some relevant documentation?

Kind regards,

TimHoogstrate avatar Nov 13 '23 08:11 TimHoogstrate

Why shouldn't these interfaces be used inside a sandbox?

The sandbox prevents the app from querying regular D-Bus services. Only a few standard D-Bus interfaces are available. See https://docs.flatpak.org/en/latest/basic-concepts.html.

what would be the advantages of using the free desktop.portal.Location for the user/developer?

For the user, increased control and security: the portal will display an authorization UI that the user will need to accept, just like on Android/iOS. The user can revoke the permission if they want to.

For the developer, being able to correctly work in a sandbox like Flatpak.

emersion avatar Nov 13 '23 08:11 emersion

Dear @emersion,

Thanks for your input. It looks like something interesting to investigate. Unfortunately, currently the team lacks the relevant knowledge to the subject. We are not sure what impact it has on existing linux package. You could help us a lot us a lot if you could propose or file a PR containing the changes in a new package next to the "old" package.

Kind regards,

TimHoogstrate avatar Nov 13 '23 11:11 TimHoogstrate

Got it. I don't know when I'll have time to work on this, but will keep it in my TODO list.

emersion avatar Nov 13 '23 11:11 emersion

https://pub.dev/packages/xdg_desktop_portal can be used btw

bilelmoussaoui avatar Jun 28 '24 19:06 bilelmoussaoui