Use Fused Location Provider for Android
Closed this issue · 5 comments
Getting a location under android is quite difficult. The standard API implemented now in capacitor returns the GPS provider which results in never getting a position indoors. This is not the case under iOS. A better way under Android is the Fused Location Provider which already handles that. Any chance we could migrate to the Fused Location Provider?
This would mean we have to include the Google Play services.
See docs here: https://developers.google.com/android/reference/com/google/android/gms/location/FusedLocationProviderClient
Interesting, seems like a reasonable change. This thread has some good discussion on it: https://stackoverflow.com/questions/33022662/android-locationmanager-vs-google-play-services?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa
This is a much needed pull request! Great job @JStumpp !
I have taken the liberty to turn this into a capacitor plugin in the meantime while we're waiting for this to be merged into the official capacitor repo
https://www.npmjs.com/package/@johannesnormannjensen/capacitor-fused-location
I have made this as a mean for other developers to use it while waiting. Please let me know if you have anything to add to this.
This really need to be merged. Actually GPS application are unusable.
Please merge this @adamdbradley, @bensperry or someone else of the @ionic-team
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out.