cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Winterbourne (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CB-3027) getCurrentPosition timeout does not work and it blocks application execution
Date Thu, 15 Aug 2013 13:37:49 GMT

    [ https://issues.apache.org/jira/browse/CB-3027?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13740963#comment-13740963
] 

David Winterbourne commented on CB-3027:
----------------------------------------

I am experiencing the same problem with Cordova 2.9.0 and Xcode 4.5.2, though it is sporadic.
I tried setting the timeout to some very small number, but this made no difference. I have
console log statements immediately before the call and then immediately inside both the success
and error callbacks. I see the statement before the call, but not the ones in the callbacks.
                
> getCurrentPosition timeout does not work and it blocks application execution
> ----------------------------------------------------------------------------
>
>                 Key: CB-3027
>                 URL: https://issues.apache.org/jira/browse/CB-3027
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: iOS
>    Affects Versions: 2.5.0, 2.6.0
>         Environment: 
>            Reporter: Pepe Cano
>            Assignee: Shazron Abdullah
>            Priority: Critical
>             Fix For: 2.8.0
>
>
> I have experienced this problem with cordova 2.5 & 2.6 in iOS 6.1.3, iPhone 4.
> Timeout param is not working, so I decided to implement the same behavior with timing-function,
however _getCurrentPosition_  seems to be executed synchronously instead of asynchronously,
and because _timeout_ does not work, neither locationTimeout function or error callback are
executed and the application is blocked waiting for getCurrentPosition response.
> {code}
>       var positionError = function() {
>            /// do something on error
>       };
>       var locationTimeout = window.setTimeout(function() {
>           // work-around to solve timeout error
>           positionError();
>       }, 1000);
>       navigator.geolocation.getCurrentPosition( function(response) {
>           clearTimeout(locationTimeout);
>           positionNext(response);
>       }, function(error) {
>           clearTimeout(locationTimeout);
>           positionError();
>       }, { maximumAge: 3000, timeout: 1000 });
> {code}
> Could I misunderstand any internal functionality?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message