junior-senior opened a new issue #221:
URL: https://github.com/apache/cordova-plugin-geolocation/issues/221
Hi all,
I've recently upgraded Ionic from 2 to 5 and for some reason this plugin
always results in a GPS time out using watch position on iOS, however, it works
without issue on Android. It has been tested on 3 different iOS devices and
none work.
`var watchOptions = {
timeout: 10000,
maximumAge: 3600,
enableHighAccuracy: highAccuracy
};
this.geoWatch = this.geolocation.watchPosition(watchOptions)
.subscribe((data) => {
//console.log(data);
if ('coords' in data) {
if (this.refreshStarted != true) {
this.refreshStarted = true;
this.processPing(data.coords);
this.updateStatus.next('done');
}
} else if (data['message'] == 'Position retrieval timed
out.') {
this.refreshStarted = false;
console.log('GPS timed out.');
this.stopLocationWatch();
this.startLocationWatch();
if (lastData) {
this.processPing(lastData);
}
} else {
console.log('Warning: empty GPS ping.');
// console.log(JSON.stringify(data, null, 4));
this.refreshStarted = false;
}
}, (error) => {
console.log(error);
console.log('GPS timed out.');
this.refreshStarted = false;
if (this.usingCache == false) {
this.updateStatus.next('error-gps');
}
});`
All the correct parts of entered in Info.plist in the config file, I've
tried deleting platforms and the plugin and re-building, it's added correctly
to app.module.ts. I've tried with 5.28.0, 5.30.0 and 5.31.1. I've been
searching for 3 days now and nothing has worked!
----------------------------------------------------------------
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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]