Comments (10)
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
I hope this information helps.
from cordova-plugin-geolocation.
I have the same issue. Seems to happen only sometimes. Sometimes it resolves in a few milliseconds / a second, sometimes it takes a minute or longer to resolve. The callback is just not executed.
from cordova-plugin-geolocation.
@Gurjit-ONEBCG Nokia 6 and iOS 6 doesn't make sense. Do you mean Android 6 maybe?
@GPlay97 What platform and device are your experiences with?
@shokry055 What platform and device? What does return code 3 TO
mean?
from cordova-plugin-geolocation.
Well I have the same problem, if I check the logs:
11-16 11:28:17.404 3420 21768 I GCoreUlr: No valid location reports to store
11-16 11:28:18.365 20227 20554 D GeolocationPlugin: We are entering execute
11-16 11:28:23.382 20227 20554 D GeolocationPlugin: We are entering execute
11-16 11:28:28.418 20227 20554 D GeolocationPlugin: We are entering execute
11-16 11:28:32.525 3420 19568 I GCoreUlr: Filtering location: Location[g 45.XXXXXX,13.XXXXXX acc=3 et=+22h11m35s905ms alt=68.50113677978516 vel=0.07393644 mock {Bundle[{mockLocation=true}]}]
11-16 13:04:38.453 3420 6966 I GCoreUlr: Successfully inserted 1 locations
But Response is not OK :(
from cordova-plugin-geolocation.
"same problem" as who? Original poster said that "Getting location with high accuracy taking time more than 4 mins " - what you posted took 15 seconds from the timestamps.
from cordova-plugin-geolocation.
Ye it took 15s for triggering error with no response, there is one missing line there, when successfully get location:
11-16 13:04:38.453 3420 6966 I GCoreUlr: Successfully inserted 1 locations
from cordova-plugin-geolocation.
Another example:
11-16 13:22:49.058 17763 17858 D GeolocationPlugin: We are entering execute
11-16 13:22:54.077 17763 17858 D GeolocationPlugin: We are entering execute
11-16 13:22:59.101 17763 17858 D GeolocationPlugin: We are entering execute
11-16 13:23:02.264 3420 11768 I GCoreUlr: Filtering location: Location[g 45.XXXXXX,13.XXXXXX acc=1 et=+1d0h6m5s663ms alt=67.32038879394531 vel=0.4008691 mock {Bundle[{mockLocation=true}]}]
11-16 13:23:02.264 3420 11768 I GCoreUlr: No valid location reports to store
11-16 13:23:04.122 17763 17858 D GeolocationPlugin: We are entering execute
from cordova-plugin-geolocation.
No solution for this yet?
from cordova-plugin-geolocation.
@carliblaz What device and OS version are you using?
@UlisesCeca What problem exactly are you referring to? Until now there is no clear report with all data in this issue, so it is hard to solve anything.
from cordova-plugin-geolocation.
Closing due to lack of response.
from cordova-plugin-geolocation.
Related Issues (20)
- geoocation not returning anything when device has no internet connection HOT 1
- iOS 14: Infinite value in returned location data causes app crash HOT 2
- Geolocation getcurrent position passing 0 (Time out error) HOT 5
- !important Android 12 new approximate location and precise location HOT 4
- IOS 15 Geolocation permission message issue. HOT 12
- iOS 15 - ionic app geolocation permission prompt message showing ionic://localhost HOT 2
- geolocation plugin is throwing an error on location request on electron (windows) platform
- [iOS] Location update are disabled after one kCLErrorLocationUnknown HOT 6
- Ionic - Position error:application does not have sufficient geolocation permission HOT 2
- GeoLocation permissions not being asked [SOLUTION] HOT 1
- [iOS permission bug] wrong logic in didChangeAuthorizationStatus hook, permission can be asked in some unexpected cases HOT 10
- [question android api 31 32] approximate access to geolocation for getCurrentLocation HOT 6
- Unable to fetch Location on VIVO Devices HOT 70
- iOS 16 CDVLocation.m throwing UI unresponsiveness warning in XCode - causing app to crash. HOT 7
- Next version release HOT 2
- Description String override in android as in iOS HOT 4
- this.geolocation.clearWatch is not a function HOT 1
- Android 33 issue when initializing HOT 3
- Geolocation working on android 13,14 even 8 but not on android 12 function does not call no error in console HOT 11
- Heading is set to NaN if speed is 0 or null. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cordova-plugin-geolocation.