You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Sergey Grebnov (JIRA)" <ji...@apache.org> on 2015/12/28 09:53:49 UTC
[jira] [Updated] (CB-8078) geolocation.watchPosition only fires
callback 1-2 times on success, & once on failure
[ https://issues.apache.org/jira/browse/CB-8078?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Sergey Grebnov updated CB-8078:
-------------------------------
Labels: ios triaged (was: )
> geolocation.watchPosition only fires callback 1-2 times on success, & once on failure
> -------------------------------------------------------------------------------------
>
> Key: CB-8078
> URL: https://issues.apache.org/jira/browse/CB-8078
> Project: Apache Cordova
> Issue Type: Bug
> Components: Plugin Geolocation
> Affects Versions: 3.6.0
> Environment: tested iOS versions 6 & 8 using iOS SDK 8.1
> Reporter: Jacob G
> Labels: ios, triaged
>
> On Cordova 3.6, with IOS SDK 8.1, I am observing that after calling geolocation.watchPosition, I may get either 1-2 geolocationSuccess results, or a geolocationError (kCLErrorDomain error 0, or timeout). If I get those 1-2 success results, then nothing else fires again until an error timeout. After the error, nothing else fires again. If I call clearWatch and watchPosition again, then the process repeats.
> What is going on here? I would expect to keep getting periodic geolocationSuccess calls, and if there is a geolocationError then I should at least keep getting updates either with success or failure. Why does the event firing stop, and I have to reset it by creating a new watch? I actually get the best results by just calling geolocation.getCurrentPosition periodically using my own timer.
> I did notice in the debugger that the location manager delegate is logging "locationManager::didFailWithError (null)" right after calling watchPosition, even if I later get geolocationSuccess.
> This occurs on both iPhone 6 running iOS 8.1, as well as iPod Touch 4 running iOS 6.
> The relevant code is straightforward:
> var geoWatchID = navigator.geolocation.watchPosition(geolocationSuccess,
> geolocationError, {
> maximumAge: 5000,
> timeout: 60000,
> enableHighAccuracy: true
> });
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org