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

ASF GitHub Bot commented on CB-5753:
------------------------------------

GitHub user tiff opened a pull request:

    https://github.com/apache/cordova-plugin-geolocation/pull/29

    Do not stop updating location when the error is 'kCLErrorLocationUnknown'

    After 8-12 minutes the location plugin stops updating because of an error 
that can be ignored (kCLErrorLocationUnknown).
    This is a fix for the following issue: 
https://issues.apache.org/jira/browse/CB-5753

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/protonet/cordova-plugin-geolocation 
fix_geolocation_watch_ios

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/cordova-plugin-geolocation/pull/29.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #29
    
----
commit 55194aab45a17335e7bc581c3ce031c5311991f9
Author: Christopher Blum <[email protected]>
Date:   2014-11-05T10:23:43Z

    Do not stop updating location when the error is 'kCLErrorLocationUnknown'

----


> 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
>            Assignee: Shazron Abdullah
>              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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to