andalou
November 11, 2016, 6:13pm
1
Hello, i use the cordova plugin for geolocation but on many times the getCurrentPosition don’t return me the position of the user.
The plugin return me this:
PositionError { code: 2, message: "Unknown error acquiring position" }
I would to know the reason of this error …
Thanks !
andalou
November 13, 2016, 11:04am
2
Hello, anybody have a replies ?
andalou
November 23, 2016, 1:06pm
3
Hello, anybody have a replies ?
up
hbmedia
November 23, 2016, 1:08pm
4
I have similar problem. I tried cordovaGeolocation but it doesn’t work for me at all. Unfortunatelu not many users can help with this problem. I’m still waiting for answers on my question.
Could you please post a codepen? We need to see some code before trying to help you.
Thanks
In case someone else stumbles on this.
The error codes according to the source code
NSLog(@“locationManager::didFailWithError %@”, [error localizedFailureReason]);
CDVLocationData* lData = self.locationData;
if (lData && __locationStarted) {
// TODO: probably have to once over the various error codes and return one of:
// PositionError.PERMISSION_DENIED = 1;
// PositionError.POSITION_UNAVAILABLE = 2;
// PositionError.TIMEOUT = 3;
NSUInteger positionError = POSITIONUNAVAILABLE;
if (error.code == kCLErrorDenied) {
positionError = PERMISSIONDENIED;
}
[self returnLocationError:positionError withMessage:[error localizedDescription]];
}