cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pepe Cano (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (CB-3027) getCurrentPosition timeout does not work and it blocks application execution
Date Fri, 17 May 2013 13:33:17 GMT

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

Pepe Cano edited comment on CB-3027 at 5/17/13 1:33 PM:
--------------------------------------------------------

[~shazron], I think the problem comes because the setTimeout and [self startLocation:enableHighAccuracy]
are executed before hidding the splashscreen with navigator.splashscreen.hide(). In this case,
the timeout callback is never executed.

May you confirm that this could be an issue?

In my case, calling navigator.geolocation.getCurrentPosition after hide the splashscreen works
without any issue.
                
      was (Author: ppcano):
    [~shazron], I think the problem comes because the setTimeout and [self startLocation:enableHighAccuracy]
are executed before hidding the splashscreen with navigator.splashscreen.hide()

May you confirm that this could be an issue?

In my case, calling navigator.geolocation.getCurrentPosition after hide the splashscreen works
without any issue.
                  
> 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