You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2019/05/27 12:28:36 UTC
[GitHub] [cordova-plugin-geolocation] breautek removed a comment on issue
#155: Timestamp of getCurrentPosition wrong? (iOS 12)
breautek removed a comment on issue #155: Timestamp of getCurrentPosition wrong? (iOS 12)
URL: https://github.com/apache/cordova-plugin-geolocation/issues/155#issuecomment-496195395
This is something that comes up quite often, so I pasted my explanation below, the other question was more specific to android, but most of it still applies. The user settings may be different, but I still believe iOS has an "high accuracy" mode where it will use GPS, cellular towers, and wifi scanning to assist in giving you a consistent GPS points at the cost of more battery usage.
GPS features is something I heavily use in my apps and in my experience there are two things that can effect slow/non-existent GPS updates.
**1. User Settings**
On most android versions, the user may have location mode set "battery saving" -- which makes it so the phone requires an internet connection because it only uses wifi & mobile networks to determine location. Or "Device Only", which means the phone must connect to satellites to obtain a location. From a cold fix, it can take 10-15 minutes even in good conditions on a decent device before you start seeing stable GPS updates. The best location setting the phone can be in is "High Accuracy" mode (not to be confused with the api's highAccuracy option), which allows the phone to use any number of strategies to obtain a GPS update as quickly as possible. Note that this is a user setting that is outside the control of the app, however I'm sure there are plugins that allows you to open up the appropriate settings screen for the user. I've seen other apps do it.
**2. Poor Environment**
Even with the phone has high accuracy enabled in their location settings. Being in a poor environment can hinder the ability to receive GPS events, or will cause received updates to have inaccurate results. The perfect environment to have stable GPS outsides is outside away from buildings, in clear skies weather. My work office is in a basement of a large building. If I require good accurate GPS events in my testing, I literally cannot do the test at my desk. No joke, if I have to I'd have to take my test device outside of the building and walk around in the parking lot. Alternatively I use a simulator where I have the ability to manually simulate GPS events as if they were coming from the GPS hardware. I'd also like to note that this issue is not exclusive to Cordova. Any app, whether it be Google Maps, or something else that shows your location all exhibit location troubles when I'm in my workplace building.
In my apps, I use another third-party plugin called the Diagnostic plugin in conjunction with the geolocation plugin. It provides several APIs to figure out the current state of required features. Such as if the user has granted permissions, or if the GPS feature is turned off completely etc. I use this to provide helpful feedback to the user if they need to change something. https://github.com/dpa99c/cordova-diagnostic-plugin
> To clarify: I had clear sky on the roof of a 8-floor-building. Why would the GPS connection in these circumstances be so unstable?
To answer this question specifically would be very difficult. Debugging GPS related issues can be incredibly difficult.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org