capacitor-community / background-geolocation

A Capacitor plugin that sends you geolocation updates, even while the app is in the background.
MIT License
177 stars 54 forks source link

Simplify plugin installation #73

Closed HarelM closed 1 year ago

HarelM commented 1 year ago

Is your feature request related to a problem? Please describe. I believe the current installation instructions are a bit too "long"

Describe the solution you'd like There are some steps that can be done in order to reduce the developer's need when using this plugin

  1. Register the plugin I think can be removed
  2. Add manifest for android for the permissions and (maybe) the service

Describe alternatives you've considered The current instructions are very well documented but I think they can be simplified.

Additional context This is from a first impression of the plugin and comparison to other plugins I've added to my project.

Documentation about android manifest stuff: https://capacitorjs.com/docs/plugins/android#manifest I'm not sure there's an option to reduce the effort for ios plist file, but I think any simplification is welcomed :-)

diachedelic commented 1 year ago

The instructions are minimally sufficient.

HarelM commented 1 year ago

Would it change your mind if I open a PR on it? Also would be nice to have this plugin work for the web as well and have a single API for all platforms. Let me know if this is something I can help with.

diachedelic commented 1 year ago

It might be possible to do background location tracking in the browser (see #31), if you would like to investigate.

By requiring the programmer to use registerPlugin directly, we avoid exporting a JavaScript interface. This simplifies packaging. If the Android permissions could be moved into an embedded manifest file, that would be nice.

HarelM commented 1 year ago

Ok, I'll look into adding the permissions to a manifest file. All the rest of the plugins that I use are doing the registerPlugin inside their code so that you don't need to do it yourself. While I agree this is simple and straight forward, it's still nice that you don't need to do it and that the plugin will take care of it. If we add the web part we'll need to create some javascript code which will need to be packed anyway. I'll continue the part related to web usage in the relevant issue thread and hopefully send a PR for the android stuff...