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 E610F17E42 for ; Wed, 22 Oct 2014 15:26:35 +0000 (UTC) Received: (qmail 64602 invoked by uid 500); 22 Oct 2014 15:26:35 -0000 Delivered-To: apmail-cordova-issues-archive@cordova.apache.org Received: (qmail 64488 invoked by uid 500); 22 Oct 2014 15:26:35 -0000 Mailing-List: contact issues-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@cordova.apache.org Received: (qmail 64362 invoked by uid 99); 22 Oct 2014 15:26:35 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Oct 2014 15:26:35 +0000 Date: Wed, 22 Oct 2014 15:26:35 +0000 (UTC) From: "Steve Nelson (JIRA)" To: issues@cordova.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CB-5753) iOS: CDVLocation locationManager didFailWithError 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-5753?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14180040#comment-14180040 ] Steve Nelson commented on CB-5753: ---------------------------------- I think the bug here is that it only bubbles up to the JS layer if it get into that if statement on line 334. since the code on line 346 is outside of the if statement it always runs. Maybe what is needed is an else statement that still bubbles up the error to JS with another code? > iOS: CDVLocation locationManager didFailWithError > ------------------------------------------------- > > Key: CB-5753 > URL: https://issues.apache.org/jira/browse/CB-5753 > Project: Apache Cordova > Issue Type: Bug > Components: Plugin Geolocation > Affects Versions: 2.9.0, 2.9.1 > Environment: iOS > Reporter: Martin Robin > Labels: patch > > The delegate handler for didFailWithError appears to have a couple of issues... > According to the [documentation|https://developer.apple.com/library/ios/documentation/CoreLocation/Reference/CLLocationManagerDelegate_Protocol/CLLocationManagerDelegate/CLLocationManagerDelegate.html#//apple_ref/occ/intfm/CLLocationManagerDelegate/locationManager:didFailWithError:], {quote}If the location service is unable to retrieve a location right away, it reports a kCLErrorLocationUnknown error and keeps trying. In such a situation, you can simply ignore the error and wait for a new event.{quote} > The handler within CDVLocation does not however take this into account and as a result if this error is raised it causes the location manager to be shut down without any warning. > Within the same handler, there appears to be code to send a notification back to the JavaScript by way of the onError function. This notification is never received in the JavaScript so the error cannot be handled (by calling clearWatch and then restarting with a call to watchPosition for example). > The first problem is (I believe) fairly easily resolved; simply ignoring the error (though possibly notifying the JavaScript) would suffice. > I have no idea how to resolve the second problem. I have tried tracing the code and it appears to call commandDelegate::sendPluginResult (via returnLocationError) but the onError function in the (my) JavaScript does not receive the error. I do not understand how the plug-in model works enough to be able to follow up any further for myself. -- 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