The delegate handler for didFailWithError appears to have a couple of issues...
According to the documentation,
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.
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.