-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to get location on non GMS devices #47
Comments
Reading the code of mauron85's plugin, found out his plugin is using:
Where onLocation implements the LocationListener. |
Just figured out that this plugin is mainly based on GMS APIs. I tried to added in location service from Android APIs, it worked but I believe there is a much better way implementing this. Please see the below code of BackgroundGeolocationService.java. I referenced the code from mauron's plugin which include marianhello's and tenforwardconsulting's code. I'm pretty bad with frontend so please don't judge what I am doing. Just an idea on how to get location without GMS services. Code not solid enough for a PR, if author is keen to include this feature, I will be waiting.
|
After all, I tried to combine extra part from mauron85's plugin into this one. For anyone who needs extra precision on location, please check the extra code that got copied over(I gotta say mauron85's plugin was solid until maintainence stopped). In the code, it checked whether GMS is installed(copied code from Geolocation plugin), if installed use this plugin's original method. If not, use mauron85's method. It's probably better to write a new plugin, but I'm not good enough on that. But author please consider the use case of non gms devices. I noticed Google is promoting using its Google Play services. But there is not only Google Play Store in the world. As Huawei promotes its App Gallery over the next few years or so, people still needs to face this problem. Well, yes, ionic is owned by Google so is Capacitor. But the point is here. It would be great to support non-GMS devices.
|
This is very interesting. I wasn't aware that there was an alternative to Google Location Services. I agree that non-Google devices should be supported. If anyone has the time to neatly incorporate this alternate strategy I will consider a pull request. |
Describe the bug
It is unable to get locations on non-GMS devices.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Locations should be available on all devices with GPS.
Smartphone (please complete the following information):
So I basically moved over from cordova mauron85's plugin. I migrated the entire project from cordova to capacitor with a new generate ionic app. I also implemented the capactior Geolocation plugin. The Geolocation plugin clearly logged that without GMS the plugin cannot work.
I was just wondering is it possible to use the plugin without GMS services? I noticed that transistorsoft's plugin also requires GMS. Has things changed that location plugin needs to utilise GMS API to fetch locations?
As this plugin is fairly light weight, would it be possible to add support for devices without GMS?
In addition, would you like to open a donation channel so people use this plugin can at least financially help maintaining this repo?
The text was updated successfully, but these errors were encountered: