Return-Path: X-Original-To: apmail-cordova-issues-archive@minotaur.apache.org Delivered-To: apmail-cordova-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0A5F2D0A4 for ; Fri, 17 May 2013 13:33:19 +0000 (UTC) Received: (qmail 21305 invoked by uid 500); 17 May 2013 13:33:17 -0000 Delivered-To: apmail-cordova-issues-archive@cordova.apache.org Received: (qmail 21257 invoked by uid 500); 17 May 2013 13:33:17 -0000 Mailing-List: contact issues-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cordova.apache.org Delivered-To: mailing list issues@cordova.apache.org Received: (qmail 21233 invoked by uid 99); 17 May 2013 13:33:17 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 17 May 2013 13:33:17 +0000 Date: Fri, 17 May 2013 13:33:17 +0000 (UTC) From: "Pepe Cano (JIRA)" To: issues@cordova.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Comment Edited] (CB-3027) getCurrentPosition timeout does not work and it blocks application execution MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ 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