cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shazron Abdullah (JIRA)" <>
Subject [jira] [Updated] (CB-8078) geolocation.watchPosition only fires callback 1-2 times on success, & once on failure
Date Wed, 26 Nov 2014 01:40:13 GMT


Shazron Abdullah updated CB-8078:
    Component/s:     (was: iOS)

> geolocation.watchPosition only fires callback 1-2 times on success, & once on failure
> -------------------------------------------------------------------------------------
>                 Key: CB-8078
>                 URL:
>             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
> 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

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message