Error in geolocation code
Helo I need help please
My code for geolocation work on iphone sdk 3.1.3 but does not work in 4.0
I get the following error: Error Domain=kCLErrorDomain Code=0 "The operation couldn?t be completed. (kCLErrorDomain error 0.)"
I'm using the code
Titanium.Geolocation.getCurrentPosition(function(e)
{
if (e.error)
{
Titanium.API.info(e.error);
return;
}
var longitude = e.coords.longitude;
var latitude = e.coords.latitude;
});
Thanks!!
2 Answers
-
On Simulator:
http://www.how2s.org/index.php/How_to_interpret_iPhone_Development_Error_Messages_and_what_to_do_to_resolve_them#Error_Domain.3DkCLErrorDomainCode.3D0.22The_operation_couldn.E2.80.99t_becompleted..28kCLErrorDomain_error_0..29.22
But on device I found that LocationServices was on, but in testing I'd stopped the app being able to access the location and you have to go into Location Services (settings) to re-enable it.
-
Moreover, for my problem it needs about 1 minute before the message is shown.